Closed meowcat closed 2 years ago
While negative atoms only really make sense for charge=0
(to calculate mass shifts), I will now fix it such that it returns the formally correct result: "C-1" with charge 2- will return the negative mass of a carbon (-12) minus one electron.
findMz.formula
is actually incorrect, and will not work correctly when negative AND positive atom counts are present, or for multiple charges. My 6 year old code is wrong.split.formula.posneg
never multiplies by -1https://github.com/MassBank/RMassBank/blob/e51aa6faa8b091c53272ee62dc53a3315133b25c/R/leCsvAccess.R#L520-L547
https://github.com/MassBank/RMassBank/blob/e51aa6faa8b091c53272ee62dc53a3315133b25c/R/formulaCalculator.R#L356-L365