.. oe:namespace:: OEBio

.. meta::
   :keywords: OEHierChain, HierChain


.. _OEBio_OEHierChain:

.. oe:class:: OEHierChain

   .. oe:api::

      class OEHierChain

   This class represents a snapshot of one of the chains inside the
   molecule used to construct the :ref:`OEHierView <OEBio_OEHierView>` object which owns the
   :ref:`OEHierChain <OEBio_OEHierChain>` object. It can be used to give a temporary hierarchical
   view to the underlying molecular data structure.

   .. oe:method:: Constructors

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

         .. oe:api::

            OEHierChain()
            OEHierChain(OEHierChainImpl* i)
            OEHierChain(const OEHierChain &)

      .. oe:language:: python

         .. oe:api:: python

            OEHierChain(i: OEHierChainImpl) -> OEHierChain
            OEHierChain() -> OEHierChain
            OEHierChain(arg2: OEHierChain) -> OEHierChain

      Default and copy constructors.

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

      .. oe:api::

         OEHierChain &operator=(const OEHierChain &)

      Default assignment operator

      Assignment operator.


   .. oe:method:: GetAtom

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

         .. oe:api::

            OEChem::OEAtomBase* GetAtom(const char* resName, int resIdx,
                                        unsigned pdbAtomIdx)
            const OEChem::OEAtomBase* GetAtom(const char* resName, int resIdx,
                                              unsigned pdbAtomIdx) const

      .. oe:language:: python

         .. oe:api:: python

            GetAtom(resName: str, resIdx: int, pdbAtomIdx: int) -> OEAtomBase

      Returns an atom specified by the residue name, residue number
      and atom name.

   .. oe:method:: GetChainID

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

         .. oe:api::

            char GetChainID() const

      .. oe:language:: python

         .. oe:api:: python

            GetChainID() -> str

      Returns the single character representation of the chain ID for
      this chain of the molecule. This corresponds to the chain ID
      found in the PDB file.

   .. oe:method:: GetFragments

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

         .. oe:api::

            OESystem::OEIterBase<OEHierFragment>* GetFragments()
            OESystem::OEIterBase<const OEHierFragment>* GetFragments() const

      .. oe:language:: python

         .. oe:api:: python

            GetFragments() -> OEHierFragmentIter
            GetFragments() -> Iterable[OEHierFragment]

      Returns an iterator over all of the fragments in the chain.

   .. 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
      chain.

   .. oe:method:: GetResidue

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

         .. oe:api::

            OEHierResidue& GetResidue(const char* resName, int resIdx)
            const OEHierResidue& GetResidue(const char* resName, int resIdx) const

      .. oe:language:: python

         .. oe:api:: python

            GetResidue(resName: str, resIdx: int) -> OEHierResidue

      Gives direct access to a residue using the typical information
      that a user might know about a residue of interest (*e.g.* -
      ``THR242``). The chain specifier is not included because the chain
      is implied by the current object.
