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

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEWriteCIFFile

..  _OEChem_OEWriteCIFFile:

.. oe:function:: OEWriteCIFFile

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

      .. oe:api::

         void OEWriteCIFFile(oemolostream& ofs, OEMolBase& mol,
                             const unsigned int flavor)

   .. oe:language:: python

      .. oe:api:: python

         OEWriteCIFFile(ofs: oemolostream, mol: Union[OEGraphMol,OEMol,OEQMol],
                        flavor: int) -> None

   Writes the molecule as an CIF or mmCIF-file format file to the output
   stream 'ofs', depending on the content of the molecule. If :ref:`OEResidue <OEChem_OEResidue>`
   information is available on any atom in the molecule, it will be written by the mmCIF writer.
   The mmCIF writer will, additionally, switch between two modes, the mmCIF format for
   macromolecules or the Chemical Component Dictionary format. The Chemical Components Dictionary format
   is used when the molecule being written has only a single residue in it.
   A limited number of different CIF and mmCIF format variants are supported
   by the use of 'flavor' parameter from the
   :oe:constns:`OEChem::OEOFlavor::CIF` or :oe:constns:`OEChem::OEOFlavor::MMCIF` namespace.
