.. oe:namespace:: OEChem



.. meta::
   :keywords: OEQMol, QMol


.. _OEChem_OEQMol:

.. oe:class:: OEQMol

   .. oe:api::


      class OEQMol

   The :ref:`OEQMol <OEChem_OEQMol>` is a specific implementation of query
   molecules.

   The following methods are publicly inherited from :ref:`OEMolBase <OEChem_OEMolBase>`:

   =========================================================== =========================================================== ============================================================
   :oe:meth:`operator=<OEChem::OEMolBase::operator=>`          :oe:meth:`GetDimension<OEChem::OEMolBase::GetDimension>`    :oe:meth:`NumBonds<OEChem::OEMolBase::NumBonds>`            
   :oe:meth:`operator bool<OEChem::OEMolBase::operator bool>`  :oe:meth:`GetEnergy<OEChem::OEMolBase::GetEnergy>`          :oe:meth:`NumGroups<OEChem::OEMolBase::NumGroups>`          
   :oe:meth:`Clear<OEChem::OEMolBase::Clear>`                  :oe:meth:`GetGroup<OEChem::OEMolBase::GetGroup>`            :oe:meth:`OrderAtoms<OEChem::OEMolBase::OrderAtoms>`        
   :oe:meth:`ClearCoords<OEChem::OEMolBase::ClearCoords>`      :oe:meth:`GetGroups<OEChem::OEMolBase::GetGroups>`          :oe:meth:`OrderBonds<OEChem::OEMolBase::OrderBonds>`        
   :oe:meth:`Compress<OEChem::OEMolBase::Compress>`            :oe:meth:`GetMaxAtomIdx<OEChem::OEMolBase::GetMaxAtomIdx>`  :oe:meth:`ResetPerceived<OEChem::OEMolBase::ResetPerceived>`
   :oe:meth:`Count<OEChem::OEMolBase::Count>`                  :oe:meth:`GetMaxBondIdx<OEChem::OEMolBase::GetMaxBondIdx>`  :oe:meth:`SetCoords<OEChem::OEMolBase::SetCoords>`          
   :oe:meth:`CreateCopy<OEChem::OEMolBase::CreateCopy>`        :oe:meth:`GetTitle<OEChem::OEMolBase::GetTitle>`            :oe:meth:`SetDimension<OEChem::OEMolBase::SetDimension>`    
   :oe:meth:`DeleteAtom<OEChem::OEMolBase::DeleteAtom>`        :oe:meth:`HasPerceived<OEChem::OEMolBase::HasPerceived>`    :oe:meth:`SetEnergy<OEChem::OEMolBase::SetEnergy>`          
   :oe:meth:`DeleteBond<OEChem::OEMolBase::DeleteBond>`        :oe:meth:`IsDataType<OEChem::OEMolBase::IsDataType>`        :oe:meth:`SetPerceived<OEChem::OEMolBase::SetPerceived>`    
   :oe:meth:`DeleteGroup<OEChem::OEMolBase::DeleteGroup>`      :oe:meth:`IsDeleted<OEChem::OEMolBase::IsDeleted>`          :oe:meth:`SetRxn<OEChem::OEMolBase::SetRxn>`                
   :oe:meth:`GetAtom<OEChem::OEMolBase::GetAtom>`              :oe:meth:`IsRxn<OEChem::OEMolBase::IsRxn>`                  :oe:meth:`SetTitle<OEChem::OEMolBase::SetTitle>`            
   :oe:meth:`GetAtoms<OEChem::OEMolBase::GetAtoms>`            :oe:meth:`NewAtom<OEChem::OEMolBase::NewAtom>`              :oe:meth:`Sweep<OEChem::OEMolBase::Sweep>`                  
   :oe:meth:`GetBond<OEChem::OEMolBase::GetBond>`              :oe:meth:`NewBond<OEChem::OEMolBase::NewBond>`              :oe:meth:`UnCompress<OEChem::OEMolBase::UnCompress>`        
   :oe:meth:`GetBonds<OEChem::OEMolBase::GetBonds>`            :oe:meth:`NewGroup<OEChem::OEMolBase::NewGroup>`            
   :oe:meth:`GetCoords<OEChem::OEMolBase::GetCoords>`          :oe:meth:`NumAtoms<OEChem::OEMolBase::NumAtoms>`            
   =========================================================== =========================================================== ============================================================

   .. oe:language:: java

      The following methods are publicly inherited from :ref:`OEMolBase <OEChem_OEMolBase>` only in Java:

      ====================================================== ====================================================== =========================================================
      :oe:meth:`GetAtomList<OEChem::OEMolBase::GetAtomList>` :oe:meth:`GetBondList<OEChem::OEMolBase::GetBondList>` :oe:meth:`GetGroupList<OEChem::OEMolBase::GetGroupList>` 
      ====================================================== ====================================================== =========================================================

   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

      All query molecule constructors provide the ability to specify
      the implementation type through the 'type' argument.
      The default implementation type
      (:oe:const:`OEChem::OEQMolType::OEDefault`) is provided as a
      default argument when not explicitly specified.
      If additional query molecule implementations exist they will be
      listed in the :oe:constns:`OEChem::OEQMolType` namespace.

      .. note::

         Copy constructors which take a non-query molecule type as an
         argument do not, by default, build atom and bond expressions
         used in graph matching.
         The :oe:meth:`OEChem::OEQMolBase::BuildExpressions` method
         should be called to build query expressions after copy
         constructing a molecule using something other than a query
         molecule.

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

         .. oe:api::

            explicit OEQMol(unsigned int type = OEQMolType::OEDefault)

      .. oe:language:: python

         .. oe:api:: python

            OEQMol(type: int = OEQMolType.OEDefault) -> OEQMol

      Default constructor.

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

         .. oe:api::

            OEQMol(const OEQMol &)

      .. oe:language:: python

         .. oe:api:: python

            OEQMol(m: OEQMol) -> OEQMol

      Copy constructor.

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

         .. oe:api::

            OEQMol(const OEQMolBase &)
            explicit OEQMol(const OEQMolBase *)
            OEQMol(const OEQMol &, unsigned int type)

      .. oe:language:: python

         .. oe:api:: python

            OEQMol(qmol: OEQMol, type: int = OEQMolType.OEDefault) -> OEQMol

      Construct a query molecule from a query molecule
      (:ref:`OEQMol <OEChem_OEQMol>`).
      Atom and bond expressions will be copied from the source molecule.

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

         .. oe:api::

            OEQMol(const OEQMolBase &, unsigned int type)

      .. oe:language:: python

         .. oe:api:: python

            OEQMol(qmol: OEQMol, type: int = OEQMolType.OEDefault) -> OEQMol

      Construct a query molecule from a query base molecule
      (:ref:`OEQMolBase <OEChem_OEQMolBase>`).
      Atom and bond expressions will be copied from the source molecule.

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

         .. oe:api::

            OEQMol(const OEMol &, unsigned int type = OEQMolType::OEDefault)

      .. oe:language:: python

         .. oe:api:: python

            OEQMol(m: OEMol, t: int = OEQMolType.OEDefault) -> OEQMol

      Construct a query molecule from a multi-conformer molecule
      (:ref:`OEMol <OEChem_OEMol>`).

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

         .. oe:api::

            OEQMol(const OEMolBase &, unsigned int type = OEQMolType::OEDefault)


      Construct a query molecule from a base molecule
      (:ref:`OEMolBase <OEChem_OEMolBase>`).

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

         .. oe:api::

            OEQMol(const OEGraphMol &,
                   unsigned int type = OEQMolType::OEDefault)

      .. oe:language:: python

         .. oe:api:: python

            OEQMol(qmol: OEGraphMol, type: int = OEQMolType.OEDefault) -> OEQMol

      Construct a query molecule from a graph molecule
      (:ref:`OEGraphMol <OEChem_OEGraphMol>`).

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

         .. oe:api::

            OEQMol(const OEMCMolBase &,
                   unsigned int type = OEQMolType::OEDefault)

      .. oe:language:: python

         .. oe:api:: python

            OEQMol(m: OEMol, t: int = OEQMolType.OEDefault) -> OEQMol

      Construct a query molecule from a multi-conformer base molecule
      (:oe:cls:`OEChem::OEMCMolBase<OEChem::OEMCMolBase>`).


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

      .. oe:api::

         OEQMol &operator=(const OEMol &)
         OEQMol &operator=(const OEQMol &)
         OEQMol &operator=(const OEMolBase &)
         OEQMol &operator=(const OEQMolBase &)
         OEQMol &operator=(const OEGraphMol &)
         OEQMol &operator=(const OEMCMolBase &)


      Assignment operator.


   .. oe:method:: operator OEMolBase &
      :language: c++

      .. oe:api::

         operator const OEMolBase &() const
         operator OEMolBase &()

      Returns the query molecule as an :ref:`OEMolBase <OEChem_OEMolBase>` reference.

   .. oe:method:: operator OEQMolBase &
      :language: c++

      .. oe:api::

         operator const OEQMolBase &() const
         operator OEQMolBase &()

      Returns the query molecule as an :ref:`OEQMolBase <OEChem_OEQMolBase>` reference.


   .. oe:method:: BuildExpressions

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

         .. oe:api::

            bool BuildExpressions(const OEMatchPair<OEExprBase>& mp)
            bool BuildExpressions(unsigned int atomopts, unsigned int bondopts)

      .. oe:language:: python

         .. oe:api:: python

            BuildExpressions(mp: OEMatchPair[OEExprBase]) -> bool
            BuildExpressions(atomopts: int, bondopts: int) -> bool

   .. oe:method:: GetQAtoms

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

         .. oe:api::

            OESystem::OEIterBase<OEQAtomBase>* GetQAtoms() const
            OESystem::OEIterBase<OEQAtomBase>* GetQAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            GetQAtoms() -> OEQAtomIter
            GetQAtoms(pred: OEUnaryAtomPred) -> OEQAtomIter

   .. oe:method:: GetQBonds

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

         .. oe:api::

            OESystem::OEIterBase<OEQBondBase>* GetQBonds() const
            OESystem::OEIterBase<OEQBondBase>* GetQBonds(const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            GetQBonds() -> OEQBondIter
            GetQBonds(pred: OEUnaryBondPred) -> OEQBondIter


   .. oe:method:: QMol

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

         .. oe:api::

            const OEQMolBase& QMol() const
            OEQMolBase& QMol()

      .. oe:language:: python

         .. oe:api:: python

            QMol() -> OEQMol

      Returns a query molecule (:ref:`OEQMol <OEChem_OEQMol>`) as an
      :ref:`OEQMolBase <OEChem_OEQMolBase>` reference.
      When passing an :ref:`OEQMol <OEChem_OEQMol>` object to a function
      which is overloaded to take either an :ref:`OEMolBase <OEChem_OEMolBase>`
      or :ref:`OEQMolBase <OEChem_OEQMolBase>` object it is necessary to
      explicitly specify which overloaded method is desired.
      This method is equivalent to the cast operator
      :oe:meth:`OEChem::OEQMol::operator OEQMolBase &`.


   .. oe:method:: SCMol

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

         .. oe:api::

            const OEMolBase& SCMol() const
            OEMolBase& SCMol()

      .. oe:language:: python

         .. oe:api:: python

            SCMol() -> OEGraphMol

      Returns a query molecule (:ref:`OEQMol <OEChem_OEQMol>`) as an
      :ref:`OEMolBase <OEChem_OEMolBase>` reference.
      When passing an :ref:`OEQMol <OEChem_OEQMol>` to a function which is
      overloaded to take either an :ref:`OEMolBase <OEChem_OEMolBase>` or
      :ref:`OEQMolBase <OEChem_OEQMolBase>` object it is necessary to explicitly
      specify which overloaded method is desired.
      This method is equivalent to the cast operator
      :oe:meth:`OEChem::OEQMol::operator OEMolBase &`.
