.. include:: ../substitutions


.. oe:namespace:: OEConfGen

.. meta::
   :keywords: OEFlipper

.. _oeconfgen_OEFlipper:

.. oe:function:: OEFlipper

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

     .. oe:api::

        OESystem::OEIterBase<OEChem::OEMolBase>* OEFlipper(const OEChem::OEMolBase& mol,
                                                           const OEFlipperOptions& options)
        OESystem::OEIterBase<OEChem::OEMolBase>* OEFlipper(const OEChem::OEMCMolBase& mol,
                                                           const OEFlipperOptions& options)

  .. oe:language:: python

     .. oe:api:: python

        OEFlipper(mol: OEMol, options: OEFlipperOptions) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]
        OEFlipper(mol: Union[OEGraphMol,OEQMol], options: OEFlipperOptions) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]

  Enumerates the stereocenters of ``mol`` and returns them as a
  series of new molecules.

  **Parameters:**

  *mol*
     The molecule to enumerate. The input molecule will always be
     returned even if there are no stereocenters to enumerate.
  *options*
     The :oe:cls:`options<OEConfGen::OEFlipperOptions>` for enumerating stereocenters of molecules.

  **Deprecated**

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

     .. oe:api::

        OESystem::OEIterBase<OEChem::OEMolBase>* OEFlipper(const OEChem::OEMolBase& mol,
                                                           unsigned int maxcenters = 12,
                                                           bool forceFlip = false,
                                                           bool enumNitrogen = false,
                                                           bool warts = false)
        OESystem::OEIterBase<OEChem::OEMolBase>* OEFlipper(const OEChem::OEMCMolBase& mol,
                                                           unsigned int maxcenters = 12,
                                                           bool forceFlip = false,
                                                           bool enumNitrogen = false,
                                                           bool warts = false)

  .. oe:language:: python

     .. oe:api:: python

        OEFlipper(mol: OEMol, maxcenters: int = 12, forceFlip: bool = False,
                  enumNitrogen: bool = False, warts: bool = False) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]
        OEFlipper(mol: Union[OEGraphMol,OEQMol], maxcenters: int = 12,
                  forceFlip: bool = False, enumNitrogen: bool = False,
                  warts: bool = False) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]

  Enumerates the stereocenters of ``mol`` and returns them as a
  series of new molecules.

  **Parameters:**

  *mol*
     The molecule to enumerate. The input molecule will always be
     returned even if there are no stereocenters to enumerate.
  *maxcenters*
     The number of molecules generated by
     enumerating the stereocenters is :math:`2^N`, where `N` is the number of
     stereocenters.  In some instances, this may be larger than is desired.  This
     parameter indicates the maximum number of stereocenters
     which will be fully enumerated.  If a molecule has more than
     ``maxcenters`` stereocenters, this function will randomly enumerate
     :math:`2^{maxcenters}` instances from the full set of potential isomers.

  *forceFlip*
     This parameter forces the modification of all of the
     stereocenters in a molecule.  If *false* (the default), it will
     only enumerate stereocenters which do not already have a
     specified stereochemistry.
  *enumNitrogen*
     Controls the behavior with respect to the
     enumeration of nonterminal nitrogens.  Any nitrogen with
     pyramidal geometry in the initial model of the input molecule,
     and having no more than two ring bonds is considered to
     be *invertible*.  It will enumerate all possible puckers if
     set to *true*.
  *warts*
     Adds wart to the title of each stereoisomer. A "wart" is a systematic
     naming scheme for the output titles.

  .. caution::

     This function will remove the molecule coordinates.

  .. admonition:: Code Examples

     * :ref:`section_examples_stereo_and_torsion` example