.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEMMFFAtomType

.. oe:function:: OEMMFFAtomType

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

      .. oe:api::

         unsigned int OEMMFFAtomType(const OEAtomBase* atom, bool& fail)

   .. oe:language:: python

      .. oe:api:: python

         OEMMFFAtomType(atm: OEAtomBase) -> OEMMFFTypeResult

   Returns the MMFF94 atom type from the :oe:constns:`OEChem::OEMMFFType` namespace.

   The following table describes how the returned MMFF type and the 'fail'
   flag should be interpreted:

   .. list-table::
      :widths: 100 50 150
      :header-rows: 1

      * - MMFF type
        - 'fail' flag
        - interpretation

      * - :oe:const:`OEChem::OEMMFFType::UNK`
        - true
        - MMFF atom type **can not** be identified

      * - *not* :oe:const:`OEChem::OEMMFFType::UNK`
        - true
        - an **alternative** MMFF atom type is identified

      * - *not* :oe:const:`OEChem::OEMMFFType::UNK`
        - false
        - MMFF atom type is identified **successfully**

   .. oe:source:: MMFFAtomType.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-MMFF-ATOMTYPE-ORIG

   .. seealso::

      :oe:constns:`OEChem::OEMMFFType` namespace


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

      .. oe:api::

         OEMMFFTypeResult OEMMFFAtomType(const OEAtomBase* atom)

   .. oe:language:: python

      .. oe:api:: python

         OEMMFFAtomType(atm: OEAtomBase) -> OEMMFFTypeResult

   Returns whether an MMFF94 integer atom type can be assigned to an atom
   and the type itself stored in an :ref:`OEMMFFTypeResult <OEChem_OEMMFFTypeResult>` object.

   .. warning::

      Only the function that returns :ref:`OEMMFFTypeResult <OEChem_OEMMFFTypeResult>` is supported
      in the wrapped languages: Python, Java and C#.

   .. oe:source:: MMFFAtomType.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-MMFF-ATOMTYPE

   .. oe:source:: MMFFAtomType.py
      :language: python
      :noindent:
      :frag:     SNIPPET-MMFF-ATOMTYPE

   .. oe:source:: MMFFAtomType.java
      :language: java
      :noindent:
      :frag:     SNIPPET-MMFF-ATOMTYPE

   .. oe:source:: MMFFAtomType.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-MMFF-ATOMTYPE

   The correct atom typing requires the following conditions:

   * The molecule has to have explicit hydrogens.
   * The molecule has to have (:oe:const:`MMFF<OEChem::OEAroModel::MMFF>`) aromaticity model.

   .. hint::

      We highly recommend assigning MMFF partial charges to a molecule by calling the
      :oe:func:`OEProton::OEAssignCharges` function with the
      :ref:`OEMMFF94Charges <OEProton_OEMMFF94Charges>` class of the **Quacpac TK**.
