.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OECreateSmiString

.. oe:function:: OECreateSmiString

   .. oe:language:: c++ java csharp

      .. oe:api::

         void OECreateSmiString(std::string& str, const OEMolBase& mol,
                                unsigned int flavor = OESMILESFlag::DEFAULT,
                                std::pair<const OEAtomBase*, const OEAtomBase*>* atmord = (std::pair<const OEAtomBase*, const OEAtomBase*>*)0)

   .. oe:language:: python

      .. oe:api:: python

         OECreateSmiString(str: str, mol: Union[OEGraphMol,OEMol,OEQMol],
                           flavor: int) -> None

   Creates a SMILES string representing a given molecule.
   Several variants of SMILES format are supported by using different
   flavors from the :oe:constns:`OEChem::OESMILESFlag` namespace.

   .. note::

      :oe:func:`OEChem::OEGetSmiStringOrder` function can be used
      to return an iterator over atoms, in the order in which they appear in the SMILES string.

   .. list-table:: **The following function calls generate identical SMILES**
      :widths: 50 200
      :header-rows: 1

      * - **OEChem TK** function
        - calling :oe:func:`OEChem::OECreateSmiString` with flags from the :oe:constns:`OEChem::OESMILESFlag` namespace

      * - :oe:func:`OEChem::OECreateAbsSmiString`
        - :oe:const:`AtomMaps<OEChem::OESMILESFlag::AtomMaps>` | :oe:const:`RGroups<OEChem::OESMILESFlag::RGroups>`

      * - :oe:func:`OEChem::OECreateCanSmiString`
        - :oe:const:`DEFAULT<OEChem::OESMILESFlag::DEFAULT>` identical to :oe:const:`Canonical<OEChem::OESMILESFlag::Canonical>` | :oe:const:`AtomMaps<OEChem::OESMILESFlag::AtomMaps>` | :oe:const:`RGroups<OEChem::OESMILESFlag::RGroups>`

      * - :oe:func:`OEChem::OECreateIsoSmiString`
        - :oe:const:`ISOMERIC<OEChem::OESMILESFlag::ISOMERIC>` identical to :oe:const:`Isotopes<OEChem::OESMILESFlag::Isotopes>` | :oe:const:`AtomStereo<OEChem::OESMILESFlag::AtomStereo>` | :oe:const:`BondStereo<OEChem::OESMILESFlag::BondStereo>` | :oe:const:`Canonical<OEChem::OESMILESFlag::Canonical>` | :oe:const:`AtomMaps<OEChem::OESMILESFlag::AtomMaps>` | :oe:const:`RGroups<OEChem::OESMILESFlag::RGroups>`

      * - :oe:func:`OEChem::OEMolToSmiles`
        - :oe:const:`ISOMERIC<OEChem::OESMILESFlag::ISOMERIC>` identical to :oe:const:`Isotopes<OEChem::OESMILESFlag::Isotopes>` | :oe:const:`AtomStereo<OEChem::OESMILESFlag::AtomStereo>` | :oe:const:`BondStereo<OEChem::OESMILESFlag::BondStereo>` | :oe:const:`Canonical<OEChem::OESMILESFlag::Canonical>` | :oe:const:`AtomMaps<OEChem::OESMILESFlag::AtomMaps>` | :oe:const:`RGroups<OEChem::OESMILESFlag::RGroups>`

   [1] :oe:func:`OEChem::OEMolToSmiles` is a high-level function that perceives necessary properties before generating :term:`canonical isomeric SMILES`
