.. include:: ../substitutions

.. oe:namespace:: OEBio

.. meta::
   :keywords: OEGetTorsion

.. oe:function:: OEGetTorsion

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

      .. oe:api::

         double OEGetTorsion(const OEHierResidue& res, unsigned torType)
         double OEGetTorsion(const OEChem::OEAtomBase* atom, unsigned torType,
                             unsigned assume = OEAssumption::Default)

   .. oe:language:: python

      .. oe:api:: python

         OEGetTorsion(res: OEHierResidue, torType: int) -> float
         OEGetTorsion(atom: OEAtomBase, torType: int,
                      assume: int = OEAssumption_Default) -> float

   Returns the angle in radians for one of the standard
   torsion angles in a residue. The specific torsion is indicated by passing
   one of the constants from the :oe:constns:`OEBio::OEProtTorType` namespace into the
   'torType' parameter. The residue is specified by its :ref:`OEHierResidue <OEBio_OEHierResidue>`
   class or by any :ref:`OEAtomBase <OEChem_OEAtomBase>` from the residue. If the
   specified torsion type does not exist in the given residue, the
   function returns ``-100.0``.
   The function works by calling :oe:func:`OEGetTorsion<OEChem::OEGetTorsion>` with the
   appropriate atoms provided by the :oe:constns:`OEBio::OEProtTorType` namespace.
   The molecule must have 3D coordinates assigned.

  .. seealso::

     * :oe:func:`OEChem::OEGetTorsion` **OEChem TK** function
