From: Syed A. R. <as...@eb...> - 2014-05-13 21:27:38
|
Thanks, I tried this code, the isomeric seems to hold the stereo information but converting it back to MDL file format, I am loosing the Stereo information in the bond connection table. Here is my snippet. The MDL is loosing the up/down info. in the bond section. SmilesParser smilesParser = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = smilesParser.parseSmiles("C[C@H](N)C(O)=O"); String sm = SmilesGenerator.isomeric().aromatic().create(mol); Assert.assertEquals("C[C@H](N)C(O)=O", sm); try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { try (MDLV2000Writer mdlWriter = new MDLV2000Writer(baos)) { mdlWriter.write(mol); mdlWriter.close(); } System.out.println("ac " + baos.toString()); On 13 May 2014, at 22:06, John May <jo...@eb...> wrote: > Hi Asad, > > You are generating a generic SMILES, you probably want an isomeric SMILES. Both and non-canonical and intended for storage, canonical equivalence are unique and absolite. > > http://cdk.github.io/cdk/1.5/docs/api/index.html?org/openscience/cdk/smiles/SmilesGenerator.html > > J > > On 13 May 2014, at 17:05, Syed Asad Rahman <as...@eb...> wrote: > >> Hi, >> >> What is the best way to preserve the stereo chemistry in the CDK while converting an AtomContainer to SMILES and back (round trip)? >> >> IAtomContainer=>SMILES=> IAtomContainer (leads to loss of stereo information) >> >> Thanks, >> >> Asad >> >> PS: Attached is a molecule (L-Alanine) with Stereo centre. >> >> <Mol_Stereo.mol> > |