.. _chapter_custom_color:

===========================================
Using a Custom Color ForceField in FastROCS
===========================================

Similar to the **Shape Toolkit**, a custom color forcefield can be used to
compare color features beyond those captured with the default forcefield.
To use a custom color forcefield, specify your forcefield during the
initialization of your OEShapeDatabase :ref:`OEShapeDatabase <OEFastROCS_OEShapeDatabase>`

Custom color forcefields in FastROCS are constructed the same way they are
in the :ref:`OEColorForceField <OEShape_OEColorForceField>` class in the **OEShape TK**
but are restricted to the following:

#. Interactions can only be between atoms of the same type

#. Interactions can only be favorable

#. Interactions can only be of type "gaussian"

#. user defined types are not permitted

in the following code example:

.. oe:language:: c++

   .. oe:source:: customcolorff_snippet.cpp
      :language:  c++
      :frag:      SNIPPET-1

.. oe:language:: python

   .. oe:source:: CustomColorForceField_Snippet.py
      :language:  python
      :frag:      SNIPPET-1

   :ref:`Full listing. <listing-CustomColorForceField_Snippet.py>`

.. oe:language:: java

   .. oe:source:: CustomColorForceField_Snippet.java
      :language:  java
      :frag:      SNIPPET-1

a color forcefield is created that will only count interactions between pairs of
acceptors and pairs of donors. The -1.0 indicates a favorable interaction, with standard
weighting. 2.0 is the range of the color interaction in space.

.. seealso::

   * :ref:`OEColorForceField <OEShape_OEColorForceField>` class in the **OEShape TK**
