What do we mean by shape? The word is often used without consideration of precise meaning but in this document we shall be very clear as to the definition of shape. Two entities will have the same shape if their volumes exactly correspond. The more the volumes differ, the more the shapes will differ. We will give a precise mathematical exposition below, but it is worth noting even at this most basic level shape is defined as a relative quantity, depending on references to other shapes. In this we differ from approaches that attempt to provide absolute, canonical, ``shapes'' by which to categorize molecules.
What do we mean by ``volume''? A volume is any scalar field. This means a function that has a single number, or ``scalar'', value at each point in space. The ``special case'' for the common understanding of volume is a specific scalar field that has a value of one inside an object and zero outside. The volume of a scalar field is:
| (1.1) |
The volume function,
, is also referred to as the ``characteristic''
function. When the characteristic function corresponds to the common
definition of a volume field this integral corresponds to what is commonly
expected by volume. However, we are not restricted to such simple functions
and can still calculate a V. In general the volume of a scalar field is a
``contraction'' of the information represented by that characteristic
function. It is more precisely referred to as the zeroth-order contraction,
or ``moment''. We will discuss other moments and their uses later, but one
immediate observation is that two objects can not have the same shape if their
volumes are not the same. The converse is obviously not true. Rather, two
objects can have the same volume and not have the same shape. Volume is
typical, therefore, of most contractions of information.
We can now write down a precise definition of shape similarity. Consider the integral:
| (1.2) |
where
and
are different characteristic functions. If this
integral is zero then
and
are actually the same function and
therefore correspond to the same shape. The larger the integral, the
more different the shapes defined by
and
. It defines a metric
quantity between the two fields
and
. The word ``metric'' is
used loosely to mean ``shape'', but here we mean the precise mathematical
definition: i.e. a distance that is 1) always positive, 2) zero if
and only if two entities are identical and 3) that obeys the triangle
inequality. The triangle inequality states that if entity A is
distance x from entity B and B is distance y from entity C then the
distance between A and C is bounded by
and
. The type
of comparison shown in
is referred to as an
metric. Another metric is the
metric:
![]() |
(1.3) |
This integral is the standard one we will use to define shape similarlity The primary advantage, computationally, of 1.3 over 1.2 is that 1.3 does not involve the absolute value function that is not analytic.
Multiplying the terms in the integral out gives:
| (1.4) |
This is the fundamental equation for shape comparison. We rewrite it as:
| (1.5) |
The
terms are the self-volume overlaps of each entity (for our purposes -
molecule), while the
term is the overlap between the two functions. They
constitute the three terms we need to calculate to compare the shapes of two
fields. The
terms are independent of orientation but not
. Finding the
orientation that maximizes
, and hence minimizes
, is equivalent to
finding the best overlay between the two objects (a quantity that has its own,
distinct metric properties). We also note here that the quantity referred to
as a Tanimoto coefficient may be derived by recombining
's and
so:
| (1.6) |
Tanimoto coefficients will be familiar to those who use them for bitvector fingerprint comparison. An alternative measure is the Tversky coefficient, also mostly used for similarity between bitvector fingerprints. Similarly to the Tanimoto coefficient above, we can define a shape Tversky measure. The base equation for the Tversky coefficient is:
| (1.7) |
Normally,
, and for our current use,
is chosen to
be 0.95. Since this introduces an assymmetry, the Tversky calculation depends
on which molecule's self-overlap has the
pre-factor.
ROCS calculates two Tversky values, one with the query
molecule with
pre-factor and a second with the database
molecule with
as the pre-factor. Also, note that since shape is
a field property, instead of a simple scalar like a bitvector, shape Tversky
can be larger than 1.0 since the overlap
can be larger than
a molecule's self-overlap,
.
The OpenEye Shape Toolkit is a set of calculational objects designed to facilitate the calculation of these field-metric quantities. ROCS is an application built on top of the Shape toolkit.