.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OESameChain

..  _OEChem_OESameChain:

.. oe:function:: OESameChain

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

      .. oe:api::

         bool OESameChain(const OEAtomBase& atom1, const OEAtomBase& atom2)
         bool OESameChain(const OEResidue& res1, const OEResidue& res2)

   .. oe:language:: python

      .. oe:api:: python

         OESameChain(atom1: OEAtomBase, atom2: OEAtomBase) -> bool
         OESameChain(res1: OEResidue, res2: OEResidue) -> bool

   Determines whether two atoms or their 
   respective :ref:`OEResidue <OEChem_OEResidue>` s are
   in the same chain.  This returns ``true`` if both residues have the same
   NMR model number, :oe:meth:`OEChem::OEResidue::GetModelNumber`, and the
   same chain identifier, :oe:meth:`OEChem::OEResidue::GetChainID`.

