identify previous cal std injection

Is there an easy way to identify the last cal. std. injected prior to a given sample in a sequence and query compound retention times from that injection?

In my lab, one of the methods for retention time identification that we use is comparison to the last calibration standard injected prior to the sample injection.  I have worked out a method for this with IR, but it involves creating 1 of 2 tables for each injection (one for cal. std. and one for all others) for each compound and then selectively updating a variable based on which table was created.  This works but feels cumbersome.  Is there a way to handle this in *.ccf formulas?

  • Hello,

    There is probably a more elegant way to accomplish this, but I believe the below custom calculations should get the job done for you.

    This first CC returns the Sample Name of the last cal standard injected prior to the current sample injection:

    If(CurrentSample.Sample_Type<>1, CurrentSequence.AllSamples.Where(function(x) x.Sample_OrderNumber<CurrentSample.Sample_OrderNumber).Where(function(x) x.Sample_Type=1).Select(function(x) x.Sample_Name).Last, "N/A")

    The second CC will return a compound's retention time in the cal standard identified in the first CC:

    CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Injection.Sample.Sample_OrderNumber<CurrentSample.Sample_OrderNumber).Where(function(x) x.Injection.Sample.Sample_Name=LastCalStd).Where(function(x) x.Compound_Name=CurrentPeakOrGroup.Compound_Name).Select(function(x) x.Peak_RetentionTime).Last

  • This works however I would like to only have this show for my samples that need ID.  I am currently using the Injection_SampleLabel column with "ID" to sort for samples that need ID calculations, but when I tried to use If( Injection_SampleLabel = "*ID*", Peak_RetentionTime/LastCalStdRT, "") it does not work.

  • Hello,

    I think the problem with you CC is the Injection_SampleLabel="*ID*" statement. If you are specifying a label of "ID" in your injection list then just use Injection_SampleLabel="ID". If you labels vary some, but will always include the string "ID" then you can use the statement Injection_SampleLabel like "*ID*". 

  • Thank you.  Changing the '=' to 'Like' fixed my issue.

Was this helpful?