XiaoyangSu / AccuCor

Other
16 stars 11 forks source link

Formula in carbon_isotope_correction #2

Closed joerg-b closed 5 years ago

joerg-b commented 5 years ago

Hello, I'm trying to understand your code and it looks to me as if the incorrect formula is used in the function carbon_isotope_correction and maybe in others. If I understand it correctly, this formula is the one that is read from the csv file. From your example data set it looks like this formula is the sum formula of the uncharged molecule. But the natural abundance correction should be applied to the molecule that was actually measured, which will be the cation or anion. Assuming that your are using ESI ionization, one would have to add or subtract H. I tried both and the result doesn't seem to differ much, so probably it doesn't really matter.

XiaoyangSu commented 5 years ago

You are right on this point! Technically the users should specify the polarity of the experiment, and the ion formula is therefore calculated. However, due to the low natural abundance of 2H, the difference is usually <0.01%. I agree that your correction is mathematically appropriate. For user convenience we don't ask for polarity and we use the directly the formula that the users provide.

pierremillard commented 5 years ago

Provided directly the formula of the molecule that was actually measured indeed looks more convenient to users (at least to me :)