.. oe:namespace:: OEBio

.. meta::
   :keywords: OEHierResidue, HierResidue


.. _OEBio_OEHierResidue:

.. oe:class:: OEHierResidue

   .. oe:api::


      class OEHierResidue

   This is the lowest temporary object in the hierarchical
   view. :ref:`OEHierResidue <OEBio_OEHierResidue>` objects are available from within the
   :ref:`OEHierFragment <OEBio_OEHierFragment>` object and give access to the
   :ref:`OEAtomBase <OEChem_OEAtomBase>` objects
   within the molecule at the time the parent :ref:`OEHierView <OEBio_OEHierView>` was
   created. Any atom deletions or additions after the creation of the
   :ref:`OEHierView <OEBio_OEHierView>` will not be available in the object. However, changes to
   atoms or bonds will be available via the :ref:`OEAtomBase <OEChem_OEAtomBase>` API. The bonds
   of a molecule are not directly available through the :ref:`OEHierView <OEBio_OEHierView>`
   object, but instead must be accessed via the :oe:meth:`OEChem::OEAtomBase::GetBonds`
   API point.

   .. oe:method:: Constructors

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

         .. oe:api::

            OEHierResidue()
            OEHierResidue(OEHierResImpl* i)
            OEHierResidue(const OEHierResidue &)

      .. oe:language:: python

         .. oe:api:: python

            OEHierResidue(i: OEHierResImpl) -> OEHierResidue
            OEHierResidue() -> OEHierResidue
            OEHierResidue(arg2: OEHierResidue) -> OEHierResidue

      Default and copy constructors.

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

      .. oe:api::

         OEHierResidue &operator=(const OEHierResidue &)

      Default assignment operator

      Assignment operator.


   .. oe:method:: GetAtom

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

         .. oe:api::

            OEChem::OEAtomBase* GetAtom(unsigned pdbAtomIdx)
            const OEChem::OEAtomBase* GetAtom(unsigned pdbAtomIdx) const

      .. oe:language:: python

         .. oe:api:: python

            GetAtom(pdbAtomIdx: int) -> OEAtomBase

      Returns an atom specified by the PDB atom index.

   .. oe:method:: GetAtoms

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

         .. oe:api::

            OESystem::OEIterBase<OEChem::OEAtomBase>* GetAtoms()
            OESystem::OEIterBase<const OEChem::OEAtomBase>* GetAtoms() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtoms() -> OEAtomIter
            GetAtoms() -> Iterable[OEAtomBase]

      Returns an iterator over all of the atoms in the residue.

   .. oe:method:: GetOEResidue

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

         .. oe:api::

            const OEChem::OEResidue& GetOEResidue() const

      .. oe:language:: python

         .. oe:api:: python

            GetOEResidue() -> OEResidue

      This returns an arbitrary :ref:`OEResidue <OEChem_OEResidue>` object associated with this
      :ref:`OEHierResidue <OEBio_OEHierResidue>`.

      .. seealso::

         .. oe:language:: c++

             * Example program :ref:`reshist.cpp<section_example_oebio_reshist>`

         .. oe:language:: python

            * Example program :ref:`reshist.py<section_example_oebio_reshist>`

         .. oe:language:: java

            * Example program :ref:`ResHist.java<section_example_oebio_reshist>`

         .. oe:language:: csharp

            * Example program :ref:`ResHist.cs<section_example_oebio_reshist>`

   .. oe:method:: GetResidueName

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

         .. oe:api::

            const char* GetResidueName() const

      .. oe:language:: python

         .. oe:api:: python

            GetResidueName() -> str

      Returns the residue name.

   .. oe:method:: GetResidueNumber

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

         .. oe:api::

            int GetResidueNumber() const

      .. oe:language:: python

         .. oe:api:: python

            GetResidueNumber() -> int

      Returns the integer representation of the residue number for this
      residue of the fragment.
