Chirality Problem

User 21371533d0

06-11-2006 19:17:19

I have some code that reads compounds in SMILES, then creates new Molecules and saves them back in SMILES. I came across some compounds where Marvin failed to preserve the correct chirality. Here is an example:





Code:



    public static void main(String[] args) throws Exception {


        Molecule mol = MolImporter.importMol("[H][C@](N)(S)Cl");


        Molecule newMolecule = new Molecule();





        for (int atomIndex= 0; atomIndex < mol.getAtomCount(); atomIndex++) {


            MolAtom atom = mol.getAtom(atomIndex);


            MolAtom newAtom =  new MolAtom(atom.getAtno());


            newAtom.setFlags(atom.getFlags());


            newMolecule.add(newAtom);


        }





        for (int bondIndex= 0; bondIndex < mol.getBondCount(); bondIndex++) {


            MolBond bond = mol.getBond(bondIndex);


            MolBond newBond =  new MolBond(newMolecule.getAtom(mol.indexOf(bond.getAtom1())),


                                           newMolecule.getAtom(mol.indexOf(bond.getAtom2())),


                                           bond.getType());


            newMolecule.add(newBond);


        }





        mol.clean(2, null);


        newMolecule.clean(2, null);





        for (int atomIndex= 0; atomIndex < mol.getAtomCount(); atomIndex++) {


            if (mol.getChirality(atomIndex) > 0) {


                newMolecule.setChirality(atomIndex, mol.getChirality(atomIndex));


            }


        }





        System.err.println("New smiles: " + newMolecule.toFormat("smiles"));


    }








This dumps
Quote:
[H][C@@](N)(S)Cl
as the new SMILES. I tested this with MarvinBeans 3.5.8, 4.0.6, and 4.1.2 under Linux Fedora Core 4 running kernel 2.6.12 and Java 1.5.0_04, and they all gave the same result.





Finally, I loaded the original smiles
Quote:
[H][C@](N)(S)Cl
to MarvinViewer (Version 4.1.2). Please see the attached 3D view. According to the SMILES, looking from H the other three neighbors N, S and Cl should be in anticlockwise order. But they are drawn in clockwise order which is wrong. Note that MarvinViewer 4.0.6 draws the correct 3D view!

ChemAxon 25dcd765a3

07-11-2006 07:59:11

Thank you for the bug report.


The problem is in the setChirality method.


The new Marvin version will contain the fix.





If the solution is very urgent for you please let me know.

ChemAxon 25dcd765a3

08-11-2006 07:57:42

I have fixed the bug.


Thank you for the report.


The next Marvin release will contain the fix.





Andras