Atomic charges don't add up to total charge

User b98d0d9f19

24-05-2016 16:13:52


I am using MarvinBeans version in Eclipse. I am attempting to extract atomic charges from a molecule (a particular major microspecies, to be precise), and as a consistency check I add up all atomic charges to see if they add up to the total charge of the microspecies. Strangely, this works for only about 90% of the molecules. Do you know why this would be the case?

The core of the code I'm using is:

    ChargePlugin chargePlugin = new ChargePlugin();

    MajorMicrospeciesPlugin mmsPlugin = new MajorMicrospeciesPlugin();

    mmsPlugin.setpH(7.4); // major microspecies generation at pH = 7.4

    MolImporter importer = new MolImporter("all_smiles.txt");

    Molecule mol;

    int molOn=0;

    while ((mol = != null) {



        Molecule majorms = mmsPlugin.getMajorMicrospecies();



        int count = majorms.getAtomCount();

        double totalCharge=0;

        for (int i=0; i < count; ++i) {

              double charge = chargePlugin.getTotalCharge(i);



        System.out.println("sum of atomic charge for molecule "+(molOn)+" is "+totalCharge);


        System.out.println("total charge: "+majorms.getTotalCharge());


It works for the SMILES inputs (for example): 



But for:


the sum of atomic charges is off by about 0.06. When I try more inputs, I find that about 90% of inputs give roughly the right answer (up to machine precision) whereas the other 10% are off by about 0.05-0.1 of a charge. Do you know what could be causing this?

Full code and input file attached.

ChemAxon d51151248d

26-05-2016 15:15:31


Thank you for sending this issue to us. We are investigating it. 


ChemAxon d51151248d

30-05-2016 14:21:40


We managed to reproduce this calculation bug. We will fix it soon. 

Thank you, 


User b98d0d9f19

14-09-2016 14:55:40


Have you figured out the source of the bug and/or fixed it?

ChemAxon d51151248d

18-10-2016 11:31:30

Hi Jacob, 

This bug has been fixed already. Please update your current version to get the fixed version.