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

.. oe:namespace:: OEChem


.. _OEChem_OECreateSubSearchDatabaseOptions:

.. oe:class:: OECreateSubSearchDatabaseOptions

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::

      class OECreateSubSearchDatabaseOptions

   This class represents the :ref:`OECreateSubSearchDatabaseOptions <OEChem_OECreateSubSearchDatabaseOptions>`
   class that encapsulates properties that determine how a substructure search  database
   is generated when calling the  :oe:func:`OEChem::OECreateSubSearchDatabaseFile`
   function.

   The :ref:`OECreateSubSearchDatabaseOptions <OEChem_OECreateSubSearchDatabaseOptions>` class stores the following properties:

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

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

      * - screen type
        -
        - :oe:meth:`GetScreenType<OEChem::OECreateSubSearchDatabaseOptions::GetScreenType>`
        - :oe:meth:`Constructor<OEChem::OECreateSubSearchDatabaseOptions::Constructors>`
        - :ref:`OESubSearchScreenTypeBase <OEChem_OESubSearchScreenTypeBase>` class

      * - database sorting
        - ``true``
        - :oe:meth:`GetSortByBitCounts<OEChem::OECreateSubSearchDatabaseOptions::GetSortByBitCounts>`
        - :oe:meth:`SetSortByBitCounts<OEChem::OECreateSubSearchDatabaseOptions::SetSortByBitCounts>`
        - boolean

      * - handling molecule titles
        - ``false``
        - :oe:meth:`GetKeepTitle<OEChem::OECreateSubSearchDatabaseOptions::GetKeepTitle>`
        - :oe:meth:`SetKeepTitle<OEChem::OECreateSubSearchDatabaseOptions::SetKeepTitle>`
        - boolean

      * - number of processors
        - ``0`` (0 means :oe:func:`OEGetNumProcessors<OEPlatform::OEGetNumProcessors>`)
        - :oe:meth:`GetNumProcessors<OEChem::OECreateSubSearchDatabaseOptions::GetNumProcessors>`
        - :oe:meth:`SetNumProcessors<OEChem::OECreateSubSearchDatabaseOptions::SetNumProcessors>`
        - unsigned integer

   .. seealso::

      * :oe:func:`OEChem::OECreateSubSearchDatabaseFile` function
      * :ref:`OESubSearchDatabase <OEChem_OESubSearchDatabase>` class

   .. admonition:: Code Example

       * :ref:`section_example_oechem_makefastss` example

   .. oe:method:: Constructors

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

         .. oe:api::

            OECreateSubSearchDatabaseOptions(const OESubSearchScreenTypeBase *)

      .. oe:language:: python

         .. oe:api:: python

            OECreateSubSearchDatabaseOptions(arg2: OESubSearchScreenTypeBase) -> OECreateSubSearchDatabaseOptions

      Constructs an :ref:`OESubSearchScreenTypeBase <OEChem_OESubSearchScreenTypeBase>`
      object with the given screen type.

   .. oe:method:: GetKeepTitle

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

         .. oe:api::

            bool GetKeepTitle() const

      .. oe:language:: python

         .. oe:api:: python

            GetKeepTitle() -> bool

      Returns whether the molecule titles are kept in the output substructure
      search database. The default is ``false``.

      .. seealso::

         * :oe:meth:`OEChem::OECreateSubSearchDatabaseOptions::SetKeepTitle` method

   .. oe:method:: GetNumProcessors

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

         .. oe:api::

            unsigned GetNumProcessors() const

      .. oe:language:: python

         .. oe:api:: python

            GetNumProcessors() -> int

      Returned the number of processors used during the database generation.

      .. seealso::

         * :oe:meth:`OEChem::OECreateSubSearchDatabaseOptions::SetNumProcessors` method

   .. oe:method:: GetScreenType

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

         .. oe:api::

            const OESubSearchScreenTypeBase* GetScreenType() const

      .. oe:language:: python

         .. oe:api:: python

            GetScreenType() -> OESubSearchScreenTypeBase

      Returns the type of the screen that will be generated for each molecule in
      substructure search database.

      .. seealso::

         * :ref:`OESubSearchScreenTypeBase <OEChem_OESubSearchScreenTypeBase>` class

   .. oe:method:: GetSortByBitCounts

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

         .. oe:api::

            bool GetSortByBitCounts() const

      .. oe:language:: python

         .. oe:api:: python

            GetSortByBitCounts() -> bool

      Returns whether to sort the molecules based on their screen bit counts.
      The default is ``true``.

      .. seealso::

         * :oe:meth:`OEChem::OECreateSubSearchDatabaseOptions::SetSortByBitCounts` method

   .. oe:method:: SetKeepTitle

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

         .. oe:api::

            void SetKeepTitle(const bool keep)

      .. oe:language:: python

         .. oe:api:: python

            SetKeepTitle(keep: bool) -> None

      Sets whether to keep molecule titles taken from the input file as
      unique identifiers. If ``false``, a 16 character long
      `UUID <https://en.wikipedia.org/wiki/Universally_unique_identifier>`_ will
      be assigned for each molecule as a new title.

      .. hint::

         If the original molecule titles are kept, these titles should
         be unique.
         :oe:func:`OEChem::OECreateSubSearchDatabaseFile` will not check or
         throw any warnings for non-unique title when generating the substructure
         database files.

      By keeping the titles when the database is generated, an external
      id (such as corporate or vendor id) can be associate with each molecule
      in the substructure search database. When searching the database, the titles of
      the matched molecules can be retrieved by the
      :oe:meth:`OEChem::OESubSearchDatabase::GetMatchTitles` method.

   .. oe:method:: SetNumProcessors

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

         .. oe:api::

            void SetNumProcessors(const unsigned)

      .. oe:language:: python

         .. oe:api:: python

            SetNumProcessors(arg2: int) -> None

      Sets the number of threads that are used to generate the
      substructure search database when calling the
      :oe:func:`OEChem::OECreateSubSearchDatabaseFile` function.
      When set to ``0``, the number of processors used will be the number
      returned by the :oe:func:`OEPlatform::OEGetNumProcessors` function.

   .. oe:method:: SetSortByBitCounts

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

         .. oe:api::

            void SetSortByBitCounts(const bool sort)

      .. oe:language:: python

         .. oe:api:: python

            SetSortByBitCounts(sort: bool) -> None

      Sets whether to sort the molecules based on their screen bit counts.

      .. hint::

         The :ref:`OESubSearchDatabase <OEChem_OESubSearchDatabase>` works with both
         sorted and unsorted input database files. While sorting the
         database at generation can take slightly more time, this pays
         off at search time. Based on the query molecule,
         significant portion of the screen matches can be skipped
         without losing any matches when using a sorted input database.
