On Mon, Dec 19, 2016 at 9:43 AM, Maciek Wójcikowski <mac...@wojcikowski.pl>
wrote:

>
> There is also CanonicalRankAtoms [http://www.rdkit.org/Python_
> Docs/rdkit.Chem.rdmolfiles-module.html#CanonicalRankAtoms] which seams to
> be forgotten.
>

One thing to be aware of here is that this provides the canonical ranking
of atoms that is used for the SMILES generation, but the values are not
equal to the actual output order of the atoms.
Here's an example of that:
In [3]: m = Chem.MolFromSmiles('CC(O)CCN')

In [4]: list(Chem.CanonicalRankAtoms(m))
Out[4]: [0, 5, 2, 4, 3, 1]

In [5]: Chem.MolToSmiles(m)
Out[5]: 'CC(O)CCN'

In [7]: m.GetProp('_smilesAtomOutputOrder')
Out[7]: '[0,1,2,3,4,5,]'

so though atom 1 is ranked in position 5, it ends up being the second atom
output since it is connected to atom 0, which happens to have rank 0.

-greg
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to