User 870ab5b546
09-10-2005 15:01:11
When I calculate a formula from a MOL file, JChem automatically includes in the formula the implicit H atoms. Is there a method that will include in the formula only the explicit atoms in the MOL file?
Also, what's the difference between the molecular formula composition (getComposition()) and the molecular formula (getFormula())? The API for Class ElementalAnalyserPlugin uses these terms but doesn't define them. It should.
ChemAxon d76e6e95eb
10-10-2005 13:33:14
It does not matter for a molecule, whether a hydrogen is drawn as explicit or implicit, the hydrogen is there. Therefore I see not reason to leave out implicit hydrogens from the molcular formula (though you can easily implement a function for it using the API).
Why would you like to have this functionality?
I added a bit more detailed explanation to the composition method of the ElementalAnalysis class.
Oops, just recognized, that you mean the apidoc of the getComposition method of ElementalAnalysisPlugin class. You are right, it is too simple, we will make it more understandable. Thanks!
User 870ab5b546
10-10-2005 14:02:37
Well, I wouldn't have asked for it if we didn't need it!
We want students to draw structures in which all atoms are shown explicitly, and we don't want JChem adding implicit H atoms into the formula if the students haven't drawn them explicitly.
ChemAxon d76e6e95eb
10-10-2005 17:15:25
I understand now why you need this function, but I am afraid, that it is a quite special case. I think, that it would not take long for you to write this custom formula calculation function yourself using the API.
(You can even embed it into a custom plugin, which is integrated into the JChem system.)
User 870ab5b546
10-10-2005 17:35:50
We'll just write our own Java code that counts the number of H atoms in the MOL file and then modifies the JChem formula accordingly.