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

.. oe:namespace:: OESpruce

.. meta::
   :keywords: OESpruceFilter, SpruceFilter, filter, StructuralFilter

.. _chapter_sprucetk_sprucefilter:



.. _OESpruce_OESpruceFilter:

.. oe:class:: OESpruceFilter

   .. attention::

      |TWOLANGUAGE|

   .. note::

      Note: We strongly recommend running :ref:`OESpruceFilter <OESpruce_OESpruceFilter>` for standardization and filtering prior to running the design unit preparation.

   .. oe:api::

      class OESpruceFilter

   This class performs standardization and quality filtering on a biomolecular
   structure prior to design unit preparation with
   :oe:func:`OESpruce::OEMakeDesignUnit` or
   :oe:func:`OESpruce::OEMakeDesignUnits`. Checks include residue name validity,
   residue states, covalent bonds to metals, and crystal symmetry.

   .. seealso::

      * :ref:`OESpruceFilterOptions <OESpruce_OESpruceFilterOptions>` class.
      * :ref:`OEMakeDesignUnit <OESpruce_OEMakeDesignUnit>` function.
      * :ref:`OEMakeBioDesignUnit <OESpruce_OEMakeBioDesignUnits>` function.

   .. oe:method:: Constructors

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

         .. oe:api::

            OESpruceFilter()
            OESpruceFilter(const OESpruceFilterOptions&,
                           const OEMakeDesignUnitOptions&)

      .. oe:language:: python

         .. oe:api:: python

            OESpruceFilter() -> OESpruceFilter
            OESpruceFilter(fOpts: OESpruceFilterOptions,
                           makeOpts: OEMakeDesignUnitOptions) -> OESpruceFilter

      Constructor for spruce filter given the specified options class.
      If no :ref:`OESpruceFilterOptions <OESpruce_OESpruceFilterOptions>` and :ref:`OEMakeDesignUnitOptions <OESpruce_OEMakeDesignUnitOptions>` are passed in as ``fopts`` and ``DUOpts``,
      then the default options class will be passed into the constructor.

      .. seealso::

         * :ref:`OESpruceFilterOptions <OESpruce_OESpruceFilterOptions>` class
         * :ref:`OEMakeDesignUnitOptions <OESpruce_OEMakeDesignUnitOptions>` class


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

         .. oe:api::

            OESpruceFilter(const OESpruceFilter& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OESpruceFilter(rhs: OESpruceFilter) -> OESpruceFilter

      Copy constructor.

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

      .. oe:api::

         OESpruceFilter& operator=(const OESpruceFilter& rhs)

      Assignment operator.

.. _OESpruce_OESpruceFilter_StandardizeAndFilter:

   .. oe:method:: StandardizeAndFilter

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

         .. oe:api::

            unsigned StandardizeAndFilter(OEChem::OEMolBase& mol,
                                          const OESystem::OESkewGrid& eDensGrid,
                                          const OEStructureMetadata& mdata = OEStructureMetadata())

      .. oe:language:: python

         .. oe:api:: python

            StandardizeAndFilter(mol: Union[OEGraphMol,OEMol,OEQMol],
                                 eDensGrid: OESkewGrid,
                                 mdata: OEStructureMetadata = OEStructureMetadata()) -> int

      Returns a code which indicates the issues that are detected for this structure

.. _OESpruce_OESpruceFilter_GetMessage:


   .. oe:method:: GetMessages

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

         .. oe:api::

            std::string GetMessages(const unsigned errorTypes = OESpruceFilterIssueCodes::ALL)

      .. oe:language:: python

         .. oe:api:: python

            GetMessages(errorTypes: int) -> str


      Returns the error message according to the provided error code

.. _OESpruce_OESpruceFilter_GetAtoms:


   .. oe:method:: GetAtoms

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

         .. oe:api::

            OESystem::OEIterBase<OEChem::OEAtomBase>* GetAtoms(const unsigned errorTypes = OESpruceFilterIssueCodes::ALL)

      .. oe:language:: python

         .. oe:api:: python

            GetAtoms(errorTypes: int) -> OEAtomIter

      Returns the problematic atoms that have the issues indicated by the input error code
      
 
