.. _spruce_examples_du2mmcif:

Creating mmcif file from an input DU
======================================

This example shows how to write an output mmcif file from a spruce generated design unit.

Command Line Interface
----------------------

This example uses an input design unit (oedu) file, and will output a mmcif file from it to a temporary
directory (see :oe:func:`OESpruce::OEMakeDesignUnits` for details on the API).

.. code-block:: console

   prompt> du2mmcif <input design unit> 

Code
----------------------

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`du2mmcif.py <../../../../wrappers/python/examples/spruce/du2mmcif.py>`
         and both the
         :download:`1TQN_A__DU__HEM_A-508.oedu <../../../../wrappers/test_data/OESpruceTests/1TQN_A__DU__HEM_A-508.oedu>`
         (the input design unit),


   ..   literalinclude:: ../../../../wrappers/python/examples/spruce/du2mmcif.py

   .. only:: oepdf

      .. oe:source:: du2mmcif.py
         :language: python

Example
--------------------------------------------------------------------------------

.. oe:language:: python

   .. code-block:: console

      prompt> du2mmcif.py 1TQN_A__DU__HEM_A-508.oedu

.. seealso::

   * :oe:func:`OESpruce::OEMakeDesignUnits` function
   * :oe:func:`OEBio::OEReadDesignUnit` and :oe:func:`OEBio::OEWriteDesignUnit` functions in the **OEChem TK** manual
   * :ref:`OEDesignUnit <OEBio_OEDesignUnit>` class in the **OEChem TK** manual
