.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEConfGen

.. meta::
   :keywords: OEConfFixOptions, ConfFixOptions


.. _OEConfGen_OEConfFixOptions:

.. oe:class:: OEConfFixOptions

   .. oe:api::

      class OEConfFixOptions : public OESystem::OEOptions

   This class provides an interface to set up options required for constraining
   a fragment of the molecule during conformational search.

   There are multiple ways to define the substructure for defining the constraints.

     * The first is to provide a substructure query using the command
       :oe:meth:`SetFixSubSearch<OEConfGen::OEConfFixOptions::SetFixSubSearch>`.
       If the input query pattern is in 3D, the corresponding substructure of the target
       is fixed to the query coordinates.  For a non-3D query, the mapped substructure 
       of an input 3D target is fixed, provided that 
       :oe:meth:`SetIncludeInput<OEConfGen::OEOmegaOptions::SetIncludeInput>`
       is set to *true*.

     * The second method is to pass in a 3D structure using the command 
       :oe:meth:`SetFixMol<OEConfGen::OEConfFixOptions::SetFixMol>`. The 
       :oe:meth:`SetFixDeleteH<OEConfGen::OEConfFixOptions::SetFixDeleteH>` 
       command can be used to control whether hydrogens should be retained or 
       discarded from the `FixMol`. The corresponding substructure of the target has the 
       atom coordinates fixed to those from the `FixMol`.

     * The third method is to provide a SMARTS pattern using the command 
       :oe:meth:`SetFixSmarts<OEConfGen::OEConfFixOptions::SetFixSmarts>`.
       The SMARTS pattern is matched against the input molecule to identify a substructure, 
       provided that the input molecule is in 3D and that
       :oe:meth:`SetIncludeInput<OEConfGen::OEOmegaOptions::SetIncludeInput>` 
       is set to *true*. The corresponding substructure of the target is fixed
       during the conformer generation.

     * The fourth method is to provide both a `FixMol` using the command
       :oe:meth:`SetFixMol<OEConfGen::OEConfFixOptions::SetFixMol>`, and a SMARTS string 
       using the command :oe:meth:`SetFixSmarts<OEConfGen::OEConfFixOptions::SetFixSmarts>`. 
       In this case, the SMARTS pattern is matched against the `FixMol` structure 
       to identify a substructure of the `FixMol`. The corresponding substructure of 
       the target is fixed to the coordinates of the `FixMol` substructure 
       during conformer generation.

     * The fifth method is to provide both a `FixMol` using the command
       :oe:meth:`SetFixMol<OEConfGen::OEConfFixOptions::SetFixMol>` and to turn on
       MCS-based fix using the command :oe:meth:`SetFixMCS<OEConfGen::OEConfFixOptions::SetFixMCS>`.
       In this case, the maximum common substructure is matched against the `FixMol` structure
       to identify a substructure of the `FixMol`. The corresponding substructure of 
       the target is fixed to the coordinates of the `FixMol` substructure 
       during conformer generation.

     * The final method is to provide an atom predicate using the command 
       :oe:meth:`SetFixPredicate<OEConfGen::OEConfFixOptions::SetFixPredicate>`, which
       is used to identify target atoms to be fixed.

   For all of the above methods, the initialization of the substructure,
   when applicable, can be controlled using 
   :oe:meth:`SetAtomExpr<OEConfGen::OEConfFixOptions::SetAtomExpr>` and
   :oe:meth:`SetBondExpr<OEConfGen::OEConfFixOptions::SetBondExpr>`.

   The `unique match` flag defined using 
   :oe:meth:`SetFixUniqueMatch<OEConfGen::OEConfFixOptions::SetFixUniqueMatch>` 
   applies to all substructure matches performed, either during creation of
   molecule fragments or when applying the actual constraints.

   The `MaxMatch` defines how many of the matches found during constraint application
   should be applied and can be set using the command
   :oe:meth:`SetFixMaxMatch<OEConfGen::OEConfFixOptions::SetFixMaxMatch>`. If the
   constraining fragment substructure appears twice in the target molecule and
   the `MaxMatch` is set to two or more, the molecule would be constrained to the
   substructure coordinates twice for each of the generated conformers and could
   result in twice the number of conformers compared to setting this value to 1.

   In all cases, the constraints are evaluated by the proximity between the initial
   generated structure of the molecule and the coordinates of the constraining
   substructure. The precision of the proximity evaluation can be controlled by an 
   `RMS` value set using :oe:meth:`SetFixRMS<OEConfGen::OEConfFixOptions::SetFixRMS>`.

   .. seealso::

      * :ref:`OEMolBuilder <OEConfGen_OEMolBuilder>` class
      * :ref:`OETorDriver <OEConfGen_OETorDriver>` class

   The :ref:`OEConfFixOptions <OEConfGen_OEConfFixOptions>` class defines the following public methods:
    * :oe:meth:`GetAtomExpr<OEConfGen::OEConfFixOptions::GetAtomExpr>` and
      :oe:meth:`SetAtomExpr<OEConfGen::OEConfFixOptions::SetAtomExpr>`
    * :oe:meth:`GetBondExpr<OEConfGen::OEConfFixOptions::GetBondExpr>` and
      :oe:meth:`SetBondExpr<OEConfGen::OEConfFixOptions::SetBondExpr>`
    * :oe:meth:`GetFixDeleteH<OEConfGen::OEConfFixOptions::GetFixDeleteH>` and
      :oe:meth:`SetFixDeleteH<OEConfGen::OEConfFixOptions::SetFixDeleteH>`
    * :oe:meth:`GetFixMaxMatch<OEConfGen::OEConfFixOptions::GetFixMaxMatch>` and
      :oe:meth:`SetFixMaxMatch<OEConfGen::OEConfFixOptions::SetFixMaxMatch>`
    * :oe:meth:`GetFixMCS<OEConfGen::OEConfFixOptions::GetFixMCS>` and
      :oe:meth:`SetFixMCS<OEConfGen::OEConfFixOptions::SetFixMCS>`
    * :oe:meth:`GetFixMol<OEConfGen::OEConfFixOptions::GetFixMol>` and
      :oe:meth:`SetFixMol<OEConfGen::OEConfFixOptions::SetFixMol>`
    * :oe:meth:`GetFixPredicate<OEConfGen::OEConfFixOptions::GetFixPredicate>` and
      :oe:meth:`SetFixPredicate<OEConfGen::OEConfFixOptions::SetFixPredicate>`
    * :oe:meth:`GetFixRMS<OEConfGen::OEConfFixOptions::GetFixRMS>` and
      :oe:meth:`SetFixRMS<OEConfGen::OEConfFixOptions::SetFixRMS>`
    * :oe:meth:`GetFixSmarts<OEConfGen::OEConfFixOptions::GetFixSmarts>` and
      :oe:meth:`SetFixSmarts<OEConfGen::OEConfFixOptions::SetFixSmarts>`
    * :oe:meth:`GetFixSubSearch<OEConfGen::OEConfFixOptions::GetFixSubSearch>` and
      :oe:meth:`SetFixSubSearch<OEConfGen::OEConfFixOptions::SetFixSubSearch>`
    * :oe:meth:`GetFixUniqueMatch<OEConfGen::OEConfFixOptions::GetFixUniqueMatch>` and
      :oe:meth:`SetFixUniqueMatch<OEConfGen::OEConfFixOptions::SetFixUniqueMatch>`
    * :oe:meth:`HasFixPattern<OEConfGen::OEConfFixOptions::HasFixPattern>`
    * :oe:meth:`GetMCSMinAtoms<OEConfGen::OEConfFixOptions::GetMCSMinAtoms>` and
      :oe:meth:`SetMCSMinAtoms<OEConfGen::OEConfFixOptions::SetMCSMinAtoms>`
    * :oe:meth:`GetMCSFunc<OEConfGen::OEConfFixOptions::GetMCSFunc>` and
      :oe:meth:`SetMCSFunc<OEConfGen::OEConfFixOptions::SetMCSFunc>`
    * :oe:meth:`GetMCSType<OEConfGen::OEConfFixOptions::GetMCSType>` and
      :oe:meth:`SetMCSType<OEConfGen::OEConfFixOptions::SetMCSType>`

   .. oe:method:: Constructors

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

         .. oe:api::

            OEConfFixOptions()
            OEConfFixOptions(const OEConfFixOptions &)

      .. oe:language:: python

         .. oe:api:: python

            OEConfFixOptions() -> OEConfFixOptions
            OEConfFixOptions(arg2: OEConfFixOptions) -> OEConfFixOptions

      Default and copy constructors.

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

      .. oe:api::

         OEConfFixOptions &operator=(const OEConfFixOptions &)

      Assignment operator.

   .. _OEConfGen_OEConfFixOptions_GetAtomExpr:

   .. oe:method:: GetAtomExpr

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

         .. oe:api::

            unsigned GetAtomExpr() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomExpr() -> int

      See the :oe:meth:`SetAtomExpr<OEConfGen::OEConfFixOptions::SetAtomExpr>` method.

   .. _OEConfGen_OEConfFixOptions_GetBondExpr:


   .. oe:method:: GetBondExpr

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

         .. oe:api::

            unsigned GetBondExpr() const

      .. oe:language:: python

         .. oe:api:: python

            GetBondExpr() -> int

      See the :oe:meth:`SetBondExpr<OEConfGen::OEConfFixOptions::SetBondExpr>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixDeleteH:


   .. oe:method:: GetFixDeleteH

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

         .. oe:api::

            bool GetFixDeleteH() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixDeleteH() -> bool

      See the :oe:meth:`SetFixDeleteH<OEConfGen::OEConfFixOptions::SetFixDeleteH>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixMaxMatch:


   .. oe:method:: GetFixMaxMatch

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

         .. oe:api::

            unsigned int GetFixMaxMatch() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixMaxMatch() -> int

      See the :oe:meth:`SetFixMaxMatch<OEConfGen::OEConfFixOptions::SetFixMaxMatch>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixMCS:


   .. oe:method:: GetFixMCS

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

         .. oe:api::

            bool GetFixMCS() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixMCS() -> bool

      See the :oe:meth:`SetFixMCS<OEConfGen::OEConfFixOptions::SetFixMCS>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixMol:


   .. oe:method:: GetFixMol

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

         .. oe:api::

            const OEChem::OEMolBase& GetFixMol() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixMol() -> OEGraphMol

      See the :oe:meth:`SetFixMol<OEConfGen::OEConfFixOptions::SetFixMol>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixPredicate:


   .. oe:method:: GetFixPredicate

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

         .. oe:api::

            const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>* GetFixPredicate() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixPredicate() -> OEUnaryAtomPred

      See the :oe:meth:`SetFixPredicate<OEConfGen::OEConfFixOptions::SetFixPredicate>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixRMS:


   .. oe:method:: GetFixRMS

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

         .. oe:api::

            double GetFixRMS() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixRMS() -> float

      See the :oe:meth:`SetFixRMS<OEConfGen::OEConfFixOptions::SetFixRMS>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixSmarts:


   .. oe:method:: GetFixSmarts

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

         .. oe:api::

            std::string GetFixSmarts() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixSmarts() -> str

      See the :oe:meth:`SetFixSmarts<OEConfGen::OEConfFixOptions::SetFixSmarts>` method.

   .. _OEConfGen_OEConfFixOptions_GetFixSubSearch:


   .. oe:method:: GetFixSubSearch

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

         .. oe:api::

            OEChem::OESubSearch GetFixSubSearch() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixSubSearch() -> OESubSearch

      Returns the substructure search (:ref:`OESubSearch <OEChem_OESubSearch>`)
      for fixed fragments.

   .. _OEConfGen_OEConfFixOptions_GetFixUniqueMatch:


   .. oe:method:: GetFixUniqueMatch

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

         .. oe:api::

            bool GetFixUniqueMatch() const

      .. oe:language:: python

         .. oe:api:: python

            GetFixUniqueMatch() -> bool

      See the :oe:meth:`SetFixUniqueMatch<OEConfGen::OEConfFixOptions::SetFixUniqueMatch>` method.

   .. _OEConfGen_OEConfFixOptions_GetMCSMinAtoms:


   .. oe:method:: GetMCSMinAtoms

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

         .. oe:api::

            unsigned GetMCSMinAtoms() const

      .. oe:language:: python

         .. oe:api:: python

            GetMCSMinAtoms() -> int

      See the :oe:meth:`SetMCSMinAtoms<OEConfGen::OEConfFixOptions::SetMCSMinAtoms>` method.

   .. _OEConfGen_OEConfFixOptions_GetMCSFunc:


   .. oe:method:: GetMCSFunc

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

         .. oe:api::

            const OEChem::OEMCSFunc* GetMCSFunc() const

      .. oe:language:: python

         .. oe:api:: python

            GetMCSFunc() -> OEMCSFunc

      See the :oe:meth:`SetMCSFunc<OEConfGen::OEConfFixOptions::SetMCSFunc>` method.

   .. _OEConfGen_OEConfFixOptions_GetMCSType:


   .. oe:method:: GetMCSType

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

         .. oe:api::

            unsigned GetMCSType() const

      .. oe:language:: python

         .. oe:api:: python

            GetMCSType() -> int

      See the :oe:meth:`SetMCSType<OEConfGen::OEConfFixOptions::SetMCSType>` method.

   .. _OEConfGen_OEConfFixOptions_HasFixPattern:


   .. oe:method:: HasFixPattern

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

         .. oe:api::

            bool HasFixPattern() const

      .. oe:language:: python

         .. oe:api:: python

            HasFixPattern() -> bool

      Method checks if a criterion for fixing a portion of the molecule
      during conformation search is currently set.

   .. _OEConfGen_OEConfFixOptions_SetAtomExpr:


   .. oe:method:: SetAtomExpr

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

         .. oe:api::

            bool SetAtomExpr(const unsigned)

      .. oe:language:: python

         .. oe:api:: python

            SetAtomExpr(value: int) -> bool

      Sets the **atom expression** to be used for substructure initialization
      from a molecule fragment.
      Default: :oe:const:`OEChem::OEExprOpts::DefaultAtoms`

      .. seealso::

         * :oe:constns:`OEChem::OEExprOpts` namespace

   .. _OEConfGen_OEConfFixOptions_SetBondExpr:


   .. oe:method:: SetBondExpr

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

         .. oe:api::

            bool SetBondExpr(const unsigned)

      .. oe:language:: python

         .. oe:api:: python

            SetBondExpr(value: int) -> bool

      Sets the **bond expression** to be used for substructure initialization
      from a molecule fragment.
      Default: :oe:const:`OEChem::OEExprOpts::DefaultBonds`

      .. seealso::

         * :oe:constns:`OEChem::OEExprOpts` namespace

   .. _OEConfGen_OEConfFixOptions_SetFixDeleteH:


   .. oe:method:: SetFixDeleteH

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

         .. oe:api::

            bool SetFixDeleteH(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetFixDeleteH(value: bool) -> bool

      Sets whether **hydrogens should be stripped** from the fix
      molecule before it is used to match structures.
      Default: True

   .. _OEConfGen_OEConfFixOptions_SetFixMaxMatch:


   .. oe:method:: SetFixMaxMatch

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

         .. oe:api::

            bool SetFixMaxMatch(const unsigned int)

      .. oe:language:: python

         .. oe:api:: python

            SetFixMaxMatch(value: int) -> bool

      Sets the **maximum number of substructure search matches** to be used
      for constraining molecule fragments.
      Default: 1


   .. _OEConfGen_OEConfFixOptions_SetFixMol:


   .. oe:method:: SetFixMol

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

         .. oe:api::

            bool SetFixMol(const OEChem::OEMolBase&)
            bool SetFixMol(OEChem::oemolistream& fstream)

      .. oe:language:: python

         .. oe:api:: python

            SetFixMol(value: Union[OEGraphMol,OEMol,OEQMol]) -> bool
            SetFixMol(fstream: oemolistream) -> bool

      Uses the 3D coordinates of the provided molecule to 
      fix the corresponding substructure in the target molecule during conformer
      generation. For the second overload, only the first molecule from the input 
      :ref:`oemolistream <OEChem_oemolistream>` is used.

   .. _OEConfGen_OEConfFixOptions_SetFixMCS:


   .. oe:method:: SetFixMCS

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

         .. oe:api::

            bool SetFixMCS(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetFixMCS(value: bool) -> bool

      Sets flag to use **MCS** to fix a portion of the molecule during conformation search.
      If set to *true*, the maximum common substructure against the `FixMol` is used to
      define the portion of the molecule to be kept fixed. Default: False

   .. _OEConfGen_OEConfFixOptions_SetFixPredicate:


   .. oe:method:: SetFixPredicate

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

         .. oe:api::

            bool SetFixPredicate(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>&)

      .. oe:language:: python

         .. oe:api:: python

            SetFixPredicate(value: OEUnaryAtomPred) -> bool

      Uses the **atom predicate** to define which atoms should be kept fixed
      during conformation search.

   .. _OEConfGen_OEConfFixOptions_SetFixRMS:


   .. oe:method:: SetFixRMS

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

         .. oe:api::

            bool SetFixRMS(const double)

      .. oe:language:: python

         .. oe:api:: python

            SetFixRMS(value: float) -> bool

      Sets the **RMS distance** (Root Mean Square (RMS) Cartesian)
      below which two atom positions are treated as identical.
      Default: 0.15

   .. _OEConfGen_OEConfFixOptions_SetFixSmarts:


   .. oe:method:: SetFixSmarts

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

         .. oe:api::

            void SetFixSmarts(const std::string&)

      .. oe:language:: python

         .. oe:api:: python

            SetFixSmarts(value: str) -> bool

      Uses the SMARTS pattern to define which portion of the molecule
      should be kept fixed during conformational search.

   .. _OEConfGen_OEConfFixOptions_SetFixSubSearch:


   .. oe:method:: SetFixSubSearch

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

         .. oe:api::

            bool SetFixSubSearch(const OEChem::OESubSearch value)

      .. oe:language:: python

         .. oe:api:: python

            SetFixSubSearch(value: OESubSearch) -> bool

      Uses the substructure search (:ref:`OESubSearch <OEChem_OESubSearch>`) to define which
      portion of the molecule should be kept fixed during conformation search.

   .. _OEConfGen_OEConfFixOptions_SetFixUniqueMatch:


   .. oe:method:: SetFixUniqueMatch

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

         .. oe:api::

            bool SetFixUniqueMatch(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetFixUniqueMatch(value: bool) -> bool

      Sets whether only the **unique** substructure matches should be used
      for coordinate replacement.
      Default: True

   .. _OEConfGen_OEConfFixOptions_SetMCSMinAtoms:


   .. oe:method:: SetMCSMinAtoms

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

         .. oe:api::

            bool SetMCSMinAtoms(const unsigned)

      .. oe:language:: python

         .. oe:api:: python

            SetMCSMinAtoms(value: int) -> bool

      Sets the **minimum number of atoms** required of a subgraph match to 
      be used for MCS-based fixes.
      Default: 1

   .. _OEConfGen_OEConfFixOptions_SetMCSFunc:



   .. oe:method:: SetMCSFunc

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

         .. oe:api::

            bool SetMCSFunc(const OEChem::OEMCSFunc&)

      .. oe:language:: python

         .. oe:api:: python

            SetMCSFunc(value: OEMCSFunc) -> bool

      Sets the **scoring function** to be used for subgraph matching for MCS-based fixes.
      Default: :oe:const:`OEChem::OEMCSMaxBondsCompleteCycles`

   .. _OEConfGen_OEConfFixOptions_SetMCSType:


   .. oe:method:: SetMCSType

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

         .. oe:api::

            bool SetMCSType(const unsigned)

      .. oe:language:: python

         .. oe:api:: python

            SetMCSType(value: int) -> bool

      Sets the **MCS search type** to be used for subgraph matching for MCS-based fixes,
      defined in the :oe:const:`OEChem::OEMCSType` namespace.
      Default: :oe:const:`OEChem::OEMCSType::Exhaustive`
