#632 MolecularFormulaManipulator error calculating weight?


On Wed, Apr 16, 2008 at 9:05 PM, Noel O'Boyle wrote:

I see that MFAnalyser is gone from trunk, to be replaced by
MolecularFormulaManipulator. Using MolecularFormulaManipulator and the
jar at http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/,
I have the following results...

For the molecule represented by the SMILES string "C", I get a
molecular formula of "C1" (getString)

That's simply because the SMILES did not have explicit hydrogens...
so, use the CDKHydrogenAdded prior to calling the

and a molecular weight of -1 (getTotalExactMass).

Not sure about this one... I'd at least expect to get 12, not -1...



  • Egon Willighagen

    Logged In: YES
    Originator: YES

    The MolecularFormulaManipulator.getTotalExactMass assumes isotopic masses to be already set... but it might better look up the info if not...

    Miguel, do you agree?

  • Rajarshi Guha

    Rajarshi Guha - 2008-10-19

    Added code to getTotalExactMass which will do the configuration of an atom that has not been configured for isotopic information. Note that an alternative is to throw an exception and force the user to configure molecule before getting a molecular formula - which avoids the problem of "hidden effect" of the current solution.

    I'm not closing it at this point - please consider whether the current solution is sufficient or not.

  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks