On Tue, Oct 2, 2018 at 10:32 PM Peter St. John <peterc.stj...@gmail.com> wrote:
> If I store a molecule as a SMILES string, along with relevant information > about different bonds, is it safe to annotate those bond entries by bond > index? > This has already been answered (yes, you can), but to just provide a bit more detail: The ordering of atoms/bonds in the RDKit molecule that results from reading a particular input is deterministic. The atom ordering in the RDKit molecule created from a SMILES or Mol block will always be the same and will corresponds to the ordering of the atoms in the input. The bond ordering in the RDKit molecule created from a SMILES or Mol block will always be the same. The ordering of bonds from a Mol file corresponds to the ordering in the input file. The ordering from SMILES is a bit more complicated.[1] For the sake of completeness: the ordering of atoms and bonds from any of the other currently supported input types will also always be the same. -greg [1] Here's the story on the ordering of bonds read from SMILES: - non "ring closure" bonds appear in the order in which they appear in the input SMILES. - "ring closure" bonds appear at the end of the set of bonds. their ordering is non-trivial to describe, but it is deterministic. Here's a relatively simple example demonstrating this: In [6]: m = Chem.MolFromSmiles('C12ON1.F2') In [7]: m.Debug() Atoms: 0 6 C chg: 0 deg: 3 exp: 3 imp: 1 hyb: 4 arom?: 0 chi: 0 1 8 O chg: 0 deg: 2 exp: 2 imp: 0 hyb: 4 arom?: 0 chi: 0 2 7 N chg: 0 deg: 2 exp: 2 imp: 1 hyb: 4 arom?: 0 chi: 0 3 9 F chg: 0 deg: 1 exp: 1 imp: 0 hyb: 4 arom?: 0 chi: 0 Bonds: 0 0->1 order: 1 conj?: 0 aromatic?: 0 1 1->2 order: 1 conj?: 0 aromatic?: 0 2 2->0 order: 1 conj?: 0 aromatic?: 0 3 3->0 order: 1 conj?: 0 aromatic?: 0
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss