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?

Parents
  • 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

Reply
  • 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

Children
Was this helpful?