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.

package openeye.docexamples.oechem;

import openeye.oechem.*;

public class OEGetSmiStringOrder {
    public static void main(String argv[]) {
        OEGraphMol mol = new OEGraphMol();
        oechem.OESmilesToMol(mol, "N1CCCC1");

        for (OEAtomBase atom : oechem.OEGetSmiStringOrder(mol))
            System.out.println(atom.GetIdx() + " " + oechem.OEGetAtomicSymbol(atom.GetAtomicNum()));

See also