Problems with summary in CCF

Hello,

I have 2 injections and i want to make a summary out of the averages for each peak. 

The problem is that i get  2 averages values because there are 2 injections. Dividing the summary value by 2 is not a solution as it becomes problematic if it detects a peak in one solution and not in the other.

My current formula only work if both injections have the same peaks.

Does anyone know a simpler and better way to solve this problem?

Cheers

  • Hello,

    I am not exactly sure what you are doing here but when asked to give an average value between replicate injections for named peaks I do it this way. In the example, I am using the first part of the sample name to correlate the replicate injections separated by an underscore. Please note the If statement is just so it only has to calculate a value for samples. You can see in the example for peak A, it was not found in the other replicate, so the average is just the value for the injection where it was found. I also included a count so I can see how many data points are in each replicate average. The CC will give the average for each named compound where the sample name before the first underscore is the same and the compound is on the same signal. The last one is only needed past CDS 2.6 where you can have duplicate compound names on separate signals. 

    Marty

    NameSplit Scope - Injection Type - String

    CStr(Split(Sample_Name, "_")(0))

    AveInjConc Scope - PeakOrGroup Type - Double

    If(Sample_Type = 3,CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Where(function(x) x.Signal.Signal_Name = CurrentSignal.Signal_Name).Where(function(x) x.Injection.GetStringCC("NameSplit") = CurrentInjection.GetStringCC("NameSplit")).Select(function(x) x.Compound_Concentration).Average,0)

  • Hey,

    The problem is not the calculation of the Average. I have to summarize two different Peaks. 

    Example:

    Injection 1:  Peak A Concentration: 17;

                       Peak B Concentration: 12;

                       Peak C Concentration: not found;

    Injection 2: Peak A Concentration: 15;

                       Peak B Concentration: not found;

                      Peak C Concentration: 45;

    Now I Calculate the Average:

    Injection 1: Peak A Concentration Average: 16;

                       Peak B Concentration Average: 12;

                       Peak C Concentration Average: "empty";

    Injection 2: Peak A Concentration Average: 16;

                       Peak B Concentration Average: *empty*;

                       Peak C Concentration Average: 45;

    if i want to summarize now:

    Summary: 89

    what it should be:

    summary: 73

    The difference here is that Openlab puts the Average in both of my injections and uses both values for my summary.

    Why does Openlab summarize the same value twice?

    Thanks for the fast reply Slight smile

    Zephura

  • Hello,

    In the example, below I used the previous CC I sent, along with the 2 below to sum the peaks by part of the name and then sum the distinct values. When you set the scope to peakorgroup it does the calculation for every peak and group which is why you can get the values multiple times. The only concern here would be if you got the same value in the list from multiple sources and both needed to be evaluated in the sum. This is very extremely unlikely in a calculation like this but if you were working with a larger list of small integers, it could be a problem. Where it has been a concern for me in the past, I have used a flag of some kind to indicate possible missing values. You can usually compare the count with distinct on and off to test for any issues. 

    Marty

    CStr(Split(Compound_Name, "_")(1))

    CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.GetStringCC("CompNameSplit") = CurrentPeakOrGroup.GetStringCC("CompNameSplit")).Where(function(x) x.Signal.Signal_Name = CurrentSignal.Signal_Name).Where(function(x) x.Injection.GetStringCC("NameSplit") = CurrentInjection.GetStringCC("NameSplit")).Select(function(x) x.GetDoubleCC("AveInjConc")).Distinct.Sum

Was this helpful?