Re: [Rdkit-discuss] canonical atom indexing
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Greg L. <gre...@gm...> - 2016-03-10 13:19:54
|
On Thu, Mar 10, 2016 at 2:04 PM, Brian Kelley <fus...@gm...> wrote: > Yes, I actually exposed that function to Python in Rdkit :) > > Be aware that the canonical rank and the output order aren't the same > thing. The rank is what is used during graph traversal, when making the > smiles string, to choose what atom to go to next. The output order is what > atoms where output first, second, third in the output smiles string. They > are not necessarily the same. > > Both should, however, be unique for the input graph, but in either case > explicit hydrogens should be added. > Exactly. If you just want a canonical ordering of the atoms, there is no reason to generate the SMILES. You can just use Chem.CanonicalRankAtoms(). The "_smilesAtomOutputOrder" property used to be the only way to get a canonical ordering. It is still useful if you care about the order of atoms in the output SMILES, but is quite inefficient if all you want is a canonical ordering. -greg |