.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEReadMDLQueryFile

.. oe:function:: OEReadMDLQueryFile

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

      .. oe:api::

         bool OEReadMDLQueryFile(oemolistream& ifs, OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEReadMDLQueryFile(ifs: oemolistream,
                            mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

   Reads the contents of the MDL query file into the specified
   :ref:`OEMolBase <OEChem_OEMolBase>` object. The atom and bond query features
   present in the MDL file are attached as generic data to the related
   atoms and bonds of the :ref:`OEMolBase <OEChem_OEMolBase>` object.  An
   :ref:`OEQMolBase <OEChem_OEQMolBase>` object can be subsequently created from
   this :ref:`OEMolBase <OEChem_OEMolBase>` object by calling the
   :oe:func:`OEChem::OEBuildMDLQueryExpressions`
   function. :oe:func:`OEChem::OEReadMDLQueryFile` is a low-level reader and as such
   will not call :oe:meth:`Clear<OEChem::OEMolBase::Clear>` on each
   read.

   .. seealso::

      * :ref:`chapter_mdlqueries` chapter

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

      .. oe:api::

         bool OEReadMDLQueryFile(oemolistream& ifs, OEQMolBase& qmol,
                                 unsigned int opts = OEMDLQueryOpts::Default)

   .. oe:language:: python

      .. oe:api:: python

         OEReadMDLQueryFile(ifs: oemolistream, qmol: OEQMol, opts: int) -> bool

   Reads the contents of the MDL query file into the specified
   :ref:`OEQMolBase <OEChem_OEQMolBase>` object.
   The option from the :oe:constns:`OEChem::OEMDLQueryOpts` namespace
   determine how the MDL query is interpreted.

   .. seealso::

      * :ref:`chapter_mdlqueries` chapter


