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

.. oe:namespace:: OEChem

.. _OEChem_OEMonomer:

.. oe:class:: OEMonomer

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OEMonomer : public OESystem::OEBase

   Stores validated and pre-computed information for a monomer to be used
   as a building block for representing biological macromolecules.

   The following methods are publicly inherited from :ref:`OEBase <OESystem_OEBase>`:

   ======================================================== ========================================================= =========================================================
   :oe:meth:`operator=<OESystem::OEBase::operator=>`        :oe:meth:`GetData<OESystem::OEBase::GetData>`             :oe:meth:`IsDataType<OESystem::OEBase::IsDataType>`
   :oe:meth:`operator+=<OESystem::OEBase::operator+=>`      :oe:meth:`GetDataIter<OESystem::OEBase::GetDataIter>`     :oe:meth:`SetBaseData<OESystem::OEBase::SetBaseData>`
   :oe:meth:`AddBaseData<OESystem::OEBase::AddBaseData>`    :oe:meth:`GetDataType<OESystem::OEBase::GetDataType>`     :oe:meth:`SetBoolData<OESystem::OEBase::SetBoolData>`
   :oe:meth:`AddData<OESystem::OEBase::AddData>`            :oe:meth:`GetDoubleData<OESystem::OEBase::GetDoubleData>` :oe:meth:`SetData<OESystem::OEBase::SetData>`
   :oe:meth:`Clear<OESystem::OEBase::Clear>`                :oe:meth:`GetFloatData<OESystem::OEBase::GetFloatData>`   :oe:meth:`SetDoubleData<OESystem::OEBase::SetDoubleData>`
   :oe:meth:`CreateCopy<OESystem::OEBase::CreateCopy>`      :oe:meth:`GetIntData<OESystem::OEBase::GetIntData>`       :oe:meth:`SetFloatData<OESystem::OEBase::SetFloatData>`
   :oe:meth:`DeleteData<OESystem::OEBase::DeleteData>`      :oe:meth:`GetStringData<OESystem::OEBase::GetStringData>` :oe:meth:`SetIntData<OESystem::OEBase::SetIntData>`
   :oe:meth:`GetBoolData<OESystem::OEBase::GetBoolData>`    :oe:meth:`HasData<OESystem::OEBase::HasData>`             :oe:meth:`SetStringData<OESystem::OEBase::SetStringData>`
   ======================================================== ========================================================= =========================================================


   .. oe:method:: Constructors

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

         .. oe:api::

            OEMonomer(const OEMonomerData &)

      .. oe:language:: python

         .. oe:api:: python

            OEMonomer(arg2: OEMonomerData) -> OEMonomer
            OEMonomer(arg2: OEMonomerImpl) -> OEMonomer

      Initializes a monomer from :oe:cls:`OEChem::OEMonomerData` object.
      If the :oe:cls:`OEChem::OEMonomerData` is not valid an error will be
      thrown and the the generated  :oe:cls:`OEChem::OEMonomer` object will be invalid too.

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

         .. oe:api::

            OEMonomer(const OEMonomer &)

      .. oe:language:: python

         .. oe:api:: python

            OEMonomer(arg2: OEMonomerImpl) -> OEMonomer
            OEMonomer(arg2: OEMonomer) -> OEMonomer

      Copy constructor.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEMonomer &operator=(const OEMonomer &)

      Assignment operator.

   .. oe:method:: GetAminoAcidType

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

         .. oe:api::

            unsigned GetAminoAcidType() const

      .. oe:language:: python

         .. oe:api:: python

            GetAminoAcidType() -> int

      Returns the amino acid of the monomer.

      .. seealso::

         * :oe:constns:`OEChem::OEAminoAcidType` namespace

   .. oe:method:: GetCanonicalSmiles

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

         .. oe:api::

            std::string GetCanonicalSmiles() const

      .. oe:language:: python

         .. oe:api:: python

            GetCanonicalSmiles() -> str

      Returns the canonical smiles of the monomer without the R-group definitions.
      In case of alanine, that is defined with ``[H:1]N[C@@H](C)C(=O)[OH:2]``, its canonical
      smiles will be ``C[C@@H](C(=O)O)N``.

      .. seealso::

         * :oe:meth:`OEChem::OEMonomer::GetSmiles` method


   .. oe:method:: GetCode

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

         .. oe:api::

            std::string GetCode(const std::string& codeSet) const

      .. oe:language:: python

         .. oe:api:: python

            GetCode(codeSet: str) -> str

      Returns the code of the monomer in the given code set. Empty string is returned 
      if the monomer has no code specified. 

   .. oe:method:: GetCodes

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

         .. oe:api::

            const std::map<std::string, std::string>& GetCodes() const

      .. oe:language:: python

         .. oe:api:: python

            GetCodes() -> OEStringStringMap

      Returns all the code/code-set pairs defined for the monomer.

   .. oe:method:: GetMonomerType

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

         .. oe:api::

            unsigned GetMonomerType() const

      .. oe:language:: python

         .. oe:api:: python

            GetMonomerType() -> int

      Returns the monomer type of the monomer.

      .. seealso::

         * :oe:constns:`OEChem::OEMonomerType` namespace

   .. oe:method:: GetName

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

         .. oe:api::

            std::string GetName() const

      .. oe:language:: python

         .. oe:api:: python

            GetName() -> str

      Returns the full name of the monomer, or an empty string if the name was not
      specified at initialization.

   .. oe:method:: GetPolymerType

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

         .. oe:api::

            unsigned GetPolymerType() const

      .. oe:language:: python

         .. oe:api:: python

            GetPolymerType() -> int

      Returns the polymer type of the monomer.

      .. seealso::

         * :oe:constns:`OEChem::OEPolymerType` namespace

   .. oe:method:: GetSmiles

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

         .. oe:api::

            std::string GetSmiles() const

      .. oe:language:: python

         .. oe:api:: python

            GetSmiles() -> str

      Returns the smiles representation of the monomer that contains the atom 
      map indices representing connection points.
      Such as ``[H:1]N[C@@H](C)C(=O)[OH:2]`` defining alanine.
      
      .. seealso::

         * :oe:meth:`OEChem::OEMonomer::GetCanonicalSmiles` method

   .. oe:method:: HasCode

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

         .. oe:api::

            bool HasCode(const std::string& codeSet) const

      .. oe:language:: python

         .. oe:api:: python

            HasCode(codeSet: str) -> bool

      Return whether the monomer has a code defined in the given code-set.

   .. oe:method:: HasRGroup

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

         .. oe:api::

            bool HasRGroup(unsigned idx) const

      .. oe:language:: python

         .. oe:api:: python

            HasRGroup(idx: int) -> bool

      Returns whether the monomer has a specific (R-groups) connections.

   .. oe:method:: IsCTerminal

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

         .. oe:api::

            bool IsCTerminal() const

      .. oe:language:: python

         .. oe:api:: python

            IsCTerminal() -> bool

      Returns whether a monomer can be used at the C-terminal of a peptide chain.

   .. oe:method:: IsNTerminal

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

         .. oe:api::

            bool IsNTerminal() const

      .. oe:language:: python

         .. oe:api:: python

            IsNTerminal() -> bool

      Returns whether a monomer can be used at the N-terminal of a peptide chain.

   .. oe:method:: IsValid

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

         .. oe:api::

            bool IsValid() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns whether the monomer was initialized successfully.

   .. oe:method:: NumCodes

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

         .. oe:api::

            unsigned NumCodes() const

      .. oe:language:: python

         .. oe:api:: python

            NumCodes() -> int

      Returns the number of codes the monomer is defined in various code-sets.

   .. oe:method:: NumRGroups

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

         .. oe:api::

            unsigned NumRGroups() const

      .. oe:language:: python

         .. oe:api:: python

            NumRGroups() -> int

      Returns the number of connections (R-groups) of the monomer.

