.. oe:namespace:: OEDepict



.. meta::
   :keywords: OEPrepareDepictionOptions, PrepareDepictionOptions


.. _OEDepict_OEPrepareDepictionOptions:

.. oe:class:: OEPrepareDepictionOptions

   .. oe:api::

      class OEPrepareDepictionOptions

   This class represents :ref:`OEPrepareDepictionOptions <OEDepict_OEPrepareDepictionOptions>` that
   stores the following parameters that are used when preparing a molecule
   for depiction.

   .. list-table::
      :widths: 150 100 100 150
      :header-rows: 1

      * - Property
        - Get method
        - Set method
        - Corresponding namespace / type

      * - re-generating 2D coordinates
        - :oe:meth:`GetClearCoords<OEDepict::OEPrepareDepictionOptions::GetClearCoords>`
        - :oe:meth:`SetClearCoords<OEDepict::OEPrepareDepictionOptions::SetClearCoords>`
        - boolean

      * - adding depiction hydrogens
        - :oe:meth:`GetAddDepictionHydrogens<OEDepict::OEPrepareDepictionOptions::GetAddDepictionHydrogens>`
        - :oe:meth:`SetAddDepictionHydrogens<OEDepict::OEPrepareDepictionOptions::SetAddDepictionHydrogens>`
        - boolean

      * - perceiving MDL bond stereo (wedge/hash)
        - :oe:meth:`GetPerceiveBondStereo<OEDepict::OEPrepareDepictionOptions::GetPerceiveBondStereo>`
        - :oe:meth:`SetPerceiveBondStereo<OEDepict::OEPrepareDepictionOptions::SetPerceiveBondStereo>`
        - boolean

      * - suppressing explicit (non-depiction) hydrogens
        - :oe:meth:`GetSuppressHydrogens<OEDepict::OEPrepareDepictionOptions::GetSuppressHydrogens>`
        - :oe:meth:`SetSuppressHydrogens<OEDepict::OEPrepareDepictionOptions::SetSuppressHydrogens>`
        - boolean

      * - depiction orientation
        - :oe:meth:`GetDepictOrientation<OEDepict::OEPrepareDepictionOptions::GetDepictOrientation>`
        - :oe:meth:`SetDepictOrientation<OEDepict::OEPrepareDepictionOptions::SetDepictOrientation>`
        - :oe:constns:`OEDepict::OEDepictOrientation`

      * - algorithmic macrocycle ring depiction
        - :oe:meth:`GetOptimizeMacrocycles<OEDepict::OEPrepareDepictionOptions::GetOptimizeMacrocycles>`
        - :oe:meth:`SetOptimizeMacrocycles<OEDepict::OEPrepareDepictionOptions::SetOptimizeMacrocycles>`
        - boolean

   .. seealso::

      * :oe:func:`OEDepict::OEPrepareDepiction` function


   See the effect of the above parameters in :ref:`Table: Depictions generated with various parameter combinations <table_OEPrepareDepictionOptions>`
   when depiction are generated from the following input:

   **SMILES**
     Parsing the "CC([C@@H]1C[C@@H]2C[C@H]1NC2)N(H)(H)" string with three explicit hydrogens necessary
     to define tetrahedral stereo centers and two additional explicit hydrogens.

   **MDL**
     Reading an MDL file with 2D coordinates and pre-assigned wedge/hash bonds.
     It also includes two explicit hydrogens.

   .. _table_OEPrepareDepictionOptions:

   .. list-table:: **Depictions generated with various parameter combinations**
      :widths: 10 20 20 20 20 30 30
      :header-rows: 1

      * - index
        - clear coordinates
        - suppress explicit H
        - add depict H
        - perceive wedge/hash
        - from SMILES
        - from MDL

      * - **(1)**
        - F
        - F
        - F
        - F
        - .. image:: ../images/OEPrepDepictOpts-SMI-cc-0-sH-0-aH-0-pBS-0.*
        - .. image:: ../images/OEPrepDepictOpts-MDL-cc-0-sH-0-aH-0-pBS-0.*

      * - **(2)**
        - F
        - F
        - F
        - **T**
        -
        -

      * - **(3)**
        - F
        - F
        - **T**
        - F
        -
        -

      * - **(4)**
        - F
        - F
        - **T**
        - **T**
        - .. image:: ../images/OEPrepDepictOpts-SMI-cc-0-sH-0-aH-1-pBS-1.*
        - .. image:: ../images/OEPrepDepictOpts-MDL-cc-0-sH-0-aH-1-pBS-1.*

      * - **(5)**
        - F
        - **T**
        - F
        - F
        -
        -

      * - **(6)**
        - F
        - **T**
        - F
        - **T**
        -
        -

      * - **(7)**
        - F
        - **T**
        - **T**
        - F
        -
        -

      * - **(8)**
        - F
        - **T**
        - **T**
        - **T**
        - .. image:: ../images/OEPrepDepictOpts-SMI-cc-0-sH-1-aH-1-pBS-1.*
        - .. image:: ../images/OEPrepDepictOpts-MDL-cc-0-sH-1-aH-1-pBS-1.*

      * - **(9)**
        - **T**
        - F
        - F
        - F
        -
        -

      * - **(10)**
        - **T**
        - F
        - F
        - **T**
        - .. image:: ../images/OEPrepDepictOpts-SMI-cc-1-sH-0-aH-0-pBS-1.*
        - .. image:: ../images/OEPrepDepictOpts-MDL-cc-1-sH-0-aH-0-pBS-1.*

      * - **(11)**
        - **T**
        - F
        - **T**
        - F
        -
        -

      * - **(12)**
        - **T**
        - F
        - **T**
        - **T**
        - .. image:: ../images/OEPrepDepictOpts-SMI-cc-1-sH-0-aH-1-pBS-1.*
        - .. image:: ../images/OEPrepDepictOpts-MDL-cc-1-sH-0-aH-1-pBS-1.*

      * - **(13)**
        - **T**
        - **T**
        - F
        - F
        -
        -

      * - **(14)**
        - **T**
        - **T**
        - F
        - **T**
        -
        -

      * - **(15)**
        - **T**
        - **T**
        - **T**
        - F
        -
        -

      * - **(16)**
        - **T**
        - **T**
        - **T**
        - **T**
        - .. image:: ../images/OEPrepDepictOpts-SMI-cc-1-sH-1-aH-1-pBS-1.*
        - .. image:: ../images/OEPrepDepictOpts-MDL-cc-1-sH-1-aH-1-pBS-1.*



   **Comments:**

   **(1)**
       MDL = no op; SMILES = generating 2D coordinates is necessary

   **(4)**
       MDL = keeping original 2D coordinates, adding depiction hydrogens, re-perceiving wedge/hash bonds;
       SMILES = generating 2D coordinates, depiction hydrogens are kept; perceiving wedge/hash bonds

   **(8)**
       Default parameters; MDL = keeping original 2D coordinates, re-perceiving all other information;
       SMILES = generating 2D coordinates, regenerating all other information;

   **(10)**
       MDL = regenerating 2D coordinates and re-perceiving wedge/hash bonds (since no depiction hydrogens are added the wedge/hash bonds are on ring bonds);
       SMILES generating 2D coordinates and perceiving wedge/hash bonds;

   **(12)**
       Regenerating all information and keeping all explicit hydrogens

   **(16)**
       Regenerating all information; the depiction of identical molecules imported from SMILES and MDL will be identical

   .. oe:method:: Constructors

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

         .. oe:api::

            OEPrepareDepictionOptions(bool clearcoords = false,
                                      bool suppressH = true)

      .. oe:language:: python

         .. oe:api:: python

            OEPrepareDepictionOptions(clearcoords: bool = False,
                                      suppressH: bool = True) -> OEPrepareDepictionOptions

      Default constructor that initializes an :ref:`OEPrepareDepictionOptions <OEDepict_OEPrepareDepictionOptions>`
      object with the following properties:

      *clearcoords*
         See the :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetClearCoords` method.

      *suppressH*
         See the :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetSuppressHydrogens` method.

      .. list-table::  **Default parameters of the OEPrepareDepictionOptions class**
         :widths: 100 100
         :header-rows: 1

         * - Property
           - Default value

         * - re-generating 2D coordinates
           - false

         * - adding depiction hydrogens
           - true

         * - perceiving MDL bond stereo (wedge/hash)
           - true

         * - suppressing explicit (non-depiction) hydrogens
           - true

         * - depiction orientation
           - :oe:const:`OEDepict::OEDepictOrientation::Default`

         * - algorithmic macrocycle ring depiction
           - false


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

         .. oe:api::

            OEPrepareDepictionOptions(const OEPrepareDepictionOptions& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OEPrepareDepictionOptions(arg2: OEPrepareDepictionOptions) -> OEPrepareDepictionOptions

      Copy constructor.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEPrepareDepictionOptions &operator=(const OEPrepareDepictionOptions &rhs)

      Assignment operator.


   .. _OEDepict_GetAddDepictionHydrogens:


   .. oe:method:: GetAddDepictionHydrogens


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

         .. oe:api::

            bool GetAddDepictionHydrogens() const

      .. oe:language:: python

         .. oe:api:: python

            GetAddDepictionHydrogens() -> bool

      Returns whether the depiction hydrogens are kept/added.

   .. seealso::

      * :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetAddDepictionHydrogens` method


   .. _OEDepict_GetClearCoords:


   .. oe:method:: GetClearCoords


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

         .. oe:api::

            bool GetClearCoords() const

      .. oe:language:: python

         .. oe:api:: python

            GetClearCoords() -> bool

      Returns whether the 2D coordinates of a molecule are re-calculated.

      .. seealso::

         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetClearCoords` method


   .. _OEDepict_GetDepictOrientation:


   .. oe:method:: GetDepictOrientation


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

         .. oe:api::

            unsigned int GetDepictOrientation() const

      .. oe:language:: python

         .. oe:api:: python

            GetDepictOrientation() -> int

      Returns the preferred orientation of the 2D coordinates.
      The return value is taken from the
      :oe:constns:`OEDepict::OEDepictOrientation` namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetDepictOrientation` method


   .. _OEDepict_OEPrepareDepictionOptions_GetOptimizeMacrocycles:


   .. oe:method:: GetOptimizeMacrocycles


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

         .. oe:api::

            bool GetOptimizeMacrocycles() const

      .. oe:language:: python

         .. oe:api:: python

            GetOptimizeMacrocycles() -> bool

      Returns whether the algorithmic macrocycle ring depiction is enabled.

      .. seealso::

         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetOptimizeMacrocycles` method


   .. _OEDepict_GetPerceiveBondStereo:


   .. oe:method:: GetPerceiveBondStereo


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

         .. oe:api::

            bool GetPerceiveBondStereo() const

      .. oe:language:: python

         .. oe:api:: python

            GetPerceiveBondStereo() -> bool

      Returns whether the hash/wedge bonds are re-assigned.

      .. seealso::

         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetPerceiveBondStereo` method


   .. _OEDepict_GetSuppressHydrogens:


   .. oe:method:: GetSuppressHydrogens


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

         .. oe:api::

            bool GetSuppressHydrogens() const

      .. oe:language:: python

         .. oe:api:: python

            GetSuppressHydrogens() -> bool

      Returns whether the explicit (non-depiction) hydrogens are suppressed.

      .. seealso::

         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::SetSuppressHydrogens` method


   .. _OEDepict_SetAddDepictionHydrogens:


   .. oe:method:: SetAddDepictionHydrogens


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

         .. oe:api::

            void SetAddDepictionHydrogens(bool)

      .. oe:language:: python

         .. oe:api:: python

            SetAddDepictionHydrogens(value: bool) -> bool

      Sets whether depiction hydrogens are kept/added.

      .. seealso::

         * :oe:func:`OEDepict::OEAddDepictionHydrogens` function
         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::GetAddDepictionHydrogens` method


   .. _OEDepict_SetClearCoords:


   .. oe:method:: SetClearCoords


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

         .. oe:api::

            void SetClearCoords(bool clearcoords)

      .. oe:language:: python

         .. oe:api:: python

            SetClearCoords(value: bool) -> bool

      Sets whether the 2D coordinates of the molecule are re-calculated.
      If the molecule has no 2D coordinates, then the 2D coordinates are
      always calculated by calling the :oe:func:`OEDepict::OEDepictCoordinates`
      regardless of this setting.

      .. seealso::

         * :oe:func:`OEDepict::OEDepictCoordinates` function
         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::GetClearCoords` method


   .. _OEDepict_SetDepictOrientation:


   .. oe:method:: SetDepictOrientation


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

         .. oe:api::

            void SetDepictOrientation(unsigned int orientation)

      .. oe:language:: python

         .. oe:api:: python

            SetDepictOrientation(value: int) -> bool

      Sets the preferred orientation of the 2D coordinates.

      *orientation*
         This value has to be from the :oe:constns:`OEDepict::OEDepictOrientation`
         namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::GetDepictOrientation` method
         * :oe:constns:`OEDepict::OEDepictOrientation` namespace


   .. _OEDepict_OEPrepareDepictionOptions_SetOptimizeMacrocycles:


   .. oe:method:: SetOptimizeMacrocycles


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

         .. oe:api::

            bool SetOptimizeMacrocycles(bool)

      .. oe:language:: python

         .. oe:api:: python

            SetOptimizeMacrocycles(value: bool) -> bool

      Sets whether to use the algorithmic layout for macrocycle
      ring systems. When enabled, :oe:func:`OEDepict::OEPrepareDepiction`
      will attempt to generate improved algorithmic 2D layout for macrocycles rather than
      using the template lookup or polygon fallback. If the algorithm cannot handle a
      particular ring topology, coordinate generation
      fails and :oe:func:`OEDepict::OEPrepareDepiction` returns ``false``.
      It is the caller's responsibility to retry without this option enabled
      if a fallback depiction is required.

      .. seealso::

         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::GetOptimizeMacrocycles` method
         * :oe:func:`OEDepict::OEPrepareDepiction` function


   .. _OEDepict_SetPerceiveBondStereo:


   .. oe:method:: SetPerceiveBondStereo


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

         .. oe:api::

            bool SetPerceiveBondStereo(bool)

      .. oe:language:: python

         .. oe:api:: python

            SetPerceiveBondStereo(value: bool) -> bool

      Sets whether to re-assign the wedge and hash bonds by calling the
      :oe:func:`OEChem::OEMDLPerceiveBondStereo` function.

      .. seealso::

         * :oe:func:`OEChem::OEMDLPerceiveBondStereo` function in the **OEChem TK** manual
         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::GetPerceiveBondStereo` method


   .. _OEDepict_SetSuppressHydrogens:


   .. oe:method:: SetSuppressHydrogens


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

         .. oe:api::

            void SetSuppressHydrogens(bool)

      .. oe:language:: python

         .. oe:api:: python

            SetSuppressHydrogens(value: bool) -> bool

      Sets whether the explicit (non-depiction) hydrogens are suppressed
      in the molecule.
      Only hydrogens that are necessary to faithfully represent
      tetrahedral stereo-chemistry will be kept.

      .. seealso::

         * :oe:func:`OEChem::OESuppressHydrogens` function in the **OEChem TK** manual
         * :oe:meth:`OEDepict::OEPrepareDepictionOptions::GetSuppressHydrogens` method

