User 870ab5b546
10-01-2011 16:25:05
MoleculeGraph.getAtomCount(int atno) gets the number of atoms with the given atomic number; when atno == 1, sum includes both implicit and explicit H atoms
MoleculeGraph.getAtomCount(String symbol) gets the number of atoms with the given symbol; when atno == 1, sum includes both implicit and explicit H atoms
ChemAxon e500b51457
12-01-2011 22:00:46
Hi Bob,
We are considering your request.
Did you mean that MoleculeGraph.getAtomCount(String symbol) shoud return the number of atoms with the given symbol; when symbol == H, sum includes both implicit and explicit H atoms?
Regards,
Erika
User 870ab5b546
12-01-2011 22:29:31
Yes. I should add that D and T atoms should be included in getAtomCount("H").
ChemAxon e500b51457
18-01-2011 09:06:10
User 870ab5b546
18-01-2011 14:08:36
That procedure seems awfully cumbersome for something as simple as counting the number of atoms of a certain element.
Both Molecule and ElementalAnalyserPlugin have getFormula() methods; seems to me that they should both have getAtomCount() methods, as well.
ChemAxon e500b51457
21-01-2011 09:54:28
Hi Bob,
The Molecule.getAtomCount() returns the atom count without the implicit hydrogens. If we add a method like Molecule.getAtomCount(int z) then we expect that the sum of the atom-counts of the individual atom-types equals the Molecule.getAtomCount(). This condition won't be satisfied because of the implicit hydrogens.
We are just before a major refactoring/modularization step therefore we dont want to overload the Molecule with methods which might cause inconsistency and possible deprecation later. I added your feature request to our issue-tracking system and we will investigate this problem again during the refactoring. We will notify you about the decision.
Regards,
Erika
User 870ab5b546
21-01-2011 15:24:46
Erika wrote: |
The Molecule.getAtomCount() returns the atom count without the implicit hydrogens. If we add a method like Molecule.getAtomCount(int z) then we expect that the sum of the atom-counts of the individual atom-types equals the Molecule.getAtomCount(). This condition won't be satisfied because of the implicit hydrogens.
|
OK, you can return getExplicitHCount() when z == 1. The important thing is to have a method that counts atoms other than H. We already have methods that count H atoms (explicit or implicit).
BTW, are D and T atoms included in getExplicitHCount()?
ChemAxon e500b51457
25-01-2011 09:31:34
Hi Bob,
We are going to implement the MoleculeGraph.getAtomCount(int z) this way,
the method will return getExplicitHCount() when z == 1.
BTW, are D and T atoms included in getExplicitHCount()?
Yes, they are included.
Regards,
Erika
ChemAxon a202a732bf
29-01-2011 17:55:06
Dear Bob,
FYI, MoleculeGraph.getAtomCount(int atomicNumber) will be available in release 5.5 which is planned for the beginning of April 2011.
Zsuzsa