RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
GaussianShape.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// This is the interface for the functions to perform shape-based molecule
13// alignments and scoring. It is experimental code and the API and/or
14// results may change in future releases.
15
16#ifndef RDKIT_GAUSSIANSHAPE_GUARD
17#define RDKIT_GAUSSIANSHAPE_GUARD
18
19#include <RDGeneral/export.h>
23
24namespace RDKit {
25class ROMol;
26class Conformer;
27
28namespace GaussianShape {
29
30//! Align a shape onto a reference shape.
31/*!
32 \param refShape the reference shape
33 \param fitShape the shape to align
34 \param xform if passed in as non-null, will be populated with the
35 transformation matrix that aligns fit onto ref.
36 \param overlayOpts options for the overlay
37
38\return an array of the combination score of the shape Tversky value and the
39 color Tversky value (zero if colors not used) and the individual values. If
40 using color features, defaults to RDKit pharmacophore types for the features.
41*/
43 const ShapeInput &refShape, ShapeInput &fitShape,
44 RDGeom::Transform3D *xform = nullptr,
45 const ShapeOverlayOptions &overlayOpts = ShapeOverlayOptions());
46
47//! Align a molecule to a reference shape
48/*!
49 \param refShape the reference shape
50 \param fit the molecule to align
51 \param fitOpts the options for creating the fit shape
52 \param xform if passed in as non-null, will be populated with the
53 transformation matrix that aligns fit onto ref.
54 \param overlayOpts options for setting up and running the overlay
55 \param fitConfId (optional) the conformer to use for the fit
56 molecule
57
58\return an array of the combination score of the shape Tversky value and the
59 color Tversky value (zero if colors not used) and the individual values. If
60 using color features, defaults to RDKit pharmacophore types for the features.
61*/
63 const ShapeInput &refShape, ROMol &fit,
64 const ShapeInputOptions &fitOpts = ShapeInputOptions(),
65 RDGeom::Transform3D *xform = nullptr,
66 const ShapeOverlayOptions &overlayOpts = ShapeOverlayOptions(),
67 int fitConfId = -1);
68
69//! Align a molecule to a reference molecule
70/*!
71 \param ref the reference molecule
72 \param fit the molecule to align
73 \param refOpts the options for creating the ref shape
74 \param fitOpts the options for creating the fit shape
75 \param xform if passed in as non-null, will be populated with the
76 transformation matrix that aligns fit onto ref.
77 \param overlayOpts options for setting up and running the overlay
78 \param refConfId (optional) the conformer to use for the reference
79 molecule
80 \param fitConfId (optional) the conformer to use for the fit
81 molecule
82
83 \return an array of the combination score of the shape Tversky value and the
84 color Tversky value (zero if colors not used) and the individual values. If
85 using color features, defaults to RDKit pharmacophore types for the features.
86*/
88 const ROMol &ref, ROMol &fit,
89 const ShapeInputOptions &refOpts = ShapeInputOptions(),
90 const ShapeInputOptions &fitOpts = ShapeInputOptions(),
91 RDGeom::Transform3D *xform = nullptr,
92 const ShapeOverlayOptions &overlayOpts = ShapeOverlayOptions(),
93 int refConfId = -1, int fitConfId = -1);
94
95//! Score the overlap of a shape to a reference shape without moving
96// either.
97/*!
98 \param refShape the reference shape
99 \param fitShape the shape to score
100 \param overlayOpts options for controlling the volume calculation
101
102\return an array of the combination score of the shape Tversky value and the
103 color Tversky value (zero if colors not used) and the individual values. If
104 using color features, defaults to RDKit pharmacophore types for the features.
105*/
107 const ShapeInput &refShape, const ShapeInput &fitShape,
108 const ShapeOverlayOptions &overlayOpts = ShapeOverlayOptions());
109
110//! Score the overlap of a molecule to a reference shape without moving
111// either.
112/*!
113 \param ref the reference shape
114 \param fit the molecule to score
115 \param fitOpts the options for creating the fit shape
116 \param overlayOpts options for controlling the volume calculation
117 \param fitConfId (optional) the conformer to use for the fit
118 molecule
119
120\return an array of the combination score of the shape Tversky value and the
121 color Tversky value (zero if colors not used) and the individual values. If
122 using color features, defaults to RDKit pharmacophore types for the features.
123*/
125 const ShapeInput &refShape, const ROMol &fit,
126 const ShapeInputOptions &fitOpts = ShapeInputOptions(),
127 const ShapeOverlayOptions &overlayOpts = ShapeOverlayOptions(),
128 int fitConfId = -1);
129
130//! Score the overlap of a molecule to a reference molecule without moving
131// either.
132/*!
133 \param ref the reference molecule
134 \param fit the molecule to score
135 \param refOpts the options for creating the ref shape
136 \param fitOpts the options for creating the fit shape
137 \param overlayOpts options for controlling the volume calculation
138 \param refConfId (optional) the conformer to use for the reference
139 molecule
140 \param fitConfId (optional) the conformer to use for the fit
141 molecule
142
143\return an array of the combination score of the shape Tverksy value and the
144 color Tversky value (zero if colors not used) and the individual values. If
145 using color features, defaults to RDKit pharmacophore types for the features.
146*/
148 const ROMol &ref, const ROMol &fit,
149 const ShapeInputOptions &refOpts = ShapeInputOptions(),
150 const ShapeInputOptions &fitOpts = ShapeInputOptions(),
151 const ShapeOverlayOptions &overlayOpts = ShapeOverlayOptions(),
152 int refConfId = -1, int fitConfId = -1);
153
154} // namespace GaussianShape
155} // namespace RDKit
156
157#endif // RDKIT_GAUSSIANSHAPE_GUARD
The class for representing 2D or 3D conformation of a molecule.
Definition Conformer.h:46
#define RDKIT_GAUSSIANSHAPE_EXPORT
Definition export.h:233
RDKIT_GAUSSIANSHAPE_EXPORT std::array< double, 3 > AlignShape(const ShapeInput &refShape, ShapeInput &fitShape, RDGeom::Transform3D *xform=nullptr, const ShapeOverlayOptions &overlayOpts=ShapeOverlayOptions())
Align a shape onto a reference shape.
RDKIT_GAUSSIANSHAPE_EXPORT std::array< double, 3 > AlignMolecule(const ShapeInput &refShape, ROMol &fit, const ShapeInputOptions &fitOpts=ShapeInputOptions(), RDGeom::Transform3D *xform=nullptr, const ShapeOverlayOptions &overlayOpts=ShapeOverlayOptions(), int fitConfId=-1)
Align a molecule to a reference shape.
RDKIT_GAUSSIANSHAPE_EXPORT std::array< double, 3 > ScoreShape(const ShapeInput &refShape, const ShapeInput &fitShape, const ShapeOverlayOptions &overlayOpts=ShapeOverlayOptions())
Score the overlap of a shape to a reference shape without moving.
RDKIT_GAUSSIANSHAPE_EXPORT std::array< double, 3 > ScoreMolecule(const ShapeInput &refShape, const ROMol &fit, const ShapeInputOptions &fitOpts=ShapeInputOptions(), const ShapeOverlayOptions &overlayOpts=ShapeOverlayOptions(), int fitConfId=-1)
Score the overlap of a molecule to a reference shape without moving.
Std stuff.