.. oe:namespace:: OEBio


.. _OEBio_OEAtomMatchResidueID:

.. oe:class:: OEAtomMatchResidueID

   .. oe:api::

      class OEAtomMatchResidueID

   The :ref:`OEAtomMatchResidueID <OEBio_OEAtomMatchResidueID>` class stores residue properties,
   such as residue name, residue number, insertion code, chain ID, fragment number, and alternate location.
   It is used to construct an :ref:`OEAtomMatchResidue <OEBio_OEAtomMatchResidue>` predicate that provides a
   convenient way to iterate over atoms with specific residue information.

   .. seealso::

      * :ref:`OEResidue <OEChem_OEResidue>` class
      * :ref:`section_predicates_reside_data_functors` section
      * :ref:`OEAtomMatchResidue <OEBio_OEAtomMatchResidue>` predicate

   .. admonition:: Code Example

      * See code examples in the :ref:`OEAtomMatchResidue <OEBio_OEAtomMatchResidue>` predicate

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

   .. oe:method:: Constructors

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

         .. oe:api::

            OEAtomMatchResidueID()

      .. oe:language:: python

         .. oe:api:: python

            OEAtomMatchResidueID() -> OEAtomMatchResidueID

      Default constructor that initializes the object with fuzzy regex matches
      ``.*`` for each property.

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

         .. oe:api::

            OEAtomMatchResidueID(OEChem::OEResidue res)

      .. oe:language:: python

         .. oe:api:: python

            OEAtomMatchResidueID(res: OEResidue) -> OEAtomMatchResidueID

      Constructs an :ref:`OEAtomMatchResidueID <OEBio_OEAtomMatchResidueID>` object with the given residue.

      .. note::

         There is a difference between using an OEResidue object retrieved from an existing atom,
         and a default constructed OEResidue object where the user has set a few variables. This is
         because the default constucted OEResidue object sets the residue name to ``UNL``, residue number to
         ``1``, fragment number to ``0``, chainID, insert code, and alternate location to blank characters `` ``.
         Because of these defaults, when constructing from an OEResidue object, we convert fragment number ``0``,
         to a fuzzy regex match ``.*``, since it will be 1 or higher if it was read from a PDB file. In the same
         manner a blank `` `` character for the chainID is converted into a fuzzy regex match. However, since
         a blank character is allowed and the most common for an insertCode and alternate location, these are kept as is and not converted.

   .. oe:method:: GetName

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

         .. oe:api::

            std::string GetName() const

      .. oe:language:: python

         .. oe:api:: python

            GetName() -> str

      By default, it returns ``.*`` to match atoms with any residue name.

   .. oe:method:: GetResidueNumber

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

         .. oe:api::

            std::string GetResidueNumber() const

      .. oe:language:: python

         .. oe:api:: python

            GetResidueNumber() -> str

      By default, it returns ``.*`` to match atoms with any residue number.

   .. oe:method:: GetInsertCode

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

         .. oe:api::

            std::string GetInsertCode() const

      .. oe:language:: python

         .. oe:api:: python

            GetInsertCode() -> str

      By default, it returns ``.*`` to match atoms with any residue insert code.

   .. oe:method:: GetChainID

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

         .. oe:api::

            std::string GetChainID() const

      .. oe:language:: python

         .. oe:api:: python

            GetChainID() -> str

      By default, it returns ``.*`` to match atoms with any residue chain ID.

   .. oe:method:: GetFragmentNumber

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

         .. oe:api::

            std::string GetFragmentNumber() const

      .. oe:language:: python

         .. oe:api:: python

            GetFragmentNumber() -> str

      By default, it returns ``.*`` to match atoms with any residue fragment number.

   .. oe:method:: GetAlternateLocation()

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

         .. oe:api::

            std::string GetAlternateLocation() const

      .. oe:language:: python

         .. oe:api:: python

            GetAlternateLocation() -> str

      By default, it returns ``.*`` to match atoms with any alternate location code.

   .. oe:method:: SetName

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

         .. oe:api::

            void SetName(const std::string& n)

      .. oe:language:: python

         .. oe:api:: python

            SetName(n: str) -> None

      See also :oe:meth:`OEChem::OEResidue::SetName` method.

   .. oe:method:: SetResidueNumber

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

         .. oe:api::

            void SetResidueNumber(const std::string& n)

      .. oe:language:: python

         .. oe:api:: python

            SetResidueNumber(n: str) -> None

      See also :oe:meth:`OEChem::OEResidue::SetResidueNumber` method.

   .. oe:method:: SetInsertCode

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

         .. oe:api::

            void SetInsertCode(const std::string& i)

      .. oe:language:: python

         .. oe:api:: python

            SetInsertCode(i: str) -> None

      See also :oe:meth:`OEChem::OEResidue::SetInsertCode` method.

   .. oe:method:: SetChainID

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

         .. oe:api::

            void SetChainID(const std::string& c)

      .. oe:language:: python

         .. oe:api:: python

            SetChainID(c: str) -> None

      See also :oe:meth:`OEChem::OEResidue::SetChainID` method.

   .. oe:method:: SetFragmentNumber

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

         .. oe:api::

            void SetFragmentNumber(const std::string& f)

      .. oe:language:: python

         .. oe:api:: python

            SetFragmentNumber(f: str) -> None

      See also :oe:meth:`OEChem::OEResidue::SetFragmentNumber` method.

   .. oe:method:: SetAlternateLocation

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

         .. oe:api::

            void SetAlternateLocation(const std::string& f)

      .. oe:language:: python

         .. oe:api:: python

            SetAlternateLocation(a: str) -> None

      See also :oe:meth:`OEChem::OEResidue::SetAlternateLocation` method.
