RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
BoundsMatrixBuilder.h
Go to the documentation of this file.
1//
2// Copyright (C) 2004-2026 Greg Landrum 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#include <RDGeneral/export.h>
11#ifndef RD_BOUNDS_MATRIX_BUILDER_H
12#define RD_BOUNDS_MATRIX_BUILDER_H
13
15#include "Embedder.h"
16
17namespace RDKit {
18class ROMol;
19namespace DGeomHelpers {
20//! Set default upper and lower distance bounds in a distance matrix
21/*!
22 \param mmat pointer to the bounds matrix to be altered
23 \param defaultMin default value for the lower distance bounds
24 \param defaultMax default value for the upper distance bounds
25*/
27 double defaultMin = 0.0,
28 double defaultMax = 1000.0);
29/*! \overload
30 */
32 double defaultMin = 0.0,
33 double defaultMax = 1000.0);
34
36 const ROMol &mol, DistGeom::BoundsMatPtr mmat,
37 const EmbedParameters &params, bool scaleVDW = false,
38 bool set15bounds = true, bool set14bounds = true, bool set13bounds = true);
39
40//! Set upper and lower distance bounds between atoms in a molecule based on
41/// topology
42/*!
43 This consists of setting 1-2, 1-3 and 1-4 distance based on bond lengths,
44 bond angles and torsion angle ranges. Optionally 1-5 bounds can also be set,
45 in particular, for path that contain rigid 1-4 paths.
46 The final step involves setting lower bound to the sum of the vdW radii for
47 the remaining atom pairs.
48 \param mol The molecule of interest
49 \param mmat Bounds matrix to the bounds are written
50 \param set15bounds If true try to set 1-5 bounds also based on topology
51 \param scaleVDW Ignored.
52 \param useMacrocycle14config If 1-4 distances bound heuristics for
53 macrocycles is used <b>Note</b> For some strained systems the bounds matrix
54 resulting from setting 1-5 bounds may fail triangle smoothing. In these cases
55 it is recommended to back out and recompute the bounds matrix with no 1-5
56 bounds and with vdW scaling.
57 \param forceTransAmides If true, amide bonds are enforced to be trans
58 \param set14bounds If true, set 1-4 distance bounds based on topology
59 \param set13bounds If true, set 1-3 distance bounds based on topology
60*/
61inline void setTopolBounds(const ROMol &mol, DistGeom::BoundsMatPtr mmat,
62 bool set15bounds = true, bool scaleVDW = false,
63 bool useMacrocycle14config = false,
64 bool forceTransAmides = true,
65 bool set14bounds = true, bool set13bounds = true) {
66 EmbedParameters params{.useMacrocycle14config = useMacrocycle14config,
67 .forceTransAmides = forceTransAmides};
68 setTopolBounds(mol, mmat, params, scaleVDW, set15bounds, set14bounds,
69 set13bounds);
70}
71
72/* ! \overload */
74 const ROMol &mol, DistGeom::BoundsMatPtr mmat,
75 std::vector<std::pair<int, int>> &bonds,
76 std::vector<std::vector<int>> &angles, const EmbedParameters &params,
77 bool scaleVDW = false, bool set15bounds = true, bool set14bounds = true,
78 bool set13bounds = true);
79/*! \overload for experimental torsion angle preferences
80 */
81inline void setTopolBounds(const ROMol &mol, DistGeom::BoundsMatPtr mmat,
82 std::vector<std::pair<int, int>> &bonds,
83 std::vector<std::vector<int>> &angles,
84 bool set15bounds = true, bool scaleVDW = false,
85 bool useMacrocycle14config = false,
86 bool forceTransAmides = true,
87 bool set14bounds = true, bool set13bounds = true) {
88 EmbedParameters params{.useMacrocycle14config = useMacrocycle14config,
89 .forceTransAmides = forceTransAmides};
90 setTopolBounds(mol, mmat, bonds, angles, params, scaleVDW, set15bounds,
91 set14bounds, set13bounds);
92}
93
94//! generate the vectors of bonds and angles used by (ET)KDG
96 const ROMol &mol, std::vector<std::pair<int, int>> &bonds,
97 std::vector<std::vector<int>> &angles);
98
99} // namespace DGeomHelpers
100} // namespace RDKit
101#endif
Class to store the distance bound.
#define RDKIT_DISTGEOMHELPERS_EXPORT
Definition export.h:129
boost::shared_ptr< BoundsMatrix > BoundsMatPtr
RDKIT_DISTGEOMHELPERS_EXPORT void setTopolBounds(const ROMol &mol, DistGeom::BoundsMatPtr mmat, const EmbedParameters &params, bool scaleVDW=false, bool set15bounds=true, bool set14bounds=true, bool set13bounds=true)
RDKIT_DISTGEOMHELPERS_EXPORT void collectBondsAndAngles(const ROMol &mol, std::vector< std::pair< int, int > > &bonds, std::vector< std::vector< int > > &angles)
generate the vectors of bonds and angles used by (ET)KDG
RDKIT_DISTGEOMHELPERS_EXPORT void initBoundsMat(DistGeom::BoundsMatrix *mmat, double defaultMin=0.0, double defaultMax=1000.0)
Set default upper and lower distance bounds in a distance matrix.
Std stuff.
Parameter object for controlling embedding.
Definition Embedder.h:125