I use ChargePlugin to compute partial charges, and in my situation it returns NaN for any hydrogen. And it occurs not just for "implicit" hydrogens, but for any, including those in hydroxyl and amino groups.
I imported the relevant library, and essentially recycled the code example from the developers' section of this site. The structures contain explicit hydrogens and are read from mol2 or sdf formatted files, as opposed to the SMILES string in the example. The example, apparently, doesn't even attempt to compute charges on hydrogens and also generates charges only for heavy atoms.
When I use the desktop version (MarvinSpace or View) with the implicit hydrogen charge option enabled, I actually get the charges. How is this option enabled in the code? I didn't find anything in the API.
I'm using version 126.96.36.199.
Thank you for any suggestions
Charge of implicit hydrogens can be obtained with this function:
Where the "index" is refer to any atom which may connected with one or more hydrogen atoms.
See the attached picture.
Does this help you?
Thank you, Jozsi.
I understand the mechanism you are referring to.. I wonder if there is a way to get the charges on all atoms, with all charges already assigned, without having to call the implicit hydrogens method. Since I'm trying to use the plugin with another Java application that does structure loading and display, translating indices of the implicit hydrogens can be rather painful. It becomes fairly hard to determine, which atom in the ChemAxon data structure corresponds to which in the data structure of my application.
As a side note, it might be useful to have this all-atom charge calculation available, with charges assigned to each atom according to its index (unless I missed it somewhere in the API). Frankly, the only people that ignore "implicit" hydrogens are those doing molecular mechanics (although I'm sure it simplifies the charge calculation quite a bit).
Also, for some reason, ALL hydrogens are considered "implicit" by the plugin - even those in amino and hydroxyl groups. And that can't be correct from any point of view..
I guess, this simplistic approach accounts for the difference in calculated charges between ChemAxon's plugin and commercial software.. Generally, the plugin seems to generate much smallercharges. For example, if you try it for an anion of acetic acid, there is no way that ChargePlugin can produce a total -1 charge on the structure. The oxygens are assigned only -0.2, while in reality it's closer to -0.8.. You get the idea...
So, while access to the charges of implicit hydrogens may be resolved, there is a bigger problem with the algorithm itself, unfortunately. And the results produced by ChargePlugin are qualitative at best..
Ok. I have understood what is the problem. I ask plugin developers what can be done.
I hope the developers at ChemAxon will have a chance to look into it.
I am a developer at Chemaxon.
And I am sure that many other Chemaxon's developers read your problem.
We are going to back to you as soon as possible.