On Thu, Jun 6, 2019 at 11:00 AM Rafal Roszak <rmrmg.c...@gmail.com> wrote:
> Greg, thx for answer > > > In the RDKit the chiral order is determined by the order of the atom's > > bonds. Here's a bit of code showing how to get the neighboring atoms in > the > > correct order: > > Your code tells that atom.GetBonds() return correct order, but the > order is simple numerical order The order is definitely not the simple numerical order. Look at the results that I sent again. > and chiralTag corresponds to the > numerical order (not to chiral tag in smiles string). > So the following code should give the same result: > > for atom in m.GetAtoms(): > if atom.GetChiralTag() not in > (Chem.CHI_TETRAHEDRAL_CCW,Chem.CHI_TETRAHEDRAL_CW): > continue > print( atom.GetChiralTag(), sorted([n.GetIdx() for n in > atom.GetNeighbors()]) ) > This is *definitely* wrong. 1) I'm not sure that atom.GetNeighbors() will always return the results in the same order as the approach using atom.GetBonds() that I suggested. 2) The order of the results is critically important, so sorting the list that comes back is going to randomize your results.
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss