RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
Loading...
Searching...
No Matches
ShapeOverlayOptions.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2026 David Cosgrove and other RDKit contributors
3
//
4
// @@ All Rights Reserved @@
5
// This file is part of the RDKit.
6
// The contents are covered by the terms of the BSD license
7
// which is included in the file license.txt, found at the root
8
// of the RDKit source tree.
9
//
10
// Original author: David Cosgrove (CozChemIx Limited)
11
//
12
// Options for the Roshambo2-based shape overlay.
13
14
#ifndef RDKIT_SHAPEOVERLAYOPTIONS_GUARD
15
#define RDKIT_SHAPEOVERLAYOPTIONS_GUARD
16
#include <ostream>
17
18
#include <
RDGeneral/export.h
>
19
20
namespace
RDKit
{
21
namespace
GaussianShape
{
22
23
enum class
RDKIT_GAUSSIANSHAPE_EXPORT
StartMode {
24
ROTATE_0
,
//! No rotation, just normalization if requested
25
ROTATE_180
,
//! ROTATE_0 plus rotate by 180 degrees about each of x, y, z
26
ROTATE_180_WIGGLE
,
//! ROTATE_180 plus, as the PubChem code does, rotate by a
27
//! small amount (~25 degrees) about each axis and use the
28
//! highest scoring of those as the start point for that
29
//! rotation angle
30
ROTATE_45
,
//! ROTATE_180 plus rotate by 45 degrees about pairs of each of x,
31
//! y, z
32
ROTATE_0_FRAGMENT
,
//! No rotation, translate probe to each end of ref
33
ROTATE_180_FRAGMENT
,
//! Translate probe to each end of ref and then
34
//! ROTATE_180
35
ROTATE_45_FRAGMENT
,
//! Translate probe to each end of ref and then ROTATE_90
36
A_LA_PUBCHEM
,
//! Uses the eigenvalues of the principal vectors to decide
37
//! whether to do ROTATE_180_WIGGLE or ROTATE_45
38
};
39
40
enum class
RDKIT_GAUSSIANSHAPE_EXPORT
OptimMode {
41
SHAPE_ONLY
,
//! Drive the optimisation by shape overlap only.
42
SHAPE_PLUS_COLOR_SCORE
,
//! Drive the optimisation by shape, but include
43
//! color in the score to determine the best
44
//! solution. Color never used in the optimisation
45
//! stage.
46
SHAPE_PLUS_COLOR
,
//! Drive the optimisation by overlap of shape and color
47
//! features.
48
};
49
50
struct
RDKIT_GAUSSIANSHAPE_EXPORT
ShapeOverlayOptions
{
51
//! Different modes for starting the optimisation. Default is as used by the
52
//! PubChem code. The molecules are normalized so the principal axes are
53
//! along the cartesian axes rather than the shape quadrupole axes as Grant et
54
//! al. did.
55
StartMode
startMode
{StartMode::A_LA_PUBCHEM};
56
OptimMode
optimMode
{
57
OptimMode::SHAPE_PLUS_COLOR_SCORE};
//! Optimisation mode.
58
double
simAlpha
{
59
1.0};
//! When doing a Tversky similarity, the alpha value. If alpha and
60
//! beta are both the default 1.0, it's a Tanimoto similarity. A
61
//! high alpha and low beta emphasize the fit volume in the
62
//! similarity and vice versa. Tversky is O / (A * (R - O) + B * (F
63
//! - O) + O) where O is the overlap volume, R is the reference's
64
//! volume and F is the fit's volume. This is different from that
65
//! used by OpenEye (O / (A * R + B * F)).
66
double
simBeta
{1.0};
//! When doing a Tversky similarity, the beta value.
67
double
optParam
{0.5};
//! If using colors, the relative weights of shape and
68
//! color scores.
69
int
nSteps
{100};
//! Maximum number of steps for optimiser to take.
70
71
bool
normalize
{
72
true
};
//! Whether to normalise the shapes by putting them into their
73
//! canonical conformations (centred at the origin, aligned along
74
//! its principal axes) before starting.
75
bool
useDistCutoff
{
76
true
};
//! Whether to use a distance cutoff for the volume calculation.
77
double
distCutoff
{4.5};
//! The distance cutoff. If 2 atoms are more than
78
//! this distance apart, they are not included in the
79
//! volume calculation. A smaller value is faster but
80
//! less precise.
81
double
shapeConvergenceCriterion
{
82
0.001};
//! Optimisation stops when the shape score changes by less
83
//! than this amount. A larger number is faster but less
84
//! precise.
85
};
86
87
inline
std::ostream &
operator<<
(std::ostream &os,
const
StartMode &sm) {
88
switch
(sm) {
89
case
StartMode::ROTATE_0:
90
os <<
"ROTATE_0"
;
91
break
;
92
case
StartMode::ROTATE_0_FRAGMENT:
93
os <<
"ROTATE_0_FRAGMENT"
;
94
break
;
95
case
StartMode::ROTATE_180:
96
os <<
"ROTATE_180"
;
97
break
;
98
case
StartMode::ROTATE_180_FRAGMENT:
99
os <<
"ROTATE_180_FRAGMENT"
;
100
break
;
101
case
StartMode::ROTATE_180_WIGGLE:
102
os <<
"ROTATE_180_WIGGLE"
;
103
break
;
104
case
StartMode::ROTATE_45:
105
os <<
"ROTATE_45"
;
106
break
;
107
case
StartMode::ROTATE_45_FRAGMENT:
108
os <<
"ROTATE_45_FRAGMENT"
;
109
break
;
110
case
StartMode::A_LA_PUBCHEM:
111
os <<
"A_LA_PUBCHEM"
;
112
break
;
113
}
114
return
os;
115
}
116
}
// namespace GaussianShape
117
}
// namespace RDKit
118
119
#endif
// RDKIT_SHAPEOVERLAYOPTIONS_GUARD
ROTATE_180_WIGGLE
ROTATE_180_WIGGLE
ROTATE_0 plus rotate by 180 degrees about each of x, y, z.
Definition
ShapeOverlayOptions.h:26
ROTATE_0_FRAGMENT
ROTATE_0_FRAGMENT
Definition
ShapeOverlayOptions.h:32
SHAPE_PLUS_COLOR
SHAPE_PLUS_COLOR
Definition
ShapeOverlayOptions.h:46
ROTATE_45_FRAGMENT
ROTATE_45_FRAGMENT
Definition
ShapeOverlayOptions.h:35
SHAPE_PLUS_COLOR_SCORE
SHAPE_PLUS_COLOR_SCORE
Drive the optimisation by shape overlap only.
Definition
ShapeOverlayOptions.h:42
ROTATE_45
ROTATE_45
Definition
ShapeOverlayOptions.h:30
ROTATE_180_FRAGMENT
ROTATE_180_FRAGMENT
No rotation, translate probe to each end of ref.
Definition
ShapeOverlayOptions.h:33
ROTATE_0
ROTATE_0
Definition
ShapeOverlayOptions.h:24
SHAPE_ONLY
SHAPE_ONLY
Definition
ShapeOverlayOptions.h:41
ROTATE_180
ROTATE_180
No rotation, just normalization if requested.
Definition
ShapeOverlayOptions.h:25
A_LA_PUBCHEM
A_LA_PUBCHEM
Translate probe to each end of ref and then ROTATE_90.
Definition
ShapeOverlayOptions.h:36
export.h
RDKIT_GAUSSIANSHAPE_EXPORT
#define RDKIT_GAUSSIANSHAPE_EXPORT
Definition
export.h:291
RDKit::GaussianShape
Definition
GaussianShape.h:28
RDKit::GaussianShape::operator<<
std::ostream & operator<<(std::ostream &os, const StartMode &sm)
Definition
ShapeOverlayOptions.h:87
RDKit
Std stuff.
Definition
Abbreviations.h:19
RDKit::GaussianShape::ShapeOverlayOptions
Definition
ShapeOverlayOptions.h:50
RDKit::GaussianShape::ShapeOverlayOptions::normalize
bool normalize
Maximum number of steps for optimiser to take.
Definition
ShapeOverlayOptions.h:71
RDKit::GaussianShape::ShapeOverlayOptions::shapeConvergenceCriterion
double shapeConvergenceCriterion
Definition
ShapeOverlayOptions.h:81
RDKit::GaussianShape::ShapeOverlayOptions::distCutoff
double distCutoff
Whether to use a distance cutoff for the volume calculation.
Definition
ShapeOverlayOptions.h:77
RDKit::GaussianShape::ShapeOverlayOptions::simBeta
double simBeta
Definition
ShapeOverlayOptions.h:66
RDKit::GaussianShape::ShapeOverlayOptions::useDistCutoff
bool useDistCutoff
Definition
ShapeOverlayOptions.h:75
RDKit::GaussianShape::ShapeOverlayOptions::optimMode
OptimMode optimMode
Definition
ShapeOverlayOptions.h:56
RDKit::GaussianShape::ShapeOverlayOptions::startMode
StartMode startMode
Definition
ShapeOverlayOptions.h:55
RDKit::GaussianShape::ShapeOverlayOptions::nSteps
int nSteps
Definition
ShapeOverlayOptions.h:69
RDKit::GaussianShape::ShapeOverlayOptions::simAlpha
double simAlpha
Optimisation mode.
Definition
ShapeOverlayOptions.h:58
RDKit::GaussianShape::ShapeOverlayOptions::optParam
double optParam
When doing a Tversky similarity, the beta value.
Definition
ShapeOverlayOptions.h:67
GraphMol
GaussianShape
ShapeOverlayOptions.h
Generated on
for RDKit by
1.17.0