wangyujue23 / AccuCor2

Code and test data for AccuCor2
3 stars 2 forks source link

Error in if missing value where TRUE/FALSE needed #8

Open EnEmz opened 2 years ago

EnEmz commented 2 years ago

Hello,

I had an issue when running a dual correction for 13C and 15N natural abundance. After running the function, I get the error attached in the screenshot below. In our method, we do both positive and negative ion modes, which are distinguished in the charge_info.csv file. I attached both sample and the formula/charge info files below. Could you help me out? Thank you for your time.

rstudio_VDTRxacPd5 charge_info.csv all_mets_fixed.xlsx

wangyujue23 commented 2 years ago

Thanks for your report. The most likely reason for the error is because in the input data, 3-hydroxy-trimethyllysine only have the non-labeled intensities and therefore does not need to be corrected. To solve this issue, you can either delete the row of 3-hydroxy-trimethyllysine, or add the 13C1 intensity (which is due to carbon natural abundance) of 3-hydroxy-trimethyllysine. Let me know if this could solve your problem.

1014violin commented 2 years ago

I came across this error as well and found that it occurred when the input was a metabolite that contained only M0 and no isotopologues. Try removing metabolites that are unlabeled beforehand.

EnEmz commented 2 years ago

Thank you for your quick responses. Yes, that fixed the issue for my previous error. Are you planning to make the Accucor 2 function in a similar fashion as Accucor 1 where you can keep molecule data even when no other isotopomers were detected?

I also had another question related to mass ppm between two different isotopomers. I am curious what ppm difference between two masses are allowing when performing calculations. I included a small set of data in this comment, which I had trouble with, specifically when AMP C1N0 and C0N1; S-1-2-Dicarboxyethyl glutathione C2N0 and C1N1 are included together. In my analysis, I kept mass error at 15ppm and excluded all masses between isotopomers if they were below 15ppm.

Thank you so much for the help!

charge_info_neg.csv example.xlsx

wangyujue23 commented 2 years ago

Hi, EnEmz Thanks for the responses. Yes, we are planning to fix this issue soon. You raised a very good question. We have actually discussed this issue in our AccuCor2 paper (PMID: 34193963) Here is the paragraph related to your question:

"It is important to note that accurate input data are crucial for INAC. The input data should contain all the detectable labeled isotopologues and the isotopologues that are not resolved from the labeled ones. When picking and integrating the peaks for metabolites, the mass tolerance window should be made narrow enough to exclude the resolved mass peaks. In reality, this is rarely an issue because most people use narrow mass tolerance window of 5 or 10 ppm for peak picking, which is smaller than the resolvable ML. For serine ([M-H]−, m/z 104.03532) measured under the nominal mass resolution of 70,000, the resolvable ML is 0.00178, which is 17 ppm. On instruments with mass resolution >200,000, the mass tolerance window need to be carefully adjusted to avoid resolved mass peaks. On the other hand, if two mass peaks are not fully resolved, the m/z of the centroid peak is the intensity-weighted average m/z of the two peaks. This may cause some labeled isotopologue peaks to shift from the calculated m/z. We suggest the users to carefully inspect the raw data to ensure the accuracy of peak picking."

In your case, 15 ppm is suitable for AMP and S-1-2-Dicarboxyethyl glutathione since their molecular weights are larger than serine. However, it should be noted that C1N0 and C0N1 AMP would need 120K resolution to be resolved as two separate peaks. The advantage of AccuCor2 is that it will remind you if your instrument resolution is not high enough to resolve the two isotopologues. You are welcome to read our paper for details.

EnEmz commented 2 years ago

Thank you very much for the response, I have not considered that before but it makes sense. I think it is very useful that Accucor 2 reminds you about instrument resolution.

wangyujue23 commented 2 years ago

Dear EnEmz and 1014violin, I am glad to share the news that the newest update for AccuCor2 (V1.1) has fixed the problem where errors appear when only M0 were provided as the input. Please feel free to apply your own dataset to test how this new code works.