I would vote for make a more obvious way to get to these values.  I have
had the need to do this when working with external depictors (i.e. mol ->
smiles -> depict with atom highlighting is one use case)  I just couldn't
think of a valid API way of doing this.  Attaching these values to the
molecule seems like it isn't really the right solution considering there
are two forms of canonical ordering if isomerisms are considered.  I had
thought about making a CanonicalAtomOrder function that does this as well,
or perhaps making a MolToSmiles variant.

Any other ideas?

On Mon, Dec 19, 2016 at 3:58 AM, Greg Landrum <greg.land...@gmail.com>
wrote:

>
> 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_D
>> ocs/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
>
>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to