RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
ShapeUtils.h
Go to the documentation of this file.
1//
2// Copyright (C) 2005-2006 Rational Discovery LLC
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#include <RDGeneral/export.h>
11#ifndef _RD_SHAPE_UTILS_H_20050128_
12#define _RD_SHAPE_UTILS_H_20050128_
14#include <vector>
15
16namespace RDGeom {
17class Point3D;
18class Transform3D;
19} // namespace RDGeom
20
21namespace RDKit {
22class ROMol;
23class Conformer;
24
25namespace MolShapes {
26
27//! Compute the size of the box that can fit the conformation, and offset of the
28/// box
29//! from the origin
32 const RDGeom::Transform3D *trans = nullptr, double padding = 2.5);
33
34//! Compute the box that will fit the conformer
35/*!
36 \param conf The conformer of interest
37 \param leftBottom Storage for one extremity of the box
38 \param rightTop Storage for other extremity of the box
39 \param trans Optional transformation to be applied to the atom
40 coordinates
41 \param padding Padding added on the sides around the conformer
42*/
45 RDGeom::Point3D &rightTop, const RDGeom::Transform3D *trans = nullptr,
46 double padding = 2.5);
47
48//! Compute the union of two boxes
53
54//! Compute dimensions of a conformer
55/*!
56 \param conf Conformer of interest
57 \param padding Padding added to the atom coordinates on all sides
58 \param center Optionally specify the center
59 \param ignoreHs if true, ignore the hydrogen atoms in computing the centroid
60*/
62 const Conformer &conf, double padding = 2.5,
63 const RDGeom::Point3D *center = nullptr, bool ignoreHs = true);
64
65//! Compute the shape tversky index between two molecule based on a
66/// predefined alignment
67/*!
68 \param mol1 The first molecule of interest
69 \param mol2 The second molecule of interest
70 \param alpha
71 \param beta
72 \param confId1 Conformer in the first molecule (defaults to first
73 conformer)
74 \param confId2 Conformer in the second molecule (defaults to first
75 conformer)
76 \param gridSpacing resolution of the grid used to encode the molecular shapes
77 \param bitsPerPoint number of bit used to encode the occupancy at each grid
78 point
79 defaults to two bits per grid point
80 \param vdwScale Scaling factor for the radius of the atoms to determine
81 the base radius
82 used in the encoding - grid points inside this sphere
83 carry the maximum occupancy
84 \param stepSize thickness of the each layer outside the base radius, the
85 occupancy value is decreased
86 from layer to layer from the maximum value
87 \param maxLayers the maximum number of layers - defaults to the number
88 allowed the number of bits
89 use per grid point - e.g. two bits per grid point will
90 allow 3 layers
91 \param ignoreHs if true, ignore the hydrogen atoms in the shape encoding
92 process
93 */
94
96 const ROMol &mol1, const ROMol &mol2, double alpha, double beta,
97 int confId1 = -1, int confId2 = -1, double gridSpacing = 0.5,
100 double vdwScale = 0.8, double stepSize = 0.25, int maxLayers = -1,
101 bool ignoreHs = true);
102
103//! Compute the shape tversky index between two conformers based on a
104/// predefined alignment
105
106/*!
107 \param conf1 The first conformer of interest
108 \param conf2 The second conformer of interest
109 \param alpha
110 \param beta
111 \param gridSpacing resolution of the grid used to encode the molecular shapes
112 \param bitsPerPoint number of bit used to encode the occupancy at each grid
113 point
114 \param vdwScale Scaling factor for the radius of the atoms to determine
115 the base radius
116 used in the encoding - grid points inside this sphere
117 carry the maximum occupancy
118 \param stepSize thickness of the each layer outside the base radius, the
119 occupancy value is decreased
120 from layer to layer from the maximum value
121 \param maxLayers the maximum number of layers - defaults to the number
122 allowed the number of bits
123 use per grid point - e.g. two bits per grid point will
124 allow 3 layers
125 \param ignoreHs if true, ignore the hydrogen atoms in the shape encoding
126 process
127 */
128
130 const Conformer &conf1, const Conformer &conf2, double alpha, double beta,
131 double gridSpacing = 0.5,
134 double vdwScale = 0.8, double stepSize = 0.25, int maxLayers = -1,
135 bool ignoreHs = true);
136
137//! Compute the shape tanimoto distance between two molecule based on a
138/// predefined alignment
139/*!
140 \param mol1 The first molecule of interest
141 \param mol2 The second molecule of interest
142 \param confId1 Conformer in the first molecule (defaults to first
143 conformer)
144 \param confId2 Conformer in the second molecule (defaults to first
145 conformer)
146 \param gridSpacing resolution of the grid used to encode the molecular shapes
147 \param bitsPerPoint number of bit used to encode the occupancy at each grid
148 point
149 defaults to two bits per grid point
150 \param vdwScale Scaling factor for the radius of the atoms to determine
151 the base radius
152 used in the encoding - grid points inside this sphere
153 carry the maximum occupancy
154 \param stepSize thickness of the each layer outside the base radius, the
155 occupancy value is decreased
156 from layer to layer from the maximum value
157 \param maxLayers the maximum number of layers - defaults to the number
158 allowed the number of bits
159 use per grid point - e.g. two bits per grid point will
160 allow 3 layers
161 \param ignoreHs if true, ignore the hydrogen atoms in the shape encoding
162 process
163 */
164
166 const ROMol &mol1, const ROMol &mol2, int confId1 = -1, int confId2 = -1,
167 double gridSpacing = 0.5,
170 double vdwScale = 0.8, double stepSize = 0.25, int maxLayers = -1,
171 bool ignoreHs = true);
172
173//! Compute the shape tanimoto distance between two conformers based on a
174/// predefined alignment
175/*!
176 \param conf1 The first conformer of interest
177 \param conf2 The second conformer of interest
178 \param gridSpacing resolution of the grid used to encode the molecular shapes
179 \param bitsPerPoint number of bit used to encode the occupancy at each grid
180 point
181 \param vdwScale Scaling factor for the radius of the atoms to determine
182 the base radius
183 used in the encoding - grid points inside this sphere
184 carry the maximum occupancy
185 \param stepSize thickness of the each layer outside the base radius, the
186 occupancy value is decreased
187 from layer to layer from the maximum value
188 \param maxLayers the maximum number of layers - defaults to the number
189 allowed the number of bits
190 use per grid point - e.g. two bits per grid point will
191 allow 3 layers
192 \param ignoreHs if true, ignore the hydrogen atoms in the shape encoding
193 process
194 */
195
197 const Conformer &conf1, const Conformer &conf2, double gridSpacing = 0.5,
200 double vdwScale = 0.8, double stepSize = 0.25, int maxLayers = -1,
201 bool ignoreHs = true);
202
203//! Compute the shape protrusion distance between two molecule based on a
204/// predefined alignment
205/*!
206 \param mol1 The first molecule of interest
207 \param mol2 The second molecule of interest
208 \param confId1 Conformer in the first molecule (defaults to first
209 conformer)
210 \param confId2 Conformer in the second molecule (defaults to first
211 conformer)
212 \param gridSpacing resolution of the grid used to encode the molecular shapes
213 \param bitsPerPoint number of bit used to encode the occupancy at each grid
214 point
215 defaults to two bits per grid point
216 \param vdwScale Scaling factor for the radius of the atoms to determine
217 the base radius
218 used in the encoding - grid points inside this sphere
219 carry the maximum occupancy
220 \param stepSize thickness of the each layer outside the base radius, the
221 occupancy value is decreased
222 from layer to layer from the maximum value
223 \param maxLayers the maximum number of layers - defaults to the number
224 allowed the number of bits
225 use per grid point - e.g. two bits per grid point will
226 allow 3 layers
227 \param ignoreHs if true, ignore the hydrogen atoms in the shape encoding
228 process
229 \param allowReordering if set the order will be automatically updated so that
230 the value calculated
231 is the protrusion of the smaller shape from the larger
232 one.
233 */
234
236 const ROMol &mol1, const ROMol &mol2, int confId1 = -1, int confId2 = -1,
237 double gridSpacing = 0.5,
240 double vdwScale = 0.8, double stepSize = 0.25, int maxLayers = -1,
241 bool ignoreHs = true, bool allowReordering = true);
242
243//! Compute the shape protrusion distance between two conformers based on a
244/// predefined alignment
245/*!
246 \param conf1 The first conformer of interest
247 \param conf2 The second conformer of interest
248 \param gridSpacing resolution of the grid used to encode the molecular shapes
249 \param bitsPerPoint number of bit used to encode the occupancy at each grid
250 point
251 \param vdwScale Scaling factor for the radius of the atoms to determine
252 the base radius
253 used in the encoding - grid points inside this sphere
254 carry the maximum occupancy
255 \param stepSize thickness of the each layer outside the base radius, the
256 occupancy value is decreased
257 from layer to layer from the maximum value
258 \param maxLayers the maximum number of layers - defaults to the number
259 allowed the number of bits
260 use per grid point - e.g. two bits per grid point will
261 allow 3 layers
262 \param ignoreHs if true, ignore the hydrogen atoms in the shape encoding
263 process
264 \param allowReordering if set the order will be automatically updated so that
265 the value calculated
266 is the protrusion of the smaller shape from the larger
267 one.
268 */
269
271 const Conformer &conf1, const Conformer &conf2, double gridSpacing = 0.5,
274 double vdwScale = 0.8, double stepSize = 0.25, int maxLayers = -1,
275 bool ignoreHs = true, bool allowReordering = true);
276} // namespace MolShapes
277} // namespace RDKit
278
279#endif
The class for representing 2D or 3D conformation of a molecule.
Definition Conformer.h:46
DiscreteValueType
used to define the possible range of the values
#define RDKIT_SHAPEHELPERS_EXPORT
Definition export.h:489
RDKIT_SHAPEHELPERS_EXPORT void computeConfBox(const Conformer &conf, RDGeom::Point3D &leftBottom, RDGeom::Point3D &rightTop, const RDGeom::Transform3D *trans=nullptr, double padding=2.5)
Compute the box that will fit the conformer.
RDKIT_SHAPEHELPERS_EXPORT std::vector< double > getConfDimensions(const Conformer &conf, double padding=2.5, const RDGeom::Point3D *center=nullptr, bool ignoreHs=true)
Compute dimensions of a conformer.
RDKIT_SHAPEHELPERS_EXPORT double tverskyIndex(const ROMol &mol1, const ROMol &mol2, double alpha, double beta, int confId1=-1, int confId2=-1, double gridSpacing=0.5, DiscreteValueVect::DiscreteValueType bitsPerPoint=DiscreteValueVect::TWOBITVALUE, double vdwScale=0.8, double stepSize=0.25, int maxLayers=-1, bool ignoreHs=true)
RDKIT_SHAPEHELPERS_EXPORT double tanimotoDistance(const ROMol &mol1, const ROMol &mol2, int confId1=-1, int confId2=-1, double gridSpacing=0.5, DiscreteValueVect::DiscreteValueType bitsPerPoint=DiscreteValueVect::TWOBITVALUE, double vdwScale=0.8, double stepSize=0.25, int maxLayers=-1, bool ignoreHs=true)
RDKIT_SHAPEHELPERS_EXPORT void computeUnionBox(const RDGeom::Point3D &leftBottom1, const RDGeom::Point3D &rightTop1, const RDGeom::Point3D &leftBottom2, const RDGeom::Point3D &rightTop2, RDGeom::Point3D &uLeftBottom, RDGeom::Point3D &uRightTop)
Compute the union of two boxes.
RDKIT_SHAPEHELPERS_EXPORT void computeConfDimsAndOffset(const Conformer &conf, RDGeom::Point3D &dims, RDGeom::Point3D &offSet, const RDGeom::Transform3D *trans=nullptr, double padding=2.5)
RDKIT_SHAPEHELPERS_EXPORT double protrudeDistance(const ROMol &mol1, const ROMol &mol2, int confId1=-1, int confId2=-1, double gridSpacing=0.5, DiscreteValueVect::DiscreteValueType bitsPerPoint=DiscreteValueVect::TWOBITVALUE, double vdwScale=0.8, double stepSize=0.25, int maxLayers=-1, bool ignoreHs=true, bool allowReordering=true)
Std stuff.
bool rdvalue_is(const RDValue_cast_t)