I need help with a percent difference custom field
I have the following scenario:
I would like a custom field to calculate the average amount of the duplicate assay injections.
Then I would like a custom field to calculate the percent difference of the average amount for each set of assays.
label  spl name  inj  
A  Asy1  1  Avg Amount  Percent Difference Amount 
A  Asy1  2  
A  Asy2  1  Avg Amount  
A  Asy2  2  
B  Asy1  1  Avg Amount  Percent Difference Amount 
B  Asy1  2  
B  Asy2  1  Avg Amount  
B  Asy2  2 
I would like a custom field to calculate the average amount of the duplicate assay injections.
Then I would like a custom field to calculate the percent difference of the average amount for each set of assays.
0
Best Answer

If you used Area instead of Amount, then at least it calculated correctly since you tested it. To edit it for Amount, just copy and paste the formula to Wordpad, replace Area with Amount, and paste them back into the translation table. I don't see any difficulties with your average amount custom field SAME.%..AVE(Amount) since you have different labels for each sample but check my post above for issues with Amount.
All depends on your bracket standard setup. Using sliding with overlap may be an issue. Using Average of standards throughout run will work. You will have to test that.
0
Answers
As for percent difference, what do you mean? How are you calculating this?
For each lot/batch we do two assay preps (Asy1 & Asy 2) I would like to have the same label for these. Is that possible?
For the percent difference. I would like to get a percent difference between the average amount from Asy1 and Asy2.
(ABS(avgamount(asy1)avgamount(asy2))/ AVE(avgamount of asy1&asy2) X 100
Thanks for the help
Another way is to create 2 CFs as A.%..AVE(Amount) and B.%..AVE(Amount) and call them Avr_A and Avr_B. Then a 3rd peak, real CF search order Result Set Only, all peak and sample type. Formula is:
ABS((Avr_AAvr_B))/((0.5*(Avr_A+Avr_B)))*100 and this will give you a % Difference value. But the drawback is you are limited to A and B so if you running several batches of assay you may need a lot of CFs or to combine them into one long formula.
Another way to make it easier is to use the report method to calculate the average amount per batch, so an All Peaks Table filtered by Label = "X" and a summary function of average against all the Amounts.
Then you just need one CF Peak, Real, Calculated:
ABS(((A.%..AVE(Amount))(B.%..AVE(Amount))))/((0.5*((A.%..AVE(Amount))+(B.%..AVE(Amount)))*100
If there is no way to have it correlate back to the labels, then there in lies the rub. A sample set could have anywhere from 1 to 20 batches. If we went back to your original thought and had each Assay a different label, could it be correlated that then?
There is another way around it but its a long formula. I cant see any other way. You could keep SAME.%..AVE(Amount) for the average off all Assay 1, Assay 2, Assay 3 etc. Then for % Difference, taking into account the worst case of 20 batches:
Create a Peak, Enumerated CF Search Order Result Set Only. All Samples and Peak Type. Set the "Use as" to Field. Lets say 20 batches in a sample set. Assay 1 injections are labelled U1, Assay 2 Injections are labelled U2 all the way to Assay 20 injections labelled as U20. Presuming you want to calculate the percent Diff between Assay 1 and Assay 2 then between Assay 2 and Assay 3 etc (if its only % Diff between 1 and 2, then 3 and 4, then 5 and 6 etc adjust the formula as appropriate), for the formula for the CF put in:
ENUM(EQ(Label,"U2"),EQ(Label,"U3"),EQ(Label,"U4")….EQ(Label,"U20")) and for the translation table you get a list of integers starting with 0 down to 19. So 0 corresponds to the first argument (ie anywhere where Label = U2), 1 corresponds to the second argument (ie anywhere where Label = U3 and on to argument 19 corresponding to Label = U20), so for position 0 the formula you type in is:
ABS(((U1.%..AVE(Amount))(U2.%..AVE(Amount))))/((0.5*((U1.%..AVE(Amount))+(U2.%..AVE(Amount)))*100 (fc) then position 1 becomes:
ABS(((U2.%..AVE(Amount))(U3.%..AVE(Amount))))/((0.5*((U2.%..AVE(Amount))+(U3.%..AVE(Amount)))*100 (fc) all the way down to position 19.
An easy way to do this is to type in the formula in Wordpad for position 0 then just copy and paste into the different translations from 1 to 19, only changing the U2, U3 parts etc of the formula. Its critical you add a space and then (fc) after each formula. Only that way will Empower return it as a calculated custom field.
You can only set the precision of this CF once so set it to whatever you want, eg 3 decimal places. Also note that you cant do anything further with this CF, like get an average of the tabulated values. However, it should work for what you are trying to do and even if you have 40 batches you just run a second sample set of U1 to U20. Good luck.
ABS((A.%..AVE(Area)B.%..AVE(Area)))/((0.5*((A.%..AVE(Area))+B.%..AVE(Area))))*100 (fc)
Hi , I tried a similar approach for another calculation for duplicate injections in standards :
(S0101.1.(Area)S0101.2.(Area))/((S0101.1.(Area)+S0101.2.(Area))/2)*100 (fc)
This works fine but a similar approach for unknowns and average amount :
(U0101.1.(Amount)U0102.1.(Amount))/((U0101.1.(Amount)+U0102.1.(Amount))/2)*100 (fc)
returns a value of 200
ENUM(EQ(Label,"S0101"),EQ(Label,"S0201"),EQ(Label,"S0301"),EQ(Label,"U0101"),EQ(Label,"U0102"),EQ(Label,"U0103"),EQ(Label,"U0104"))
any thoughts thanks
I have had problems with intersample CFs before with Amount, and I think its linked to how Empower calculates Amount and how you do your standard bracketing routine. If you run standards throughout the sample set, building one overall calibration curve to quantitate all unknowns, it isn't a problem as only one curve is associated with the sample set and processing method.
But if you do sliding with or without overlap,jumping back and forth between building calibration curves, clearing the same ones, then building half of the previously cleared curve for the next set of unknowns, you essentially require two standards to get an amount and the second standard hasn't been acquired yet and you are asking Empower to jump forward a step to get the right calibration curve for that amount so I think that screws up the syntax and you get odd results like 200. I had a lot of trouble with this when I was looking for average amount for a batch of samples that split over 2 calibration curves ie 10 samples, 6 injections between bracket standards so 4 on a different bracket and it wouldn't work at all. Only works when either you have all the required labels of unknowns in the same bracket or if you run one calibration curve and quantify all unknowns off that.
Another thing, if you don't have the above issue, is double check your syntax and naming of the custom field. maybe call the CF X_PercentDiff so the Capital X will work only after all fields with the previous letters have been stored. If this doesn't work, might be worth two ENUM CFs one for all the Standard labels and one for Unknown labels but only if the previous calibration setup isn't an issue for you.
I labeled every Assay with a different label Spl1 Asy1 +A1, Spl1 Asy2 = A2, Spl2 Asy1 = A3, Spl2 Asy2 = A4 and so on. I expanded your equation 30 that will give me 15 total lots/batches of assays in one run.
The ave amount calculation works great. And the percent difference calculation works great as well. However I just realized that the equation I put into the translation was ABS((A1.%..AVE(Area)A2.%..AVE(Area)))/((0.5*((A1.%..AVE(Area))+A2.%..AVE(Area))))*100 (fc)
I used AREA by accident and not AMOUNT. However I did test it and it works fine. it did give me the percent difference of the average amount. Any thoughts?