MassBank / RMassBank

Playground for experiments on the official http://bioconductor.org/packages/devel/bioc/html/RMassBank.html
Other
12 stars 15 forks source link

Fragment formula annotation is incorrect for multiply-charged ions #307

Open meowcat opened 2 years ago

meowcat commented 2 years ago

For charges > 1 (e.g. mode = "m2H_c2"), fragment formula annotation is incorrect. The m/z used as input for generate.formula is corrected by # electrons corresponding to the precursor charge, but not multiplied by z. This leads to masses that correspond to singly-charged fragments that are off by one electron (for the case of z=2).

In reality, the observed fragments would be either singly or doubly (or triply, etc) charged, and for each possibility both the electron mass and z need to be adjusted.

https://github.com/MassBank/RMassBank/blob/7b780e294a61152a5fc6c7f2cc4f7e1bf8b7d437/R/leMsMs.r#L643-L658

meowcat commented 2 years ago

Working on it in branch https://github.com/MassBank/RMassBank/tree/multiply_charged. Since this changes a core function, I am hesitant to push it into 3.15 release