.. _molprop_examples_molpropcsv:

Write molecular properties to a CSV file
========================================

The molecular properties calculated by :ref:`OEFilter <OEMolProp_OEFilter>` can be
written to a file in the :oe:const:`OEChem::OEFormat::CSV` format as described
in the :ref:`section_moltaggeddata_CSV` section. Every property specified in
the :ref:`filter file<filter_files>` will be writtern in the tabular file.

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

A description of the command line interface can be obtained by
executing the program with the --help argument.

.. oe:language:: c++

   .. code-block:: console

      prompt> molpropcsv --help

.. oe:language:: python

   .. code-block:: console

      prompt> python molpropcsv.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java MolPropCSV --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> MolPropCSV --help


will generate the following output:

.. code-block:: console

   Simple parameter list
    filter options :
      -filtertype : filter type

    input/output options :
      -in : Input filename
      -out : Output filename

    other options :
      -verbose : Error level of messages


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


.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`molpropcsv.py <../../../../wrappers/python/examples/molprop/molpropcsv.py>`

      ..    literalinclude:: ../../../../wrappers/python/examples/molprop/molpropcsv.py

   .. only:: oepdf

      .. oe:source:: molpropcsv.py
         :language: python

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`molpropcsv.cpp <../../../../sublibs/tklibs/molprop/examples/molpropcsv.cpp>`

   .. only:: oepdf

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

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MolPropCSV.java <../../../../wrappers/java/examples/openeye/examples/oemolprop/MolPropCSV.java>`

   .. only:: oepdf

      .. oe:source:: MolPropCSV.java
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`MolPropCSV.cs <../../../../wrappers/csharp/Csharp-Examples/OEMolProp/MolPropCSV.cs>`

   .. only:: oepdf

      .. oe:source:: MolPropCSV.cs
         :language: csharp

.. seealso::

   * :oe:func:`OEMolProp::OEFilter` class
   * :oe:func:`OEMolProp::OEConfigureFilterParams` and :oe:func:`OEMolProp::OEConfigureFilterType` functions
   * :oe:func:`OEMolProp::OEWritePropertyDataToCSV` function

Examples
----------------------

.. oe:language:: c++

   .. code-block:: console

      prompt> molpropcsv -in drugs.sdf -out out_drugs.csv -filtertype Lead

.. oe:language:: python

   .. code-block:: console

      prompt> python molpropcsv.py -in drugs.sdf -out out_drugs.csv -filtertype Lead

.. oe:language:: java

   .. code-block:: console

      prompt> java MolPropCSV -in drugs.sdf -out out_drugs.csv -filtertype Lead

.. oe:language:: csharp

   .. code-block:: console

      prompt> MolPropCSV -in drugs.sdf -out out_drugs.csv -filtertype Lead
