.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEAddCustomFASTAResidue

.. oe:function:: OEAddCustomFASTAResidue

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

      .. oe:api::

         bool OEAddCustomFASTAResidue(const char* code, const char* smiles)

   .. oe:language:: python

      .. oe:api:: python

         OEAddCustomFASTAResidue(code: str, smiles: str) -> bool

   Add a custom residue to the **OEChem TK** FASTA parser. The ``code`` is
   the string surrounded in square brackets. The ``smiles`` is the
   structure of the un-natural nucleic acid to add to the internal
   dictionary. Note, the hydroxyl from the background will be
   automatically stripped and removed by this function.

   In order for these residues to be used, the
   :oe:const:`OEChem::OEIFlavor::FASTA::CustomResidues` flavor must be
   specified. The following code snippet demonstrates how to register
   a custom D-isoleucine with the FASTA reader named with ``[dI]``. It
   also demonstrates using the
   :oe:const:`OEChem::OEIFlavor::FASTA::EmbeddedSMILES` flavor to
   define a tether that can cyclize the peptide.

   .. oe:source:: CustomFASTA.cpp
      :language: c++
      :frag:     SNIPPET

   .. oe:source:: CustomFASTA.py
      :language: python
      :frag:     SNIPPET

   .. oe:source:: CustomFASTA.java
      :language: java
      :frag:     SNIPPET

   .. warning::

      This is an experimental API that may change in the future.

