Technical Support Forum Index
Technical Support Forum
Access ChemAxon scientists and developers here. For registration and login issues contact website support.

Support Ticket System is replacing forum

This forum was converted into a searchable archive. You cannot add posts here any more. For support please use our new Ticket System.

Create your first ticket
Atomic charges don't add up to total charge
To watch this topic for replies  Register (enables digests) or give email address:
This topic is locked: you cannot edit posts or make replies.
Display posts from previous:   
    View previous topic :: View next topic    
Author Message
Jacob

Joined: 05 May 2016
Posts: 3

View user's profile

Back to top
Link to postPosted: Tue May 24, 2016 5:13 pmPost subject: Atomic charges don't add up to total charge Reply with quote

Hi,

I am using MarvinBeans version 16.5.16.0 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 = importer.read()) != null) {

         molOn++;

        mmsPlugin.setMolecule(mol);

        mmsPlugin.run();

        Molecule majorms = mmsPlugin.getMajorMicrospecies();

        Hydrogenize.convertImplicitHToExplicit(majorms);

        chargePlugin.setMolecule(majorms);

        chargePlugin.run();

        int count = majorms.getAtomCount();

        double totalCharge=0;

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

              double charge = chargePlugin.getTotalCharge(i);

                  totalCharge+=charge;

        }

        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): 

COc1cc(OC)c(C(=O)CCCN2CCCC2)c(OC)c1

NC1CCN(C1)c1nc2n(cc(C(O)=O)c(=O)c2cc1F)-c1ccc(F)cc1F

But for:

Cc1[nH]cnc1CN1CCc2c(C1=O)c1ccccc1n2C

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.

Daniel
ChemAxon personnel
Joined: 22 Jan 2012
Posts: 315

View user's profile

Back to top
Link to postPosted: Thu May 26, 2016 4:15 pmPost subject: Reply with quote

Hi, 

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

Daniel

Daniel
ChemAxon personnel
Joined: 22 Jan 2012
Posts: 315

View user's profile

Back to top
Link to postPosted: Mon May 30, 2016 3:21 pmPost subject: Reply with quote

Hi, 

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

Thank you, 

Daniel

Jacob

Joined: 05 May 2016
Posts: 3

View user's profile

Back to top
Link to postPosted: Wed Sep 14, 2016 3:55 pmPost subject: Reply with quote

Hi,

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

Daniel
ChemAxon personnel
Joined: 22 Jan 2012
Posts: 315

View user's profile

Back to top
Link to postPosted: Tue Oct 18, 2016 12:31 pmPost subject: Reply with quote

Hi Jacob, 

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

Daniel

This topic is locked: you cannot edit posts or make replies.
Page 1 of 1


To watch this topic for replies   Register (enables digests) or give email address  
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum