Re: [Open Babel] canonicalization of disconnected SMILES

2013-04-16 Thread Craig James
On Tue, Apr 16, 2013 at 12:04 PM, Jeff Janes wrote: > > > I'm using Open Babel 2.3.2 to canonicalize some SMILES strings. > > I thought that each fragment of a disconnected SMILES would be > canonicalized separately (which I believe agrees what what is explained in > http://openbabel.org/dev-api/

Re: [Open Babel] canonicalization of disconnected SMILES

2013-04-16 Thread Tim Vandermeersch
Hi, The reason for canonicalizing the fragments seperatly is to determine their position in the smiles. It was not intended to be used as your example illustrates. However, I think the canonical codes should be the same. It might be the case that the smiles format does something that causes a diff

Re: [Open Babel] Canonicalization

2010-02-21 Thread Leonid Chepelev
> As Chris said, it is not practical to write SMILES with the atoms in a > specific order. > > I suggest you use the more "traditional" way.  You write out the canonical > SMILES, and you also write out an atom-mapping string that correlates the > canonical order to the original order. Oh, and I f

Re: [Open Babel] Canonicalization

2010-02-21 Thread Leonid Chepelev
Thank you for both of your suggestions, Craig, both are informative and will do the job. I'm in a hurry to get a result quickly now, so I think I'll go with your suggestion to modify the appropriate line to make babel print out the Z coordinate for now, and will work on your other suggestion when I

Re: [Open Babel] Canonicalization

2010-02-21 Thread Craig A. James
Leonid Chepelev wrote: > For some reason, the -xx option does not output the Z coordinate even > though the coordinate is non-zero in my input. Probably because I was in a hurry when I wrote it... > Would it be easy for > someone to change that, so that Z-coordinate is printed? If you're in a h

Re: [Open Babel] Canonicalization

2010-02-21 Thread Craig A. James
Leonid, > 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 i

Re: [Open Babel] Canonicalization

2010-02-21 Thread Leonid Chepelev
Well, as I said, I really only want to preserve the mapping of the order of the atoms as they appear in SDF and atoms as they appear in the canonical smiles string. It would seem that using the output options I specified, as a post-conversion step I could simply look for the order of the atoms havi

Re: [Open Babel] Canonicalization

2010-02-21 Thread Geoffrey Hutchison
> babel -isdf yournoncanonicalsdf.sdf -osmi yoursmilesfile.smi -xcx > > The -xc part should output canonical smiles, and -xx gives me the > X-coordinate of the atoms in the order they appear in the canonical > SMILES string. Is this usage safe/correct? Is the canonicalization > algorithm in -osmi

Re: [Open Babel] Canonicalization

2010-02-21 Thread Leonid Chepelev
Thank you Chris, though I must say that canonical smiles definitely re-orders the atom to create an algorithm-unique ordering(except for a couple of buggy cases with tautomers and aromatic systems), though I believe that in some "regular" SMILES, the ordering is often the same as input SDF. Geoffr

Re: [Open Babel] Canonicalization

2010-02-20 Thread Geoffrey Hutchison
> appearance) index of the SDF file atoms and the (order of appearance) > index of the atoms in the newly created SMILES string. This would no longer be a canonical SMILES -- it would be a "regular" SMILES, where there may be several SMILES strings with different ordering. There are ways to crea

Re: [Open Babel] Canonicalization

2010-02-20 Thread Chris Morley
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