1 person found this helpful
I added tags to this post to increase visibility.
One way to address this would be to set up a custom calculation to identify missing compounds for a given injection/signal. The below formula will output "No Calibrated Peak(s) Missing" if no missing compounds are identified. If missing compounds are found, then the formula will output "Fail" followed by a list of the missing compounds for the loaded signal:
If (Count(CurrentSignal.AllMissingCompounds) = 0, "No Calibrated Peak(s) Missing ", "Fail " & string.join(" ",CurrentSignal.AllMissingCompounds.select(function(x) x.Compound_Name.tostring())))
In my CC File, I used an Identifier of "MissingCompounds" for the CC using the above formula. I then created a CC identified as "CompoundA" to check if "Compound A" was found by the MissingCompounds CC to be missing. If so, it will output a value of 0 while if Compound A is not missing then Compound A's concentration will be outputted. Below is the formula for the "CompoundA" CC:
If (InStr(UCase(MissingCompounds), "COMPOUND A") > 0, 0, CurrentSignal.PeakOrGroupByName("Compound A").Compound_Concentration)
You can set up a similar CC to do the same for Compound B, like below (using "CompoundB" as the CC identifier):
If (InStr(UCase(MissingCompounds), "COMPOUND B") > 0, 0, CurrentSignal.PeakOrGroupByName("Compound B").Compound_Concentration)
Then the final step would be to update the CC that you are using to perform your sum so that it uses the CompoundA and CompoundB CCs as opposed to pulling the compound concentrations directly from the data file. Below is the CC I used for this purpose:
(0.7*CompoundA) + CompoundB
Below are the results generated by the custom calculations for a data file where Compound A is missing:
Below is a screenshot of Custom Calculations in the ccf I used to generate the above results (hopefully you can zoom in enough to see the formulas):
Hopefully this helps.
I have tested the CC's with my data and it works as expected. This is a major obstacle you have helped overcome and I am very grateful for your help. Many thanks,