.. include:: ../../toolkit-substitutions

.. oe:namespace:: OESpruce

..  _OESpruce_OECapNTermini:

.. oe:function:: OECapNTermini

   .. attention::

      |TWOLANGUAGE|

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

      .. oe:api::

         bool OECapNTermini(OEChem::OEMolBase& mol,
                            const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& exclude = OEChem::OEIsFalseAtom(),
                            const OESpruce::OECapBuilderOptions& = OESpruce::OECapBuilderOptions())

   .. oe:language:: python

      .. oe:api:: python

         OECapNTermini(mol: Union[OEGraphMol,OEMol,OEQMol],
                       exclude: OEUnaryAtomPred = OEIsFalseAtom(),
                       arg3: OECapBuilderOptions = OECapBuilderOptions()) -> bool

   This function caps all the N-termini in a protein with an acetyl (:oe:const:`OEChem::OEResidueIndex::ACE`) group.
   The acetyl is built assuming ideal backbone geometry, the :math:`\phi` value of the residue being capped is set to
   match the :math:`\phi` value of the previous residue (if it's a single residue in space, a value of :math:`-90.0^{\circ}` degrees, is set
   which is in the allowed range for both an alpha helix and beta sheet secondary structure).

   A predicate can be passed to exclude certain termini from being capped, such as the true biological N-terminal residue
   since this should be charged to match the biophysical experiments.

   The function takes an options class, where behavior can be controlled if building the cap results in a clash, and
   depending on the type of class what actions can be taken, e.g. a solvent molecule blocking the protein backbone
   is not very realistic and the solvent molecule is likely placed to account for density that should have belonged
   to the residue not resolved in the crystal structure.

   The cap will be numbered with -1 from the residue number of the terminal residue.

   .. note::

      If the backbone of the residue being capped is incomplete, or a cap can not be built because of a clash,
      the residue being capped can be turned into the cap by removing atoms in the residue. A clash can either be
      into a non-solvent or into a solvent with the `deleteClashingSolvent` option set to false.

   .. oe:api: IGNORE

      bool OECapNTermini(OEBio::OEDesignUnit &du,
                         const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &exclude=OEChem::OEIsFalseAtom(),
                         const OESpruce::OECapBuilderOptions& = OESpruce::OECapBuilderOptions())

   The input ``mol`` must have 3D coordinates assigned.

   .. seealso::

      * :ref:`OECapBuilderOptions <OESpruce_OECapBuilderOptions>` class
      * :oe:func:`OESpruce::OECapTermini` function
      * :oe:func:`OESpruce::OECapCTermini` function
      * :ref:`OEIsNTerminalAtom <OEBio_OEIsNTerminalAtom>` predicate
