Canonical SMILES has the atoms in the same order whatever the input order (which is the reason it is used).
Because the atoms can be in any order in the SDF, ordinary (non-canonical) SMILES with the same order might be have to be very strange. For formaldehyde HCHO if the atoms in the SDF were in the order HOHC, the best SMILES I can find is: [H]1.O=2.[H]3.C123 but there may be something better. Anyway, OpenBabel does not have the option to produce forms like this. However, in the reverse direction, I think the atom order in an output SDF will be the same as an input SMILES. So to get SMILES and SDF identically ordered you could first convert to SMILES and then convert back to SDF. Chris Leonid Chepelev wrote: > Hello, > > I was converting SDF molecules into canonical SMILES, but in my case, > I would like to keep the correspondence between the (order of > appearance) index of the SDF file atoms and the (order of appearance) > index of the atoms in the newly created SMILES string. > > Would you say this is possible without first making the conversion and > then doing graph isomorphism? Since I am doing large numbers of > conversions, efficiency is of great importance and this proposition is > not efficient at all, it would seem. > > I know this is probably very simple, but I have not gone too much into > detail of the inner workings of OpenBabel, so it's difficult for me to > solve currently. I appreciate any advice anyone here may offer. > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss