Configure QC Metrics - Define Deviation from Explicit Retention Time

support
Configure QC Metrics - Define Deviation from Explicit Retention Time clpace  2025-08-13 10:42:48
 

Hello, I'm wondering if I can create or modify the retention time QC metric to display the difference between the Explicit Retention Time and measured retention time for each analyte. The fixed cutoff value helps if I only have one analyte but I'm unsure how I could apply this with a list of 10 transitions that all have different retention times. The justification for this is our data will be processed and matched against a spectral library. Therefore, some deviation amongst retention time is okay as long as we are within 0.1 min of the retention time stored in our library (which was saved as Explicit Retention Time for AutoQC purposes).

 
 
jeckels responded:  2025-08-13 17:59:04

Hello,

Yes, this is possible, though not the default configuration.

When configuring metrics, you can use the "Fixed deviation from mean" method to compare a metric to its average value on a per-analyte basis. That lets you notice when a retention time drifts from its normal values within the folder (or its most current guide set if you've defined one) by more than, say, 0.1 minutes.

In this case, though, you're looking to compare against the value in your library, not the average within the Panorama QC folder. For that, you'd need to create a custom metric (and associated SQL query) where the value is the difference between the observed retention time and its library value.

I took the liberty of setting this up in your QC folder, with this query:

SELECT
Id AS PrecursorChromInfoId,
SampleFileId AS SampleFileId,
BestRetentionTime - MoleculePrecursorId.MoleculeId.ExplicitRetentionTime AS MetricValue
FROM PrecursorChromInfo

You should now be able to configure this new "Retention Time Difference" metric with a "Fixed value cutoff" with a range of -0.1 to 0.1. It would also be possible to update the query to use the absolute value of the difference.

Thanks,
Josh

 
clpace responded:  2025-08-14 07:28:54

Thanks Josh for your help - is there documentation/guidance on how to set up the custom metrics with SQL queries?

 
jeckels responded:  2025-08-14 09:09:38

Yes, here's info for how to configure metrics:

https://www.labkey.org/Documentation/wiki-page.view?name=premPanoConfigMetrics

Here are docs on creating custom SQL queries:

https://www.labkey.org/Documentation/wiki-page.view?name=createQuery

You'll find all of the backing tables in the targetedms schema. The default metrics are implemented with queries whose names start with "QCMetric_" and will be visible in the schema browser.

Here is an example of setting up a custom metric in Panorama:

https://panoramaweb.org/home/Example%20Data/Custom%20Metric%20-%20Peptide%20IDs/wiki-page.view?name=custom-metric

Thanks,
Josh