OBSpectrophore Class Reference

Class to compute Spectrophores™. More...

#include <openbabel/spectrophore.h>

List of all members.

Public Types

enum  AccuracyOption {
  AngStepSize1, AngStepSize2, AngStepSize5, AngStepSize10,
  AngStepSize15, AngStepSize20, AngStepSize30, AngStepSize36,
  AngStepSize45, AngStepSize60
}
enum  NormalizationOption { NoNormalization, NormalizationTowardsZeroMean, NormalizationTowardsUnitStd, NormalizationTowardsZeroMeanAndUnitStd }
enum  StereoOption { NoStereoSpecificProbes, UniqueStereoSpecificProbes, MirrorStereoSpecificProbes, AllStereoSpecificProbes }

Public Member Functions

Structors
 OBSpectrophore (void)
 OBSpectrophore (const OBSpectrophore &sphore)
virtual ~OBSpectrophore (void)
Overloaded operators
OBSpectrophoreoperator= (const OBSpectrophore &sphore)
Set methods
void SetResolution (const double r=3.0)
void SetAccuracy (const AccuracyOption a=AngStepSize20)
void SetStereo (const StereoOption s=NoStereoSpecificProbes)
void SetNormalization (const NormalizationOption n=NoNormalization)
Get methods
AccuracyOption GetAccuracy (void) const
double GetResolution (void) const
StereoOption GetStereo (void) const
NormalizationOption GetNormalization (void) const
std::vector< double > GetSpectrophore (OpenBabel::OBMol *mol)

Protected Member Functions

void _getMoleculeData (OpenBabel::OBMol *)
void _orient (void)
void _getBox (double **)
void _setBox (void)
void _getEnergies (double **, double *)
void _initiateSpectrophore (double *, double *)
void _rotateX (double **, double **, const double, const double)
void _rotateY (double **, double **, const double, const double)
void _rotateZ (double **, double **, const double, const double)
void _updateSpectrophore (double *, double *)
void _calculateProperties (OpenBabel::OBMol *)
void _solveMatrix (double **, double *, unsigned int)
void _luDecompose (double **, std::vector< int > &, unsigned int)
void _luSolve (double **, std::vector< int > &, double *, unsigned int)
void _swapRows (double *, unsigned int, unsigned int)
void _swapRows (double **, unsigned int, unsigned int, unsigned int)

Protected Attributes

double _resolution
AccuracyOption _accuracy
StereoOption _stereoFlag
NormalizationOption _normalization
std::vector< int > _rotationStepList
unsigned int _nAtoms
double ** _property
double * _radii
double ** _oricoor
double ** _coor
unsigned int _beginProbe
unsigned int _endProbe
unsigned int _numberOfProbes
std::vector< double > _spectro
struct {
   int   value [12]
_probe [48]
struct {
   double   x
   double   y
   double   z
   double   v [N_PROPERTIES]
_boxPoint [12]

Detailed Description

Class to compute Spectrophores™.

Since:
Version 2.3

Introduction

Spectrophores™ are one-dimensional descriptors generated from the property fields surrounding the molecules. The technology allows the accurate description of molecules in terms of their surface properties or fields. Comparison of molecules’ property fields provides a robust structure-independent method of aligning actives from different chemical classes. When applied to molecules such as ligands and drugs, Spectrophores™ can be used as powerful molecular descriptors in the fields of chemoinformatics, virtual screening, and QSAR modeling.

The computation of Spectrophores™ is independent of the position and orientation of the molecule and this enables easy and fast comparison of Spectrophores™ between different molecules. Molecules having similar three-dimensional properties and shapes always yield similar Spectrophores™.

A Spectrophore™ is calculated by surrounding the three-dimensional conformation of the molecule by a three-dimensional arrangement of points, followed by calculating the interaction between each of the atom properties and the surrounding the points. The three-dimensional arrangement of the points surrounding the molecule can be regarded as an ‘artificial’ cage or receptor, and the interaction calculated between the molecule and the cage can be regarded as an artificial representation of an affinity value between molecule and cage. Because the calculated interaction is dependent on the relative orientation of the molecule within the cage, the molecule is rotated in discrete angles and the most favorable interaction value is kept as final result. The angular stepsize at which the molecule is rotated along its three axis can be specified by the user and influences the accuracy of the method.

Atomic properties

The calculation of a Spectrophore™ starts by calculating the atomic contributions of each property from which one wants to calculate a Spectrophore™ from. In the current implementation, four atomic properties are converted into a Spectrophore™; these four properties include the atomic partial charges, the atomic lipohilicities, the atomic shape deviations and the atomic electrophilicities.

The atomic partial charges and atomic electrophilicity properties are calculated using the electronegativity equalisation method (EEM) as described by Bultinck and coworkers (J. Phys. Chem. 2002, A106, 7895-7901; J. Chem. Inf. Comput. Sci. 2003, 43, 422-428). The following table lists the atomic electronegativity and hardness parameters that are used in the current implementation of the EEM method:

Atom symbolAtomic electronegativity Atomic hardness
H
0.20606
0.65971
C
0.36237
0.32966
N
0.49279
0.34519
O
0.73013
0.54428
F
0.72052
0.72664
S
0.62020
0.20640
Cl
0.36237
0.32966
Br
0.70052
0.54554
I
0.68052
0.30664
Default
0.36237
0.32966

Atomic lipophilic potential parameters are calculated using a rule-based method using parameters from the following table. These parameters were obtained by fitting against the logP values of 10,881 molecules.

AtomLipophilicity parameter
H bound to C
-0.018
H bound to heteroatom
-0.374
C
+0.271
N
-0.137
O
-0.321
F
+0.217
S
+0.385
Cl
+0.632
Br
+0.815
I
+0.198
Default
-0.175

Finally, the atomic shape deviation is generated by calculating, for each atom, the atom’s deviation from the average molecular radius. This is done in a four steps process:

Interaction between the atoms and cage points

Following the calculation of all required atomic properties, the next step in the calculation of a Spectrophore™ consists of determining the total interaction value V(c,p) between each of the atomic contributions of property p with a set of interaction points on an artificial cage c surrounding the molecular conformation. For this purpose, each of these interaction points i on cage c is assigned a value P(c,i) which is either +1 or -1, with the constraint that the sum of all interaction points on a particular cage should be zero. In a typical Spectrophore™ calculation, a cage is represented as a rectangular box encompassing the molecular conformation in all three dimensions, with the centers of the box edges being the interaction points. Such a configuration gives twelve interaction points per cage, and, in the case of a non-stereospecific distribution of the interaction points, leads to 12 different cages. Although there are no particular requirements as to the dimensions of the rectangular cage, the distance between the interaction points and the geometrical extremes of the molecule should be such that a meaningful interaction value between each cage point and the molecular entity can be calculated. In this respect, the default dimensions of the cage are constantly adjusted to enclose the molecule at a minimum distance of 3 Å along all dimensions. This cage size can be modified by the user and influences the resolution of the Spectrophore™.

spectrophore_cage.png

Schematic representation of a molecule surrounded by the artifical cage

The total interaction value V(c,p) between the atomic contribution values A(j,p) of property p for a given molecular conformation and the cage interaction values P(c,i) for a given cage c is calculated according a standard interaction energy equation. It takes into account the Euclidean distance between each atom and each cage point. This total interaction V(c,p) for a given property p and cage c for a given molecular conformation is minimized by sampling the molecular orientation along the three axis in angular steps and the calculation of the interaction value for each orientation within the cage. The final total interaction V(c,p) for a given cage c and property p corresponds to the lowest interaction value obtained this way, and corresponds to the c’th value in the one-dimensional Spectrophore™ vector calculated for molecular property p. As a result, a Spectrophore™ is organized as a vector of minimized interaction values V, each of these organized in order of cages and property values. Since for a typical Spectrophore™ implementation twelve different cages are used, the total length of a Spectrophore™ vector equals to 12 times the number of properties. Since four different properties are used in the current implementation (electrostatic, lipophilic, electrophilic potentials, and an additional shape index as described before), this leads to a total Spectrophore™ length of 48 real values per molecular conformation.

Since Spectrophore™ descriptors are dependent on the actual three-dimensional conformation of the molecule, a typical analysis includes the calculation of Spectrophores™ from a reasonable set of different conformations. It is then up to the user to decide on the most optimal strategy for processing the different Spectrophore™ vectors. In a typical virtual screening application, calculating the average Spectrophore™ vector from all conformations of a single molecule may be a good strategy; other applications have benefit from calculating a weighted average or the minimal values.

Accuracy

As already mentioned, the total interaction between cage and molecule for a given property is minimized by sampling the molecular orientation in angular steps of a certain magnitude. As a typical angular step size, 20º was found to be the best compromise between accuracy and computer speed. Larger steps sizes are faster to calculate but have the risk of missing the global interaction energy minimum, while smaller angular steps sizes do sample the rotational space more thoroughly but at a significant computational cost. The accuracy can be specified by the user using the OBSpectrophore::SetAccuracy(const OBSpectrophore::AccuracyOption) method.

Resolution

Spectrophores™ capture information about the property fields surrounding the molecule, and the amount of detail that needs to be captured can be regulated by the user. This is done by altering the minimal distance between the molecule and the surrounding cage. The resolution can be specified by the user with the OBSpectrophore::SetResolution(const double) method. The default distance along all dimensions is 3.0 Å. The larger the distance, the lower the resolution. With a higher resolution, more details of the property fields surrounding the molecule are contained by the Spectrophore™. On the contrary, low resolution settings may lead to a more general representation of the property fields, with little or no emphasis on small local variations within the fields. Using a low resolution can be the method of choice during the initial virtual screening experiments in order to get an initial, but not so discriminative, first selection. This initial selection can then further be refined during subsequent virtual screening steps using a higher resolution. In this setting, small local differences in the fields between pairs of molecules will be picked up much more easily.

The absolute values of the individual Spectrophore™ data points are dependent on the used resolution. Low resolution values lead to small values of the calculated individual Spectrophore™ data points, while high resolutions will lead to larger data values. It is therefore only meaningful to compare only Spectrophores™ that have been generated using the same resolution settings or after some kind of normalization is performed.

Computation time is not influenced by the specified resolution, hence the computation time is identical for all different resolution settings.

Stereospecificity

Some of the cages that are used to calculated Spectrophores™ have a stereospecific distribution of the interaction points. The resulting interaction valus resulting from these cages are therefore sensitive to the enantiomeric configuration of the molecule within the cage. The fact that both stereoselective as well as stereo non-selective cages can be used makes it possible to include or exclude stereospecificity in the virtual screening search. Depending on the desired output, the stereospecificity of Spectrophores™ can be specified by the user:

The stereospecificity can be specified by the user using the OBSpectrophore::SetStereo(const OBSpectrophore::StereoOption) method.

The differences between the corresponding data points of unique and mirror stereospecific Spectrophores™ are very small and require very long calculation times to obtain a sufficiently high quality level. This increased quality level is triggered by the accuracy setting and will result in calculation times being increased by at least a factor 100. As a consequence, it is recommended to apply this increased accuracy only in combination with a limited number of molecules, and when the small differences between the stereospecific Spectrophores™ are really critical. However, for the vast majority of virtual screening applications, this increased accuracy is not required as long as it is not the intention to draw conclusions about differences in the underlying molecular stereoselectivity. Non-stereospecific Spectrophores™ will therefore suffice for most applications.

Normalisation

It may sometimes be desired to focus on the relative differences between the Spectrophore™ data points rather than focussing on the absolute differences. In these cases, normalization of Spectrophores™ may be required. The current implementation offers with the OBSpectrophore::SetNormalization(const OBSpectrophore::NormalizationOption) method the possibility to normalize in four different ways:

In all these cases, normalization is performed on a ‘per-property’ basis, which means that the data points belonging to the same property set are treated as a single set and that normalization is only performed on the data points within each of these sets and not across all data points.

Normalization may be important when comparing the Spectrophores™ of charged molecules with those of neutral molecules. For molecules carrying a global positive charge, the resulting Spectrophore™ data points of the charge and electrophilicity properties will both be shifted in absolute value compared to the corresponding data points of the respective neutral species. Normalization of the Spectrophores™ removes the original magnitude differences for the data points corresponding to the charge and electrophilicity properties of charged and neutral species. Therefore, if the emphasis of the virtual screening consists of the identification of molecules with similar property fields without taking into account differences in absolute charge, then Spectrophores™ should be normalized towards zero mean. However, if absolute charge differences should be taken into account to differentiate between molecules, unnormalized Spectrophores™ are recommended.

Since:
version 2.3

Member Enumeration Documentation

Accuracy options

Enumerator:
AngStepSize1 
AngStepSize2 
AngStepSize5 
AngStepSize10 
AngStepSize15 
AngStepSize20 
AngStepSize30 
AngStepSize36 
AngStepSize45 
AngStepSize60 

Normalisation options

Enumerator:
NoNormalization 
NormalizationTowardsZeroMean 
NormalizationTowardsUnitStd 
NormalizationTowardsZeroMeanAndUnitStd 

Stereo options

Enumerator:
NoStereoSpecificProbes 
UniqueStereoSpecificProbes 
MirrorStereoSpecificProbes 
AllStereoSpecificProbes 

Constructor & Destructor Documentation

OBSpectrophore ( void   )

Default constructor to create an OBSpectrophore object.

OBSpectrophore ( const OBSpectrophore sphore )

Copy constructor to create an OBSpectrophore object by taking a copy from another OBSpectrophore object.

Parameters:
sphoreA reference to the source OBSpectrophore object
~OBSpectrophore ( void   ) [virtual]

Default destructor object


Member Function Documentation

OBSpectrophore & operator= ( const OBSpectrophore sphore )

Assignment operator that assigns a source OBSpectrophore object to the target OBSpectrophore object.

Parameters:
sphoreA reference to the source OBSpectrophore object
Returns:
A reference to the new target OBSpectrophore object
void SetResolution ( const double  r = 3.0 )

Method to set the resolution at which Spectrophores™ will be calculated.

Sets the resolution at which Spectrophores™ are calculated. The resolution is an arbitrary positive number larger than 0.0, and is used to increase the box size for the calculation of Spectrophores™ in all directions. For example, a resolution of 3 means that the box size will be increased by a value of 3 Å in all directions. Smaller values for the resolution have the effect that small differences in the atomic properties will result in more enhanced differences in the resulting Spectrophores™, while larger resolution values will result in the smoothing of local property differences. All values <= 0.0 are automatically reset to the default value of 3.0.

Parameters:
rThe desired resolution expressed as a double number
void SetAccuracy ( const AccuracyOption  a = AngStepSize20 )

Method to set the accuracy at which Spectrophores™ will be calculated.

Sets the accuracy by which Spectrophores™ are calculated. The accuracy is linked to the angular step increment that is used to calculate Spectrophores™. The accuracy parameter is an enumeration type defined by OBSpectrophore::AccuracyOption. should be a number ranging between 0 and 9 (inclusive), where a value of 9 means a very high accuracy, and 0 means no accuracy at all. Values between 2-6 are a good compromise between accuracy and speed. The following table provides the link between the parameter value and the angular step size:

AccuracyOBSpectrophore::AccuracyOption parameterMinimal angular steps size
Extremely high
AngStepSize1
Extremely high
AngStepSize2
Very High
AngStepSize5
Very high
AngStepSize10
10º
High
AngStepSize15
15º
Default
AngStepSize20
20º
Low
AngStepSize30
30º
Very low
AngStepSize36
36º
Extremely low
AngStepSize45
45º
Extremely low
AngStepSize60
60º
Parameters:
aThe desired accuracy expressed as an OBSpectrophore::AccuracyOption enumeration type

Referenced by OBSpectrophore::OBSpectrophore(), and OBSpectrophore::operator=().

void SetStereo ( const StereoOption  s = NoStereoSpecificProbes )

Method to set the required stereoselectivity of the resulting Spectrophores™.

Sets the stereoselectivity of the generated Spectrophores™. This is achieved by selecting the appropriate probes for the calculation. In the default case that no stereoselectivity is required, only non-stereospecific probes are used in the calculation. Stereospecific differences between enantiomers are only captured in combination with a very high accuracy, hence leading to very long computation times. The following table provides the link between the parameter value and the desired stereochemical treatment:

Stereo treatmentOBSpectrophore::StereoOption parameter
Non-stereospecific probes (default)
NoStereoSpecificProbes
Only the mirror stereospecific probes
UniqueStereoSpecificProbes
Only the unique stereospecific probes
MirrorStereoSpecificProbes
All stereospecific probes (unique and mirror)
AllStereoSpecificProbes
Parameters:
sThe desired stereospecificity treatment expressed as an OBSpectrophore::StereoOption enumeration type

Referenced by OBSpectrophore::OBSpectrophore(), and OBSpectrophore::operator=().

void SetNormalization ( const NormalizationOption  n = NoNormalization )

Method to set the desired normalization treatment of the calculated Spectrophores™.

The following table provides the link between the parameter value and the desired normalization treatment:

Normalization treatmentOBSpectrophore::NormalizationOption parameter
No normalisation (default)
NoNormalization
Normalization towards zero mean
NormalizationTowardsZeroMean
Normalization towards unit standard deviation
NormalizationTowardsUnitStd
Normalization towards zero mean and unit standard deviation
NormalizationTowardsZeroMeanAndUnitStd
Parameters:
nThe desired normalization treatment expressed as an OBSpectrophore::NormalizationOption enumeration type

Referenced by OBSpectrophore::OBSpectrophore(), and OBSpectrophore::operator=().

OBSpectrophore::AccuracyOption GetAccuracy ( void   ) const

Returns the accuracy at which Spectrophores™ will be calculated.

Returns:
The accuracy expressed as an OBSpectrophore::AccuracyOption enumeration type. For a link between the returned value and the angular step size, see the OBSpectrophore::SetAccuracy(const OBSpectrophore::AccuracyOption) method.

Referenced by OBSpectrophore::OBSpectrophore(), and OBSpectrophore::operator=().

double GetResolution ( void   ) const

Returns the resolution at which Spectrophores™ will be calculated.

Returns:
The resolution in Å units
OBSpectrophore::StereoOption GetStereo ( void   ) const

Returns the stereoselectivity setting at which Spectrophores™ will be calculated.

Returns:
The level of stereospecificity expressed as an OBSpectrophore::StereoOption enumeration type. For a link between the returned value and the stereoselectivity treatment, see the OBSpectrophore::SetStereo(const OBSpectrophore::StereoOption) method.

Referenced by OBSpectrophore::OBSpectrophore(), and OBSpectrophore::operator=().

OBSpectrophore::NormalizationOption GetNormalization ( void   ) const

Returns the normalization settings at which Spectrophores™ will be calculated.

Returns:
The normalization treatmet expressed as an OBSpectrophore::NormalizationOption enumeration type. For a link between the returned value and the normalization treatment, see the OBSpectrophore::SetNormalization(const OBSpectrophore::NormalizationOption) method.

Referenced by OBSpectrophore::OBSpectrophore(), and OBSpectrophore::operator=().

std::vector< double > GetSpectrophore ( OpenBabel::OBMol mol )

Calling this method starts the calculation of the Spectrophore™. After succesful calculation, the Spectrophore™ is returned as a standard vector of 48 doubles. The 48 doubles are organised into 4 sets of 12 doubles each:-

  • numbers 01-11: Spectrophore™ values calculated from the atomic partial charges;
  • numbers 13-24: Spectrophore™ values calculated from the atomic lipophilicity properties;
  • numbers 25-36: Spectrophore™ values calculated from the atomic shape deviations;
  • numbers 37-48: Spectrophore™ values calculated from the atomic electrophilicity properties;
OpenBabel::OBConversion obconversion;
obconversion.SetInFormat("sdf");
OpenBabel::OBMol mol;
OpenBabel::OBSpectrophore s;
s.SetAccuracy(OpenBabel::OBSpectrophore::AngStepSize20);          // Default
s.SetResolution(3.0);                                             // Default
s.SetStereo(OpenBabel::OBSpectrophore::NoStereoSpecificProbes);   // Default
s.SetNormalization(OpenBabel::OBSpectrophore::NoNormalization);   // Default
std::ifstream ifs;
ifs.open(argv[1]);
while (obconversion.Read(&mol, &ifs))
{
   std::vector<double> result = s.GetSpectrophore(&mol);
   for (unsigned int i(0); i < result.size(); ++i)
   {
      if (!(i%12)) std::cerr << std::endl;
      std::cerr << result[i] << "  ";
   }
   std::cerr << std::endl;
   mol.Clear();
}
Parameters:
molPointer to the OBMol object from which to calculate a Spectrophore™. For proper functioning, the input molecule should have all explicit hydrogens assigned and the molecule should have a three-dimensional conformation assigned. It is the responsability of the programmer to make sure that the molecule is in the desired protonation state.
Returns:
The calculated Spectrophore™ as a standard vector of 48 doubles. An empty vector of doubles is returned in case an error occurred during the calculation. For example, this could happen in the case that the molecule contains less than three atoms. It is therefore up to the user to check the size of the returned vector to capture errors.
void _getMoleculeData ( OpenBabel::OBMol mol ) [protected]
void _orient ( void   ) [protected]
void _getBox ( double **  c ) [protected]
void _setBox ( void   ) [protected]
void _getEnergies ( double **  c,
double *  e 
) [protected]
void _initiateSpectrophore ( double *  e,
double *  s 
) [protected]
void _rotateX ( double **  oc,
double **  nc,
const double  c,
const double  s 
) [protected]
void _rotateY ( double **  oc,
double **  nc,
const double  c,
const double  s 
) [protected]
void _rotateZ ( double **  oc,
double **  nc,
const double  c,
const double  s 
) [protected]
void _updateSpectrophore ( double *  ENERGY,
double *  SPHORE 
) [protected]
void _calculateProperties ( OpenBabel::OBMol mol ) [protected]
void _solveMatrix ( double **  A,
double *  B,
unsigned int  dim 
) [protected]
void _luDecompose ( double **  A,
std::vector< int > &  I,
unsigned int  dim 
) [protected]
void _luSolve ( double **  A,
std::vector< int > &  I,
double *  B,
unsigned int  dim 
) [protected]
void _swapRows ( double *  _pMatrix,
unsigned int  i,
unsigned int  j 
) [protected]
void _swapRows ( double **  _pMatrix,
unsigned int  i,
unsigned int  j,
unsigned int  nCols 
) [protected]

Member Data Documentation

std::vector<int> _rotationStepList [protected]
std::vector<double> _spectro [protected]
int value[12]
struct { ... } _probe[48] [protected]
double x

Referenced by OBSpectrophore::_orient().

double y

Referenced by OBSpectrophore::_orient().

double z

Referenced by OBSpectrophore::_orient().

double v[N_PROPERTIES]
struct { ... } _boxPoint[12] [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines