CDK-R / cdkr

Integrating R and the CDK
https://cdk-r.github.io/cdkr/
42 stars 27 forks source link

calculate mass by passing through the molecular formula. The advantag… #83

Closed zachcp closed 5 years ago

zachcp commented 5 years ago

…e here is that the formula manipulator handles isotope assignment of the atoms in the molecule. Isotope assignment (or lack therof) was causing mass calculations to fail

So it appears the issue is not related to a CDK bug as I first thought (see . https://github.com/cdk/cdk/pull/505). Instead, it seems the Isotope information is incorrectly set. Based on the JavaDoc, see here, we can use the IAtomContainer->IMolecularFormula-> MolecularFormulaManipulator.getTotalExactMass where the isotope information is handled by the MolecularFormulaManipulator class.

zachcp commented 5 years ago

thanks @sneumann ; fixed