Compound_CalibAmount in report

Hello

I have a processing method where there is some calibration amount entered for a compound. When I am processing a sequence where there are no standards, only QC checks, I cannot get the Compound_CalibAmount values from the processing method and use it in reporting. Is there a way?

Thank you

Martin

  • Hello,

     

    The following custom calculations would work as long as you run the standards with the sample in the same sequence. They are 2 typical calculations for check standards. The level number can be changed to the level your QC check corresponds to in the original standard. If you do not run you standards with the sample or the QC check is a unique concentration level the I would use a constants file as Peter suggests. 

     

    Marty Adams

     

    Compound_Amount / CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Where(function (x) x.injection.Sample.Sample_CalibrationLevel = 2).Select(function(x) x.Compound_CalibrationAmount).Average * 100

     

    Abs(Compound_Amount - CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Where(function (x) x.injection.Sample.Sample_CalibrationLevel = 2).Select(function(x) x.Compound_CalibrationAmount).Average) / CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Where(function (x) x.injection.Sample.Sample_CalibrationLevel = 2).Select(function(x) x.Compound_CalibrationAmount).Average * 100

     

     

     

  • Peter,

     

    Using a calibration run type with no update is useful in Chemstation but unfortunately there is no equivalent in CDS 2.x. I think in the previous update Martin responded his version was OpenLab Data Analysis - Build 2.205.0.1344 version 2.5.

     

     

    The best resource currently is the OpenLab 2.5 help. Also on the install media for CDS 2.x, in the UCL folder you can find example CCFs (M8490-0001\Setup\Tools\Support\UCL\CustomCalculatorExamples).There was user guide in earlier versions of CDS 2.x but it focused on the built-in functions which were limited in use. The current focus on is using LINQ to create expressions for CC formulas. 

    LINQ

    The custom calculation formula language is based on VB and can be extended with LINQ. You can at any time write your formula in LINQ if you are not able to perform your calculations with the pre-defined functions.

    Below is a list of some useful LINQ expressions. This is not exhaustive. Please refer to Microsoft Visual basic LINQ documentation for more details.

    Recommended links:

    Filter

    The principle of filters is to filter a given list of items according to a predicate. To apply filter, you need:

    • a list to filter

    • a predicate (function taking a list item and returning a boolean)

    The result is a new list with some of the items of input list.

    The number of items in the new list is smaller than in the input list.

    Syntax:

    • InputList.Where(Function(x) predicate)

    • Where: to call the filter

    • Function: to write the predicate

    Example:

    CurrentSignal.AllPeaks.Where(Function(p) p.Peak_Area>1.2 and p.Peak_Height<1000) returns a list of peaks with an area greater than 1.2 and height lower than 1000.

    You can use this list in a formula to do the sum of the areas of all peaks in the list:

    Sum("Peak_Area", CurrentSignal.AllPeaks.Where(Function(p) p.Peak_Area>1.2 And p.Peak_Height<1000))

    Projection

    The principle of projection is to create a list from a given list of items by transforming every item. To apply projection, you need:

    • A list to transform

    • A projection function (function taking a list item and returning a new item)

    The result is a new list of same length as input list. Item types can be different!

    Syntax:

    • InputList.Select(Function(x) projection)

    • Select: to call the transformation

    • Function: to write the projection function

    Example:

    CurrentSignal.AllPeaks.Select(Function(p) p.Peak_Area) returns a list of Peak_Area values from a list of peaks.

    You can then do the sum: CurrentSignal.AllPeaks.Select(Function(p) p.Peak_Area).Sum()

    Note that this is equivalent to the predefined Custom Calculation function Sum(“Peak_Area”, CurrentSignal.AllPeaks).

    Aggregate

    The principle of aggregate is to compute a single value from a list. To apply aggregation, you need:

    • InputList.Select(Function(x) projection)

    • A list to aggregate

    • An accumulation function (function taking aggregate and current item)

    • An initial value for aggregate

    The result is a unique aggregated value. The type of aggregated value can be different from item type.

    Syntax:

    • InputList.Aggregate(initial value,Function(acc,x) accumulation)

    • Aggregate: to call the aggregation

    • Function: to write the accumulation function

    Examples:

    (CurrentSignal.AllPeaks.Select(Function(p) p.Peak_Area)).Aggregate("", Function(acc,x) acc+" ; "&x) returns the list of all peaks area separated with a " ; ".

    Note that this is equivalent to a VB function: string.join(" ; " ,CurrentSignal.AllPeaks.Select(Function(p) p.Peak_Area)).

     

    (CurrentSignal.AllPeaks.Select(Function(p) p.Peak_Area)).Aggregate(0.0, Function(acc,x) acc+x) returns the sum of the peak areas.

    Note that it is equivalent to the predefined Custom Calculation function Sum("Peak_Area", CurrentSignal.AllPeaks).

     

     

    .  

  • thank you, that is very useful. 

    however, none of the answers can really be used in practice for my problem. Creating some external file with a constant value and importing it during reporting is simply out of question for a routine lab usage. the other solutions rely on running calibration together with the samples. in which case the calculation is not difficult, just pulling the calibration amount values. 

    I guess i expected something like QC and Cal accuracy or recovery values being available as builtins somehow. as they are in other DA programs.

    Thank you for your efforts though.

  • I am assuming at some point calibration sample were run? Calib_amount will always be blank if the sample type is NOT calibration. The way to calculate the QC amount back to the originals calibration results is shown below.

     

    You can save the calibration result into the Master Method and then calculate the QC and unknowns against that previously saved calibration curve when you load and link that Master method to the results set. Then in a report have a conditional format to flag QCs that fall outside of acceptable parameters.

     

    So methodology is as follows:

     

    1. Process calibration data with appropriate linked method to create calibration curve

    2. Save method AND update Master Method (This saves the calibration curve to the Master Method)

    3. Close this data

    4. Open another sequence with the QCs and sample in it, no calibrators

    5. Load and link the same method as just saved to Master

    6. You can read the "Amount" from the QC check

     

    See screenshot.

     

    Hope that helps

  • Hello,

     

    Typically for methods using a QC check standard at unique concentrations from a current calibration level, I would assign a static value in a constants file for the compounds.  I would then design the SOP to produce the QC standard at that level with tolerances inside the error windows of the method as a whole. If that is not possible and you are changing the QC standard values each time you remake the standard or more frequently then I would use compound custom fields. Custom fields are created at the project level. Compound custom fields can be entered during sequence generation or in data analysis. They can be used in CC or IR to do calculations where you need individual custom values for each compound.  

     

    Marty Adams

     

Was this helpful?