.. oe:namespace:: OEGraphSim


.. oe:constnamespace:: OEFPBondType

   This namespace contains bond typing options that can be used when
   generating
   :ref:`section_fingerprint_circular`,
   :ref:`section_fingerprint_path` or
   :ref:`section_fingerprint_tree` fingerprints.
   Bond type options control how the bonds of the enumerated circular,
   path or tree fragments are encoded during the fingerprint
   generation.

   The :oe:constns:`OEGraphSim::OEFPBondType` namespace  contains the following constants:

   .. list-table::
      :widths: 80 120
      :header-rows: 1

      * - Constant name
        - Combination of

      * - :oe:const:`OEGraphSim::OEFPBondType::BondOrder`
        -

      * - :oe:const:`OEGraphSim::OEFPBondType::Chiral`
        -

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultBond`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>` | :oe:const:`Chiral<OEGraphSim::OEFPBondType::Chiral>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultCircularBond`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultCircularVSBond`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultCircularVSBond1`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultCircularVSBond2`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultPathBond`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>` | :oe:const:`Chiral<OEGraphSim::OEFPBondType::Chiral>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultPathVSBond`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>` | :oe:const:`Chiral<OEGraphSim::OEFPBondType::Chiral>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultTreeBond`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>`

      * - :oe:const:`OEGraphSim::OEFPBondType::DefaultTreeVSBond`
        - :oe:const:`BondOrder<OEGraphSim::OEFPBondType::BondOrder>`

      * - :oe:const:`OEGraphSim::OEFPBondType::InRing`
        -

      * - :oe:const:`OEGraphSim::OEFPBondType::None`
        -

   .. note::

      The constants of the :oe:constns:`OEGraphSim::OEFPBondType`
      namespace can be **combined** using the bitwise ``OR``
      operation.

   .. note::

      The images in this sections visualize the effect of the
      various bond typing options.

      See also: :ref:`oegraphsim_section_visualizing_molecule_similarity` section

   .. seealso::

      * :oe:constns:`OEGraphSim::OEFPAtomType` namespace
      * :oe:func:`OEGraphSim::OEMakeCircularFP` function
      * :oe:func:`OEGraphSim::OEMakePathFP` function
      * :oe:func:`OEGraphSim::OEMakeTreeFP` function
      * :ref:`section_user_defined_atom_bond_typing` section

   .. ###############################################################################

   .. oe:constant:: BondOrder

      This flag indicates that bond order information is encoded into
      the generated fingerprint, *i.e.*, if two fragments (either
      circular, path or tree) are composed of bonds with different bond
      orders (the value returned by the :oe:cls:`OEChem::OEBondBase::GetOrder`
      method) then the two fragments will be mapped to different bits
      of the fingerprint.
      :ref:`Table: Example of using the BondOrder option<table_OEFPBondType_BondOrder>`
      demonstrates the effect of using the :oe:const:`OEGraphSim::OEFPBondType::BondOrder` flag.

      .. _table_OEFPBondType_BondOrder:

      .. list-table:: **Example of using the** :oe:const:`OEGraphSim::OEFPBondType::BondOrder` **option**
                      (:oe:const:`Path<OEGraphSim::OEFPType::Path>`, numbits=4096, bonds=0-5,
                      atom typing = :oe:const:`AtomicNumber<OEGraphSim::OEFPAtomType::AtomicNumber>`).

         * - .. image:: ../images/OEFPBondTypeNotBondOrder.*
           - .. image:: ../images/OEFPBondTypeBondOrder.*


   .. ###############################################################################

   .. oe:constant:: Chiral

      This flag indicates that chiral and non-chiral bonds (the value
      returned by the :oe:meth:`OEChem::OEBondBase::IsChiral` method) are
      distinguished during the circular, path, the tree fingerprint
      generation.
      :ref:`Table: Example of using the Chiral option<table_OEFPBondType_Chiral>`
      demonstrates the effect of using the :oe:const:`OEGraphSim::OEFPBondType::Chiral` flag.

      .. _table_OEFPBondType_Chiral:

      .. list-table:: **Example of using the** :oe:const:`OEGraphSim::OEFPBondType::Chiral` **option**
                      (:oe:const:`Path<OEGraphSim::OEFPType::Path>`, numbits=4096, bonds=0-5,
                      atom typing = :oe:const:`AtomicNumber<OEGraphSim::OEFPAtomType::AtomicNumber>`).

         * - .. image:: ../images/OEFPBondTypeNotChiral.*
           - .. image:: ../images/OEFPBondTypeChiral.*

      .. note::

         *Cis* and *trans* chiral bonds can not be distinguished when the
         :oe:const:`OEGraphSim::OEFPBondType::Chiral` flag is set.
         Fingerprints generated for molecules ``C\C=C/C`` and ``C/C=C/C``
         will always be identical.
         (See example in :ref:`Figure: Example of molecule similarity of stereoisomers <figure_OEFPBondType_stereo>`).

      .. _figure_OEFPBondType_stereo:

      .. figure:: ../images/OEFPBondTypeBondStereoHandling.*
         :align:  center

         **Example of molecule similarity of cis-trans stereoisomers**


   .. ###############################################################################

   .. oe:constant:: InRing

      This flag indicates that bond topology information is encoded into
      the generated fingerprint, *i.e.*, if two fragments (either
      circular, path or tree) are composed of bonds with different bond
      topology (the value returned by the
      :oe:meth:`OEChem::OEBondBase::IsInRing` method) then the two
      fragments will be mapped to different bits of the fingerprint.

      :ref:`Table: Example of using the InRing option<table_OEFPBondType_InRing>`
      demonstrates the effect of using the :oe:const:`OEGraphSim::OEFPBondType::InRing` flag.

      .. _table_OEFPBondType_InRing:

      .. list-table:: **Example of using the** :oe:const:`OEGraphSim::OEFPBondType::InRing` **option**
                      (:oe:const:`Path<OEGraphSim::OEFPType::Path>`, numbits=4096, bonds=0-5,
                      atom typing = :oe:const:`AtomicNumber<OEGraphSim::OEFPAtomType::AtomicNumber>`).

         * - .. image:: ../images/OEFPBondTypeNotInRing.*
           - .. image:: ../images/OEFPBondTypeInRing.*


   .. ###############################################################################

   .. oe:constant:: DefaultBond

      Same as :oe:const:`OEGraphSim::OEFPBondType::DefaultPathBond` constant.

   .. ###############################################################################

   .. oe:constant:: DefaultCircularBond

      Same as the :oe:const:`OEGraphSim::OEFPBondType::BondOrder` constant.

      See example in :ref:`Figure: Circular fingerprint similarity with default circular atom and bond typing<figure_OEFPBondType_DefaultCircular>`.
      This constant is used as bond typing parameter when a default
      :oe:const:`Circular<OEGraphSim::OEFPType::Circular>` fingerprint is
      generated by the following functions:

      * :oe:func:`OEGraphSim::OEMakeFP` (:ref:`OEFingerPrint <OEGraphSim_OEFingerPrint>` &,
        const :ref:`OEMolBase <OEChem_OEMolBase>` &, :oe:const:`OEGraphSim::OEFPType::Circular`)
      * :oe:func:`OEGraphSim::OEMakeCircularFP`

      .. seealso::

          * :oe:const:`OEGraphSim::OEFPAtomType::DefaultCircularAtom` constant

      .. _figure_OEFPBondType_DefaultCircular:

      .. figure:: ../images/DefaultCircular.*
         :align:  center

   .. oe:constant:: DefaultCircularVSBond

      The default bond typing for the circular fingerprint that is designed for virtual
      screening. Currently it's the same as :oe:const:`OEGraphSim::OEFPBondType::DefaultCircularBond`.

   .. oe:constant:: DefaultCircularVSBond1

      Same as :oe:const:`OEGraphSim::OEFPBondType::DefaultCircularBond` constant.

   .. oe:constant:: DefaultCircularVSBond2

      Same as :oe:const:`OEGraphSim::OEFPBondType::DefaultCircularBond` constant.

   .. ###############################################################################

   .. oe:constant:: DefaultPathBond

      The bitwise OR'd value of the following bond typing options:

      * :oe:const:`OEGraphSim::OEFPBondType::BondOrder`
      * :oe:const:`OEGraphSim::OEFPBondType::Chiral`

      See example in :ref:`Figure: Path fingerprint similarity with default path atom and bond typing<figure_OEFPBondType_DefaultPath>`.
      This constant is used as bond typing parameter when a default
      :oe:const:`Path<OEGraphSim::OEFPType::Path>` fingerprint is
      generated by the following functions:

      * :oe:func:`OEGraphSim::OEMakeFP` (:ref:`OEFingerPrint <OEGraphSim_OEFingerPrint>` &,
        const :ref:`OEMolBase <OEChem_OEMolBase>` &, :oe:const:`OEGraphSim::OEFPType::Path`)
      * :oe:func:`OEGraphSim::OEMakePathFP`

      .. seealso::

          * :oe:const:`OEGraphSim::OEFPAtomType::DefaultPathAtom` constant

      .. _figure_OEFPBondType_DefaultPath:

      .. figure:: ../images/DefaultPath.*
         :align:  center

         **Path fingerprint similarity with default tree atom and bond typing**

   .. oe:constant:: DefaultPathVSBond

      The default bond typing for the tree fingerprint that is designed for virtual
      screening. Currently it's the same as :oe:const:`OEGraphSim::OEFPBondType::DefaultPathBond`.

   .. ###############################################################################

   .. oe:constant:: DefaultTreeBond

      Same as the :oe:const:`OEGraphSim::OEFPBondType::BondOrder` constant.

      See example in :ref:`Figure: Tree fingerprint similarity with default tree atom and bond typing<figure_OEFPBondType_DefaultTree>`.
      This constant is used as bond typing parameter when a default
      :oe:const:`Tree<OEGraphSim::OEFPType::Tree>` fingerprint is
      generated by the following functions:

      * :oe:func:`OEGraphSim::OEMakeFP` (:ref:`OEFingerPrint <OEGraphSim_OEFingerPrint>` &,
        const :ref:`OEMolBase <OEChem_OEMolBase>` &, :oe:const:`OEGraphSim::OEFPType::Tree`)
      * :oe:func:`OEGraphSim::OEMakeTreeFP`

      .. seealso::

          * :oe:const:`OEGraphSim::OEFPAtomType::DefaultTreeAtom` constant

      .. _figure_OEFPBondType_DefaultTree:

      .. figure:: ../images/DefaultTree.*
         :align:  center

         **Tree fingerprint similarity with default tree atom and bond typing**

   .. oe:constant:: DefaultTreeVSBond

      The default bond typing for the tree fingerprint that is designed for virtual
      screening. Currently it's the same as :oe:const:`OEGraphSim::OEFPBondType::DefaultTreeBond`.

   .. ###############################################################################

   .. oe:constant:: None

      No bond properties are encoded when generating a fingerprint.

