.. _section_example_oechem_rotorcount:

Print rotor count distribution
================================================================================

A program that prints the rotorcount distribution for a database of
molecules. It uses :ref:`OEIsRotor <OEChem_OEIsRotor>` functor to determine
if a bond is freely :term:`rotatable<rotatable bond>`. Use the 
:oe:func:`OEMolProp::OEGetRotatableBondCount` function to get a more precise count 
of rotatable bonds in a molecule.

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

.. oe:language:: c++

   .. code-block:: console

      prompt > rotorcount input.oeb.gz

.. oe:language:: python

   .. code-block:: console

      prompt > rotorcount.py input.oeb.gz

.. oe:language:: java

   .. code-block:: console

      prompt > RotorCount input.oeb.gz

.. oe:language:: csharp

   .. code-block:: console

      prompt > RotorCount input.oeb.gz

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

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`rotorcount.cpp <../../../../../sublibs/tklibs/oechem/examples/rotorcount.cpp>`

   .. only:: oepdf

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

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`rotorcount.py <../../../../../wrappers/python/examples/oechem/rotorcount.py>`

      .. literalinclude:: ../../../../../wrappers/python/examples/oechem/rotorcount.py


   .. only:: oepdf

      .. oe:source:: rotorcount.py
         :language: python

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`RotorCount.java <../../../../../wrappers/java/examples/openeye/examples/oechem/RotorCount.java>`

   .. only:: oepdf

      .. oe:source:: RotorCount.java
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`RotorCount.cs <../../../../../wrappers/csharp/Csharp-Examples/OEChem/RotorCount.cs>`

   .. only:: oepdf

      .. oe:source:: RotorCount.cs
         :language: csharp


.. seealso::

   * :ref:`OEIsRotor <OEChem_OEIsRotor>` functor
   * :oe:func:`OEMolProp::OEGetRotatableBondCount` function
