From: Irilenia N. <no...@eb...> - 2004-12-23 15:11:36
|
Hi, When SMILES are read in with the SmilesParser, aromaticity is generally well recognised if single and double bonds are explicitly given. However, if the atoms themselves are represented as aromatic, then aromaticity detection does not work well. Example: NC1=C2C(=NC=N1)[NH]C=N2 (adenine) is recognised as aromatic. If it is represented as: Nc1ncnc2[nH]cnc12, it is not! However, benzene works ok as c1ccccc1. Anyone has come across this before? Seems like a bug. Merry Christmas to everyone, I. p.s. To try it out use the following Test.java as : java Test "c1ccccc1" java Test "NC1=C2C(=NC=N1)[NH]C=N2" java Test "Nc1ncnc2[nH]cnc12" import org.openscience.cdk.AtomContainer; import org.openscience.cdk.ChemFile; import org.openscience.cdk.ChemObject; import org.openscience.cdk.Molecule; import org.openscience.cdk.Bond; import org.openscience.cdk.io.ChemObjectReader; import org.openscience.cdk.io.ReaderFactory; import org.openscience.cdk.tools.manipulator.ChemFileManipulator; import org.openscience.cdk.tools.HydrogenAdder; import org.openscience.cdk.io.*; import org.openscience.cdk.aromaticity.HueckelAromaticityDetector; import org.openscience.cdk.smiles.SmilesParser; public class Test { public static void main(String[] args) { try { if (args.length <1) { System.err.println("syntax: Test <smiles_string>"); System.exit(0); } // translate the argument as a SMILES string SmilesParser sp = new SmilesParser(); Molecule mol = sp.parseSmiles(args[0]); if (HueckelAromaticityDetector.detectAromaticity(mol)) { System.out.println("Molecule is aromatic!"); } //check the bonds individually for (int i = 0; i < mol.getBondCount(); i++) { System.out.println("bond " + i +" "+mol.getBondAt(i).getOrder()); } }//try catch (Exception exception) { exception.printStackTrace(); } } //main } ++++++++++++++++++++++++++++++++++++++++ Irilenia (Irene) Nobeli EMBL - European Bioinformatics Institute Wellcome Genome Campus Hinxton Cambridge CB10 1SD tel: +44 (0) 1223 492550 fax: +44 (0) 1223 494468 e-mail: no...@eb... |