Mass calculation

User f5e6ccf034

21-04-2008 21:54:03

Should one call directly the relevant methods of MoleculeGraph or go through ElementalAnalyser? Thanks in advance.

ChemAxon 990acf0dec

22-04-2008 14:33:52

Hi Olivier,





It doesn't matter, because the MoleculeGraph.getMass() calls ElementalAnalyser.getMass().





Best regards,





Akos

User f5e6ccf034

25-04-2008 16:23:21

OK. Which leads me to my real question: is it the case that getMass() and getExactMass() will return 0 (or maybe throw) if and only if isQuery() returns true?





Thanks again,





-- O.L.

ChemAxon d76e6e95eb

01-05-2008 08:07:10

The answer is no.





If you call the getMass() and getExactMass() functions of the ElementalAnalyser class directly, it will not return 0 for most of


the queries, it just omits generic atom types during calculations.


So isQuery can be true while ElementalAnalyser.getMass is not zero.





Zero molecular mass means an extreme case when a query does not contain any standard atoms from the periodic system. I can happen, but it is not frequent.





If you call the same functions through the ElementalAnalyserPlugin class, you will get an exception if the molecule contains query features.

User f5e6ccf034

05-05-2008 21:21:21

Returning to my original question, I have a doubt: the result will be the same but perhaps, for a large number of molecules, it is more efficient to go through ElementalAnalyzer: what if each molecule creates a new analyzer object when you call its getMass, getExactMass, getFormula etc?

ChemAxon d76e6e95eb

06-05-2008 21:21:09

You are right, the methods in the MoleculeGraph class initialize a new ElementalAnalyser instance for each calculation. So Calling the ElementalAnalyser class directly can be more efficient.





In practice, however, I would be surprised if you could measure any or any significant speed difference, importing and creating molecules are far more complex operations than this simple object creation. Will you make such a test for the comparison?

User 870ab5b546

22-05-2008 21:14:05

What happens when you operate MolAtom.getMass() on a MolAtom that is an SgroupAtom? Do you get the average molecular weight of the entire shortcut group? If so, is there a way to get the exact mass of the shortcut group also (assuming the most abundant isotope for each atom in the shortcut group)?

ChemAxon d76e6e95eb

23-05-2008 06:02:19

Non-zero mass is returned for atoms of the periodic systems. It returns zero for all other cases.





The atoms of abbreviated groups (superatoms) and multiple groups are stored in the graph, so they are included in the molecular weight calculation. The exactMass function of ElementalAnalyser calculates the monoisotopic mass of molecules even for those containing abbreviated groups.





Other undetermined or quasy determined sgroup types are ignored in the mass calculation.