Adding charges in zwitterions

User c6e73d066d

04-04-2011 13:14:15

Dear Forum readers,


I would like to use Jchem in order to calculate the number of chartged atoms in a chemical structure. This is not equivalent to the formal charge. In the case of a zwitterion displaing one positive charge and one negative charge, I would like a result of "2", not "0". My goal is that no confusion is made between zwitterions and non-charged molecules, as these are obviously different in terms of physchem/ADME properties.


Can any of you help me with this?


Best regards,


Sandro

ChemAxon e08c317633

06-04-2011 17:53:45

Hi Sandro,


It can be done using the Marvin/JChem Java API.


Java code:


Molecule mol = MolImporter.importMol("C[C@H]([NH3+])C([O-])=O");
int allCharges = 0;
for (MolAtom atom : mol.getAtomArray()) {
allCharges += Math.abs(atom.getCharge());
}
System.out.println(allCharges);

Zsolt