.. include:: ../substitutions

.. oe:namespace:: OEGraphSim

.. meta::
   :keywords: OEMakeTreeFP

.. oe:function:: OEMakeTreeFP

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

      .. oe:api::

         bool OEMakeTreeFP(OEFingerPrint& fp, const OEChem::OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEMakeTreeFP(fp: OEFingerPrint, mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

   Generates the :ref:`OEFingerPrint <OEGraphSim_OEFingerPrint>` object as a
   :ref:`section_fingerprint_tree` fingerprint using default
   parameters.

   *fp*
      |makefp|

   *mol*
      |makefpmol|

   The following code snippet shows how to print out the string representation of
   a :oe:const:`OEGraphSim::OEFPType::Tree` fingerprint.
   This string encodes information about default parameters used to generate
   a :oe:const:`OEGraphSim::OEFPType::Tree` fingerprint.

   .. oe:source:: TreeFPDefaultParams.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-TREE-DEFAULT-PARAMS

   .. oe:source:: TreeFPDefaultParams.py
      :language: python
      :noindent:
      :frag:     SNIPPET-TREE-DEFAULT-PARAMS

   ..  oe:language:: python

        :ref:`Full listing. <listing-TreeFPDefaultParams.py>`


   .. oe:source:: TreeFPDefaultParams.java
      :language: java
      :noindent:
      :frag:     SNIPPET-TREE-DEFAULT-PARAMS

   .. oe:source:: TreeFPDefaultParams.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-TREE-DEFAULT-PARAMS

   The output of the above code snippet is:

   .. code-block:: console

      Tree,ver=2.0.0,size=4096,bonds=0-4,atype=AtmNum|Arom|Chiral|FCharge|HvyDeg|Hyb,btype=Order

   .. seealso::

      * :oe:meth:`OEGraphSim::OEFPTypeBase::GetFPTypeString` method

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

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

      .. oe:api::

         bool OEMakeTreeFP(OEFingerPrint& fp, const OEChem::OEMolBase& mol,
                           unsigned int numbits, unsigned int minbonds,
                           unsigned int maxbonds, unsigned int atype,
                           unsigned int btype)

   .. oe:language:: python

      .. oe:api:: python

         OEMakeTreeFP(fp: OEFingerPrint, mol: Union[OEGraphMol,OEMol,OEQMol],
                      numbits: int, minbonds: int, maxbonds: int, atype: int,
                      btype: int) -> bool

   *fp*
      |makefp|

   *mol*
      |makefpmol|

   *numbits*
      |makefpnumbits|

   *minbonds*, *maxbonds*
      The smallest and largest tree fragments (in bonds) that are
      enumerated during the fingerprint generation.
      All enumerated tree fragments are hashed into the
      :ref:`OEFingerPrint <OEGraphSim_OEFingerPrint>` object.

   *atype*
      |makefpatomtype|

   *btype*
      |makefpbondtype|

   .. note::

      For an empty molecule, both :oe:func:`OEGraphSim::OEMakeTreeFP`
      function will return ``false`` and the type of the fingerprint
      will be set to ``0``
      (:oe:meth:`OEGraphSim::OEFingerPrint::GetFPTypeBase`).

   .. seealso::

      * :ref:`chapter_user_defined` chapter
      * :oe:constns:`OEGraphSim::OEFPAtomType` namespace
      * :oe:constns:`OEGraphSim::OEFPBondType` namespace


