Major Microspecies plugin does not work

User 44b98eafc4

18-07-2012 15:54:13


The Major Microspecies plugin does not work for one metabolite I'm working with. The metabolite is attached. When I try to use the plugin this error message appears: "Cannot run plugin: Major Microspecies 2". When I click stack trace the first line is: "java.lang.ArrayIndexOutOfBoundsException: 2 ". Do you have any idea why the plugin does not work on this particular metabolite? I'm using MarvinView 5.10.1 on Windows.


Arna Palsdottir

User 44b98eafc4

18-07-2012 16:02:46


The whole error message is:

java.lang.ArrayIndexOutOfBoundsException: 2
    at chemaxon.calculations.pka.BasicPKa.getAvarageAliphaticSideRingCharge(
    at chemaxon.calculations.pka.BasicPKa.getAliphaticImidepKa(
    at chemaxon.calculations.pka.BasicPKa.getNitrogenBPKa(
    at chemaxon.calculations.pka.BasicPKa.calculate(
    at chemaxon.calculations.pka.IntrinsicIonization.getBpKa(
    at chemaxon.calculations.pka.IntrinsicIonization.getBasicpKa(
    at chemaxon.calculations.pka.PKaLargeModel.getProteinMicropka(
    at chemaxon.calculations.pka.PKaLargeModel.calcProteinMicropKa(
    at chemaxon.calculations.pka.PKaLargeModel.calcMicropKa(
    at chemaxon.calculations.pka.PKaLargeModel.reCalcAtomSet(
    at chemaxon.calculations.pka.PKaLargeModel.calcProteinIonization(
    at chemaxon.calculations.pka.PKaLargeModel.calcMacropKa(
    at chemaxon.calculations.pka.PKaLargeModel.calcChargepHDist(
    at chemaxon.calculations.pka.PKaLargeModel.getMajorMicroSpecies(
    at chemaxon.marvin.calculations.MajorMicrospeciesPlugin.getMajorMicrospecies(
    at chemaxon.marvin.plugin.CalculatorPluginManager.runPlugin(
    at chemaxon.marvin.plugin.CalculatorPluginManager.runPlugin(
    at chemaxon.marvin.plugin.CalculatorPluginManager.runPlugin(
    at chemaxon.marvin.plugin.CalculatorPluginManager.callback(
    at chemaxon.marvin.plugin.PluginManager.callback(
    at chemaxon.marvin.common.swing.MolPanel$

Many thanks!


ChemAxon afdac7b783

19-07-2012 11:16:08

Dear Arna,


Thank you for reporting this bug. We have fixed it, and it will be available in the next release (version 5.10.2, planned for early August).

Best Regards,


User 44b98eafc4

19-07-2012 11:21:07


User 9be621d283

17-12-2013 18:29:00

Dear ChemAxon team,


We get a similar issue as the one reported by Arna Palsdottir but with the latest version of the software and a simple molecule.

The current version of MarvinSketch 6.1.4 does not allow to compute major Microspecies for the water molecule at pH 7.3, with any options combination.

[, Operating system: x86_64 Max OS X 10.6.8]

We get the following error message.

Cannot run plugin: Major Microspecies

java.lang.ArrayIndexOutOfBoundsException: 0
    at chemaxon.struc.MolAtom.getBond(Unknown Source)
    at chemaxon.calculations.pka.PKaLargeModel.isProtonatedNO2(Unknown Source)
    at chemaxon.calculations.pka.PKaLargeModel.neutralize(Unknown Source)
    at chemaxon.calculations.pka.PKaLargeModel.getMajorMicroSpecies(Unknown Source)
    at chemaxon.marvin.calculations.MajorMicrospeciesPlugin.a(Unknown Source)
    at chemaxon.marvin.calculations.MajorMicrospeciesPlugin.getMajorMicrospecies(Unknown Source)
    at chemaxon.marvin.calculations.MajorMicrospeciesPlugin.getDisplayMolecule(Unknown Source)
    at chemaxon.marvin.calculations.MajorMicrospeciesPlugin.getResultMolecule(Unknown Source)
    at Source)
    at chemaxon.marvin.plugin.CalculatorPluginManager.a(Unknown Source)
    at chemaxon.marvin.plugin.CalculatorPluginManager.a(Unknown Source)
    at chemaxon.marvin.plugin.CalculatorPluginManager.a(Unknown Source)
    at chemaxon.marvin.plugin.CalculatorPluginManager.callback(Unknown Source)
    at chemaxon.marvin.plugin.PluginManager.callback(Unknown Source)
    at chemaxon.marvin.common.swing.MolPanel$ Source)


Tested with MarvinSketch-6.1.3 (linux 64bits) and MarvinSketch-6.1.4 (linux 64bits):

--> not working (same error as above)

Tested with MarvinSketch-6.0.3 (linux 64bits):

--> working: H20 is shown as major microspecies at pH 7.3

In our context, it is a severe limitation as we use this functionality routinely to normalize the compounds of the Rhea database (

Thanks for your support.

Anne Morgat

User 851ac690a0

19-12-2013 02:40:11


Yes it is a bug.

I have fixed it now.  The fix will be available in the 6.2 version which is under beta test now. 


User e6dac1475d

19-12-2013 11:13:59

Dear Jozsi,


Thank you for this quick feedback about the problem with water reported by my college Anne above. We really appreciate your reactivity.


Unfortunately, I observe another issue with the the versions 6.x and the major microspecies computations.

It is a problem using the MajorMicrospeciesPlugin class in custom java code. Maybe you can tackle this issue at the same time:

If I try to get the major microspecies for Cu2+ using the MajorMicrospeciesPlugin run() method, it returns false and I get the following error message: "Inconsistent molecular structure".

Here is the our code section:



                Molecule mol = molFromStructure(structure);


                if ( {
                    adjMolecule = phPlugin.getMajorMicrospecies();
                    adjStructure = MolExporter.exportToFormat(adjMolecule, "mol");
                    String warning = phPlugin.getWarningMessage();
                    if (warning != null && warning.length() > 0)
                        LOGGER.error("While adjusting pH: "
                            + phPlugin.getWarningMessage());

                    return adjStructure;

                } else { // Unable to adjust pH
                    LOGGER.error("Unable to adjust pH for id=: " + id + " "
                            + phPlugin.getErrorMessage());
                    LOGGER.error("Structure causing problem:");


=> output with Marvin 6.1.0 and 6.1.3:

Unable to adjust pH for id=: XX Inconsistent molecular structure. [...]

=> output with Marvin 5.10.0:

<No error message>, the major microspecies (Cu2+ itself) is returned.

Here is our molfile for Cu2+ ("structure" string above):


  Marvin  01130622122D          

  1  0  0  0  0  0            999 V2000
    0.0000    0.0000    0.0000 Cu  0  2  0  0  0  0  0  0  0  0  0  0
M  CHG  1   1   2



If I load this molfile in MarvinSketch (5.10.0 or 6.1.0 or 6.1.3) and I perform "Calculations->Protonation->Major Microspecies", no error appears and Cu2+ is shown as result. So this error seems to be specific to the 6.x marvin versions and/or the way we use your API.


I understand that protonation of such a compound is not very relevant, but this is done in a batch procedure for many chemical compounds and I would expect the API to behave like the MarvinSketch in any cases.

Please let me know if you can reproduce this issue and if you can fix this.


Thank you for your support,

Best regards,



User 9be621d283

19-12-2013 11:16:55


User 851ac690a0

19-12-2013 11:39:45



Yes, these type of bugs  which are related with metals, matal ions , metal hydrides as well have been fixed. The fix will be available in the 6.2 release. 




User e6dac1475d

19-12-2013 12:09:37

Dear Jozsi,


Thank you for your feedback on Cu2+. This is encouraging and we are really looking forward to test the 6.2 soon.


Can you also comment about the fact that for the same version of Marvin, I can get an error using the API, but not using the GUI (MarvinSketch) for Cu2+, as I report? For me, this is a point that is independent of the question of Cu2+ being allowed for major microspecies computations or not, and this prevent us to use MarvinSketch in a reliable fashion for manual testing.

Best regards,


User 851ac690a0

19-12-2013 15:10:24


I have done a basic test. I find that the "Cupper ion" is the only outlier which go into the else case.  

Neither valence errored or unionizable molecules run into the else case.


This is not so  user friendly behaviour in the API. I try to fix it.



User e6dac1475d

20-01-2014 08:03:37

Dear Jozsi,


I saw your released a 6.1.6 version on January 16th, 2014. When do you plan to release the 6.2 with the fixes in the MajorMicrospeciesPlugin for the water and Cu2+ issues discussed above?


Best regards,



ChemAxon b62f37c21a

20-01-2014 11:47:49

Dear Thierry,

We expect to release 6.2 in January.

If you would like to try our latest beta build, please see the links below:

 JChem Webservices-Classic 

 and examples for

API documentation:

Note: there is a known issue in Marvin editor, something about
implicit hydrogens.

Best regards,