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

.. oe:namespace:: OEChem


.. _OEChem_OESubSearchScreen:

.. oe:class:: OESubSearchScreen

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::

      class OESubSearchScreen : public OESystem::OEBitVector

   :ref:`OESubSearchScreen <OEChem_OESubSearchScreen>` class represents substructure search screens that encode local
   and global features of query and target molecules.
   These screens can be used to accelerate the substructure search since target molecules that clearly
   can not be matched to the query can be rapidly eliminated.
   Only molecules that pass the screening phase are subjected to the more expensive atom-by-atom validation
   when using the search methods of the :ref:`OESubSearchDatabase <OEChem_OESubSearchDatabase>` class.
   An :ref:`OESubSearchScreen <OEChem_OESubSearchScreen>` objects are typed bit-vectors (:ref:`OEBitVector <OESystem_OEBitVector>`).
   The type determines what kind of queries in mind the screen was designed for
   (SMARTS, MDL query, or molecule query).

   .. figure:: ../images/Screen.*
      :scale: 50
      :align: center

      **Example of using substructure search screens to eliminate target molecules**

   .. seealso::

      * :ref:`OESubSearchScreenTypeBase <OEChem_OESubSearchScreenTypeBase>` class
      * :oe:constns:`OEChem::OESubSearchScreenType` namespace
      * :oe:func:`OEChem::OEMakeSubSearchQueryScreen` and :oe:func:`OEChem::OEMakeSubSearchTargetScreen` functions

   .. oe:method:: Constructors

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

         .. oe:api::

            OESubSearchScreen()

      .. oe:language:: python

         .. oe:api:: python

            OESubSearchScreen() -> OESubSearchScreen

      The default constructor creates an uninitialized
      :ref:`OESubSearchScreen <OEChem_OESubSearchScreen>` object. The object can be initialized by
      calling either the  :oe:func:`OEChem::OEMakeSubSearchQueryScreen` function
      for query molecules or the :oe:func:`OEChem::OEMakeSubSearchTargetScreen` function
      for target molecules.

      .. oe:language:: c++ python

         **Examples:**

         The following code snippet shows how to generate substructure screens:

         .. oe:source:: MakeScreen.cpp
            :language: c++
            :noindent:
            :frag:     SNIPPET

         .. oe:source:: MakeScreen.py
            :language: python
            :noindent:
            :frag:     SNIPPET

         The following code snippet shows how to store and retrieve screens
         as generic data:

         .. oe:source:: ScreenData.cpp
            :language: c++
            :noindent:
            :frag:     SNIPPET

         .. oe:source:: ScreenData.py
            :language: python
            :noindent:
            :frag:     SNIPPET

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

         .. oe:api::

            OESubSearchScreen(const OESubSearchScreen &)

      .. oe:language:: python

         .. oe:api:: python

            OESubSearchScreen(arg2: OESubSearchScreen) -> OESubSearchScreen

      Copy constructor.

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

      .. oe:api::

         OESubSearchScreen &operator=(const OESubSearchScreen &)

      Assignment operator.

   .. 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 (:ref:`OESubSearchScreenTypeBase <OEChem_OESubSearchScreenTypeBase>`).

   .. oe:method:: IsValid

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

         .. oe:api::

            bool IsValid() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns whether the :ref:`OESubSearchScreen <OEChem_OESubSearchScreen>` object has a valid
      screen type.

   .. oe:method: SetScreenType DO NOT DOCUMENT (SHOULD NOT BE SET MANUALLY)

      .. oe:api::

         void SetScreenType(const OESubSearchScreenTypeBase *stype)
