OEGetSmiStringOrderΒΆ

OESystem::OEIterBase<OEAtomBase>*
       OEGetSmiStringOrder(const OEMolBase &mol,
                           unsigned int flavor = OESMILESFlag::DEFAULT);

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.

using System;
using OpenEye.OEChem;

public class OEGetSmiStringOrder 
{
    public static int Main(string[] args)
    {
        OEGraphMol mol = new OEGraphMol();
        OEChem.OESmilesToMol(mol, "N1CCCC1");

        foreach (OEAtomBase atom in OEChem.OEGetSmiStringOrder(mol))
        {
            Console.WriteLine(atom.GetIdx() + " " + OEChem.OEGetAtomicSymbol(atom.GetAtomicNum()));
        }
        return 0;
    }
}

See also