Empower Custom Calculation
I am looking for help with a custom calculation.
I am looking to use the mean area from one peak (API) from several injections then use this area in the calculation of different samples with a different peak (IMP). I am able to calculate the mean for the API but I then don’t seem to be able to use it in further calculations for IMP.
The calculation I am trying to create is:
% IMP = Area IMP peak in sample 1 / Mean area API in sample 2 * 0.5 * 0.2Current calculations in Empower:
Mean_API_Area_in_Ref = EQ(Name,”API”)*Ref.%..AVE(Area)
Area_IMP_peak_in_sample = EQ(Name,”IMP”)*Area
These both work. However when I try to do the final calculation (see below) I get 0 beside API and no other results.
% IMP = (EQ(Name,”IMP”))*(Mean_API_Area_in_Ref)/(Area_IMP_peak_in_sample)*(0.5)*(0.2)
Not sure you need a CF for this. Have you tried setting CCALREF1 in your processing method to the API peak? Faililng that, you can nominate the API peak in Curve Reference (this is all on the Components tab of your Processing method).
Dig in here: https://blog.waters.com/get-empowered-another-reader-question-on-quantitating-impurities-tip-780
If the curve suggestion that Dan mentioned doesn't work, there is an easy way to do this with custom fields.
Your custom field wont work because you have "tied" the mean peak area in the Ref sample to only the API peak through use of your EQ(Name,"API") condition. So this will calculate average area for API fine but... it only populates this value against the API peak, so that when Empower comes along to divide your "Area IMP peak in sample 1" by this average value, it wont exist for the IMP peak, hence the custom field crashes and burns.
Taking into account that combining summary and non-summary CFs requires awareness of the alphabetical naming of the fields, there are a few ways you could approach this:
A Peak, Real, Calculated custom field with search order Result Set Only, Sample and Peak type All, formula Ref.%..AVE(CCalRef1[Area]) called Average_Area, and make sure to put the API peak in the CCalRef1 field of the processing method used to process the data. That's the first CF. Second, again Peak, Real, Calculated, search order Result Set Only, Sample and Peak Type All, formula is:
((Area/Average_Area))*0.5*0.2 or why not make it easier, because 0.5*0.2 = 0.1, so then it becomes ((Area/Average_Area))*0.1. Call this Percent_Imp. This will give a value for every named peak in your samples by dividing their area/average area of ref and multiplying by 0.1.
If you want the %Imp value to only populate for the named peak "Imp", then you can narrow down the custom field as follows:
((CCompRef1[Area])/Average_Area))*0.1, then just populate CCompRef1 with the Imp peak on the same row as the Imp peak in the components table, then when you process your data, you can cycle through your samples and for each one, the Percent_Imp will only be viewable for the "Imp" peak.
Or if you are using CCompRef1 for other purposes, you could code it as follows, making sure that All or Nothing is ticked for this to work:
((Area/Average_Area))*0.1*EQ(Name,"Imp")+NEQ(Name,"Imp")*-1*50000 (this will only populate the result for Imp peak and give a blank space for all other peaks.
Be aware that you need to put the function Summarize Custom Fields as the last line in the sample set before your batch process your sample set for any of these CFs to work.
Hope this helps.0
Thanks for the replies. I managed to sort this last week. However, it did help with another problem I was having. Thanks again
The calculation below helped with the issue that I was having but I now need to use this calculation to calculate unidentified peaks in another sample.
It is calculating the results for unidentified peaks in Ref sample but not for other samples as I am assuming it is “tied” to the Ref sample. I need to use this result for other samples but not sure how to. Is there a way that I can use this for other samples?
Are you looking for Area of unidentified peak/Average Area of CCalRef1 peak in the Ref sample for all the other samples besides Ref, is that the formula?
I'm looking for it to be used in an area limit calculation for unidentified peaks in impurity samples. I currently have
Area_Limit = GT(Area,(Mean_Area_Ref*0.1)) then use this in
Disregard Limit = Area*Area_Limit
But it is only working for unidentified peaks in the Ref sample as it is "tied" to the Ref sample0
Not sure about that one as only the unknowns in the Ref sample will be included- the Mean_Area_Ref isn't populated for the unknown peaks in any of the non-Ref samples. The only way I can see around it is to add a Sample,Real Custom Field to the sample set called Average_ref_area and when you know this value after processing the sample set, add it to Average_ref_area then your Bool CF of GT(Area,(Average_ref_area*01)) will work for all the unknowns in your impurity samples. But its a bit of a pain as you have to process twice..
Thanks for your help
Could this be the order in which custom fields are calculated in accordance with names?
You lead me to believe that the reference average is being calculated by a filed named Mean_Area_Ref, yet custom fields named Area_Limit and Disregard_Limit require this value.
If Empower truly calculates custom fields alphabetically, something I've never been convinced of but have been told it's real, then there is your answer.0
I made a sample cf called Mean_Area_Ref which calculates the mean area of a peak designated as CCalRef1 such that the formula was: Ref.%..AVE(CCalRef1[Area]) and this value populated for all the knowns and all the unknowns for the sample labelled as Ref. Oddly it only populated for the knowns for all the other samples after Ref. So it was pointless referencing this CF in any further calcs such as GT(Area,(Mean_Ref_Area*0.1)), since none of the unknowns had values for Mean_Ref_Area.
I thought with Summarize Custom Fields in a sample set, Empower goes back to the top of the sample set and calculates all the summary custom fields and populates them in all samples, but it must only be for the knowns peaks because the unknown peaks wont populate since Ref isn't in the label.0
Hmmmm.... What if you store the Ref.%..AVE(CCalRef1[Area]) as a result custom field instead of a peak type custom field. At times I have had to use result custom fields to get others to work properly ... the symptom may be similar.
I think that would only return the same area per injection since result custom fields only return one result per chromatogram based on some factor within the chromatogram that represents the totality of the fields within that chromatogram, for example MAX(Area) or SUM(Detector Noise) plus CCalRef1 isn't accepted in a Result CF.
I have compared two intersample CFs before in a Bool or Enum function such as GT(S1.1.(Area),U1.2.(Area)) and this works fine but when you introduce summary custom fields, the same doesn't hold true, and as long as the value for Mean_Ref_Area isn't populated for the unknown peaks, further evaluation is impossible. I tried also setting the CCalRef1 peak as "Default Peak" in the processing method as that usually translates using the same formula for unknown peaks but it still didn't work. I generated a Processing Code SC02 which is a summary custom field error stating "peak field value is not available", presumably pointing to the lack of Mean_Ref_Area as above.
There might be a way to get around it, but I cant see it myself.
Edit: You are right, Shaunwat. When I made a Result, Real, Calculated CF and named the actual peak in the formula, so Ref.%..AVE(Peak1[Area]) and processed this, the result populated for every sample and every peak, both known and unknown, for all samples in the sample set. Then a further Peak, Bool CF as GT(Area,(Ref_Mean*0.1)) with a Use as Position of Yes and No, returned exactly what the OP wanted. The only drawback being you obviously have to always have the peak named exactly as it is in formula, since result cfs done accept CCalRef or CCompref.0
I have tried this and it has worked. This will save a lot of time. Thanks for all the help, it's really appreciated0