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

.. _section_example_oebio_extract_ligand:

Extracting Ligand from :ref:`OEDesignUnit <OEBio_OEDesignUnit>`
================================================================================

.. oe:language:: python

   A program that extracts the ligand from an :ref:`OEDesignUnit <OEBio_OEDesignUnit>`.
   An example command would be:
   
   .. code-block:: console

      prompt> python extract_ligand_oedu.py input.oedb output.sdf


.. oe:language:: c++

   A program that extracts the ligand from an :ref:`OEDesignUnit <OEBio_OEDesignUnit>`.
   An example command would be:

   .. code-block:: console

      prompt> extract_ligand_oedu input.oedb output.sdf


.. oe:language:: java

   A program that extracts the ligand from an :ref:`OEDesignUnit <OEBio_OEDesignUnit>`.
   See the C++ and python examples.


.. oe:language:: csharp

   A program that extracts the ligand from an :ref:`OEDesignUnit <OEBio_OEDesignUnit>`.
   See the C++ and python examples.


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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`extract_ligand_oedu.py <../../../../../wrappers/python/examples/bio/extract_ligand_oedu.py>`

      ..    literalinclude:: ../../../../../wrappers/python/examples/bio/extract_ligand_oedu.py

   .. only:: oepdf

      .. oe:source:: extract_ligand_oedu.py
         :language: python


.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`extract_ligand_oedu.cpp <../../../../../sublibs/tklibs/bio/examples/extract_ligand_oedu.cpp>`

   .. only:: oepdf

      .. oe:source:: extract_ligand_oedu.cpp
         :language: c++


.. oe:language:: java

   .. only:: oehtml

      .. attention::

         |TWOLANGUAGE|
         See the C++ and python examples.


.. oe:language:: csharp

   .. only:: oehtml

      .. attention::

         |TWOLANGUAGE|
         See the C++ and python examples.


.. oe:language:: c++ python

   .. seealso::

      * :oe:func:`OEBio::OEDesignUnit::HasLigand` predicate
