IllegalStateException in Alignment function

User 37df300f74

27-08-2012 14:55:43

Hi there,


 


I am using alignment plugin (5.10) but encountered the weird illegalStateException when I deal with some specific molecules. Could you please take a quick look?


Thanks


Hongzhou


Here is the rough codes.


public static String aLignMolecule(String refSdf, String smiles)
            {
                try
                {
                    chemaxon.struc.Molecule mRef = MolImporter.importMol(refSdf);
                
                    chemaxon.struc.Molecule m2 = MolImporter.importMol(smiles);
                    m2.aromatize();
                    chemaxon.calculations.hydrogenize.Hydrogenize.addHAtoms(m2, null, chemaxon.struc.MolAtom.ALL_H);
                    m2.clean(3, null);
                    Alignment aa = new Alignment();
                    aa.addMolecule(mRef, false, false);
                    aa.addMolecule(m2, true, true);
                    aa.setAromatize(true);
                    aa.setMode(AlignmentAccuracyMode.ACCURATE);
                    aa.setOrientationType(OrientationType.MCS);
                    //aa.addUserConstraint(0, 3, 1, 4);  // optional: add user constraint between atoms of two different molecules. Any constraint can be added
                    aa.align();
                    Molecule result = aa.getMoleculeWithAlignedCoordinates(1);
                    return result.exportToFormat("sdf");
                }
                catch(Exception ex)
                {
                    ex.printStackTrace();
                    return "";
                
                }


Exception happens when I do aa.addMolecule(mRef, false, false).


java.lang.IllegalStateException
    at chemaxon.marvin.alignment.GaussianSum.createSimple(GaussianSum.java:119)
    at chemaxon.marvin.alignment.GaussianSum.create(GaussianSum.java:59)
    at chemaxon.marvin.alignment.AlignmentMoleculeFactory.generate(AlignmentMoleculeFactory.java:187)


Here is the m2; CC1=C2C(F)=C(N3CCOCC3)C(F)=C(C)C2=NC=C1


mRef


rx_001
  -MTS-   08271210153D 0   0.00000     0.00000     0

 33 35  0  0  0  0  0  0  0  0999 V2000
  -13.6136   10.2056   40.4403 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.0105    9.8098   40.9408 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.7800   10.6434   41.7677 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.2560   11.7710   42.4163 C   0  0  0  0  0  0  0  0  0  0  0  0
  -13.9656   12.0738   42.3258 F   0  0  0  0  0  0  0  0  0  0  0  0
  -16.0720   12.5957   43.1976 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.5218   13.6329   43.8778 N   0  0  0  0  0  0  0  0  0  0  0  0
  -14.7273   14.6457   43.1901 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.1073   16.0554   43.7072 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.0719   16.1017   45.1460 O   0  0  0  0  0  0  0  0  0  0  0  0
  -16.0112   15.1890   45.7402 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.6773   13.7389   45.3238 C   0  0  0  0  0  0  0  0  0  0  0  0
  -17.4419   12.3311   43.2819 C   0  0  0  0  0  0  0  0  0  0  0  0
  -18.2467   13.1595   43.9439 F   0  0  0  0  0  0  0  0  0  0  0  0
  -17.9681   11.1897   42.6725 C   0  0  0  0  0  0  0  0  0  0  0  0
  -17.1307   10.3243   41.9633 C   0  0  0  0  0  0  0  0  0  0  0  0
  -17.6478    9.1761   41.4786 N   0  0  0  0  0  0  0  0  0  0  0  0
  -16.8696    8.2676   40.8583 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.5425    8.5745   40.5556 C   0  0  0  0  0  0  0  0  0  0  0  0
  -13.2526    9.5406   39.6421 H   0  0  0  0  0  0  0  0  0  0  0  0
  -13.6376   11.2313   40.0435 H   0  0  0  0  0  0  0  0  0  0  0  0
  -12.8986   10.1505   41.2690 H   0  0  0  0  0  0  0  0  0  0  0  0
  -14.8650   14.6066   42.0964 H   0  0  0  0  0  0  0  0  0  0  0  0
  -13.6670   14.4520   43.4188 H   0  0  0  0  0  0  0  0  0  0  0  0
  -16.1098   16.3328   43.3428 H   0  0  0  0  0  0  0  0  0  0  0  0
  -14.3886   16.7975   43.3241 H   0  0  0  0  0  0  0  0  0  0  0  0
  -17.0397   15.4450   45.4366 H   0  0  0  0  0  0  0  0  0  0  0  0
  -15.9434   15.2848   46.8360 H   0  0  0  0  0  0  0  0  0  0  0  0
  -14.7183   13.4321   45.7678 H   0  0  0  0  0  0  0  0  0  0  0  0
  -16.4618   13.0811   45.7139 H   0  0  0  0  0  0  0  0  0  0  0  0
  -19.0281   10.9733   42.7558 H   0  0  0  0  0  0  0  0  0  0  0  0
  -17.2742    7.2989   40.5920 H   0  0  0  0  0  0  0  0  0  0  0  0
  -14.9363    7.8496   40.0240 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  2  3  1  0  0  0  0
  3  4  2  0  0  0  0
  4  5  1  0  0  0  0
  4  6  1  0  0  0  0
  6  7  1  0  0  0  0
  7  8  1  0  0  0  0
  8  9  1  0  0  0  0
  9 10  1  0  0  0  0
 10 11  1  0  0  0  0
 11 12  1  0  0  0  0
  7 12  1  0  0  0  0
  6 13  2  0  0  0  0
 13 14  1  0  0  0  0
 13 15  1  0  0  0  0
 15 16  2  0  0  0  0
  3 16  1  0  0  0  0
 16 17  1  0  0  0  0
 17 18  2  0  0  0  0
 18 19  1  0  0  0  0
  2 19  2  0  0  0  0
  1 20  1  0  0  0  0
  1 21  1  0  0  0  0
  1 22  1  0  0  0  0
  8 23  1  0  0  0  0
  8 24  1  0  0  0  0
  9 25  1  0  0  0  0
  9 26  1  0  0  0  0
 11 27  1  0  0  0  0
 11 28  1  0  0  0  0
 12 29  1  0  0  0  0
 12 30  1  0  0  0  0
 15 31  1  0  0  0  0
 18 32  1  0  0  0  0
 19 33  1  0  0  0  0
M  END

ChemAxon 5433b8e56b

28-08-2012 13:07:15

Hi Hongzhou,


we have started to track this issue down, one of my colleagues who is responsible for the Alignment plugin will answer you soon.


Regards,
Istvan

ChemAxon 1b9e90b2e7

31-08-2012 17:48:05

Hi Hongzhou,


sorry for the late answer. I could not reproduce the issue you have submitted.


Could you please run the attached MCSAlignmentBug.java file and see if the error is still there?


If so, please send me the output.The output I colud obtain is the following:


java version:   1.6.0_34
marvin version: 5.10.0 225894

RESULT:

<?xml version="1.0"?><cml version="ChemAxon file format v5.10.0, generated by v5.10.0">
... mrv file containing the two aligned structures...
</cml>


Alternatively, if you just copy-paste the smiles string below into a MarvinSketch window and select Calculations/Conformation/3D Alignment from the menu, and select MCS mode, you obtain the overlay as attached.


CC1=CC=NC2=CC(F)=C(N3CCOCC3)C(F)=C12.CC1=C2C(F)=C(N3CCOCC3)C(F)=C(C)C2=NC=C1


Kind regards,


Adrian


	
	

User 37df300f74

10-09-2012 15:49:00

Sorry Adrian for not replying your message sooner. Too busy last week.


The reference sdf file was exported from another third-party application and it included property like " >  <atomTypes>6;6;6;6;14;6;6;11;7;7;18;7;7;8;8;22;61;16;11;61;16;7;7;11;7;7;7;18", then if import it into marvin and  add/remove atomes from this reference molecule to create a new one and aligned against the reference, I will get previously InvalidStateexception. If I remove this property lines from reference sdf file, then it works. I guess this "atomTypes" from sdf file was internally intepreated by alignment function. maybe we have possbile name clash?


 


Thanks


Hongzhou

User 37df300f74

11-09-2012 20:44:17

Can you share some technical detail on 3D alignment (publications)? some time with tiny structure change in side chain causes scaffold ring shift quite a bit. I use MCS with accurate level and aromatic turned on.  Do you just generate multiple low conformers independently and try to aligned to the fixed reference molecule? Sorry I could not share the molecule in this case.


Hongzhou

ChemAxon 1b9e90b2e7

12-09-2012 16:57:36

Hi Hongzhou,


the "atomTypes" sdf property is generated during the first alignment.  If this array is found, it is expected to have length equals the atomcount. As atoms were removed from from the molecule the length does not match. I will fix this issue and the atomTypes tag will be ignored in the release of 5.11.1 .


"structure change in side chain causes scaffold ring shift quite a bit" : I experienced the same issue using "extended atomtype" based alignment. The reason is found and the bug is fixed in 5.11.0.


We have a GUI under development for the alignment for a series of molecules. If you need solution within some days, we can publish this GUI includig the two fixes above on a webpage via the java webstart faciliy.


Regards,


Adrian

User 37df300f74

12-09-2012 17:12:55

Thanks for clarification. We actually only use it through API. so if you have alignment.jar file containing bug fixs, that would be enough for me.

ChemAxon 1b9e90b2e7

12-09-2012 21:37:18

We are currently working on a (white) paper. The alignment process treats molecules conformationally flexible.


Rotatable bonds are tweaked molecules are translated and rotated in order to maximize the overlap of their chemically colored volumes. Such a volume is shown on the attached image of sildenafil.


Hope this helps.


Adrian