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