.. # split from OEBioFunctions.rst:687

.. include:: ../substitutions

.. oe:namespace:: OEBio

.. meta::
   :keywords: OESetTorsion

.. oe:function:: OESetTorsion

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

      .. oe:api::

         bool OESetTorsion(OEHierResidue& res, unsigned torType, double radians)
         bool OESetTorsion(OEChem::OEAtomBase* atom, unsigned torType,
                           double radians,
                           unsigned assume = OEAssumption::Default)

   .. oe:language:: python

      .. oe:api:: python

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

   Sets one of the standard torsions in a residue to a
   particular value in radians. 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.
   The molecule must have 3D coordinates assigned; atoms in the residue are
   moved in 3D space to achieve the requested torsion value.


