OEGetSmiStringOrder

OEGetSmiStringOrder(mol: Union[OEGraphMol,OEMol,OEQMol], flavor: int) -> OEAtomIter

Returns an iterator over the heavy atoms of a molecule, in the order in which they appear in the canonical SMILES string. Several variants of SMILES format are supported by using different flavors from the OESMILESFlag namespace.

mol = oechem.OEGraphMol()
oechem.OESmilesToMol(mol, "N1CCCC1")
for atom in oechem.OEGetSmiStringOrder(mol):
    print(str(atom))

See also