RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
Loading...
Searching...
No Matches
ZMatrixBuilder.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2026 ETH Zurich
3
// Created by: Katharina Buchthal
4
//
5
// @@ All Rights Reserved @@
6
// This file is part of the RDKit.
7
// The contents are covered by the terms of the BSD license
8
// which is included in the file license.txt, found at the root
9
// of the RDKit source tree.
10
//
11
#include <
RDGeneral/export.h
>
12
#ifndef RD_Z_MATRIX_BUILDER_H
13
#define RD_Z_MATRIX_BUILDER_H
14
15
#include <
DistGeom/ZMatrix.h
>
16
#include <boost/unordered/unordered_flat_map.hpp>
17
18
namespace
RDKit
{
19
class
ROMol
;
20
namespace
DGeomHelpers
{
21
22
using
TorsionInfo
=
23
boost::unordered_flat_map<std::size_t, DistGeom::TorsionCandidates>;
24
using
BondAngleInfo
= boost::unordered_flat_map<std::size_t, double>;
25
using
BondLengthInfo
= std::vector<double>;
26
27
//! A struct to store internal coordinates by unified ids through the ids from
28
//! the invovled bonds
29
struct
InternalCoordinates
{
30
TorsionInfo
torsionRange
;
31
BondAngleInfo
angles
;
32
BondLengthInfo
lengths
;
33
InternalCoordinates
(
unsigned
int
numBonds)
34
:
torsionRange
{},
angles
{},
lengths
(numBonds) {}
35
};
36
37
//! Generates a Z-Matrix via a DFS walk through the molecule, as starting point,
38
//! a non-ring bond (if existing) with minimal degree is selected
39
/*!
40
\param mol Molecule for which the matrix should be constructes
41
\param zmat Pointer to an initialized (!) but empty Z-Matrix that should be
42
filled
43
\param internalCoords Internal coordinates to be used for the ZMatrix (NOTE:
44
the molecule that was given here must be the same used to construct the
45
internal coordinates, since they are accessed by their bond ids)
46
*/
47
RDKIT_DISTGEOMHELPERS_EXPORT
void
setMoleculeDFS
(
48
const
ROMol
&mol,
DistGeom::ZMatrix
&zmat,
49
const
InternalCoordinates
&internalCoords);
50
51
//! Generates a Z-Matrix via a DFS walk through the molecule, as starting point,
52
//! the given two atoms are used
53
/*!
54
\param mol Molecule for which the matrix should be constructes
55
\param zmat Pointer to an initialized (!) but empty Z-Matrix that should be
56
filled
57
\param internalCoords Internal coordinates to be used for the ZMatrix (NOTE:
58
the molecule that was given here must be the same used to construct the
59
internal coordinates, since they are accessed by their bond ids)
60
\param firstAtomIdx First row in zmatrix
61
\param secondAtomIdx Second row in zmatrix
62
*/
63
RDKIT_DISTGEOMHELPERS_EXPORT
void
setMoleculeDFS
(
64
const
ROMol
&mol,
DistGeom::ZMatrix
&zmat,
65
const
InternalCoordinates
&internalCoords,
unsigned
int
firstAtomIdx,
66
unsigned
int
secondAtomIdx);
67
68
//! Corrects sign for offsets of improper torsions to account for chiral
69
//! chemistry
70
/*!
71
\param mol Corresponding molecule
72
\param zmat ZMatrix
73
*/
74
RDKIT_DISTGEOMHELPERS_EXPORT
void
correctChiralCenters
(
const
ROMol
&mol,
75
DistGeom::ZMatrix
&zmat);
76
77
}
// namespace DGeomHelpers
78
}
// namespace RDKit
79
#endif
ZMatrix.h
DistGeom::ZMatrix
Definition
ZMatrix.h:43
RDKit::ROMol
Definition
ROMol.h:344
export.h
RDKIT_DISTGEOMHELPERS_EXPORT
#define RDKIT_DISTGEOMHELPERS_EXPORT
Definition
export.h:161
RDKit::DGeomHelpers
Definition
BoundsMatrixBuilder.h:20
RDKit::DGeomHelpers::TorsionInfo
boost::unordered_flat_map< std::size_t, DistGeom::TorsionCandidates > TorsionInfo
Definition
ZMatrixBuilder.h:22
RDKit::DGeomHelpers::BondLengthInfo
std::vector< double > BondLengthInfo
Definition
ZMatrixBuilder.h:25
RDKit::DGeomHelpers::BondAngleInfo
boost::unordered_flat_map< std::size_t, double > BondAngleInfo
Definition
ZMatrixBuilder.h:24
RDKit::DGeomHelpers::correctChiralCenters
RDKIT_DISTGEOMHELPERS_EXPORT void correctChiralCenters(const ROMol &mol, DistGeom::ZMatrix &zmat)
RDKit::DGeomHelpers::setMoleculeDFS
RDKIT_DISTGEOMHELPERS_EXPORT void setMoleculeDFS(const ROMol &mol, DistGeom::ZMatrix &zmat, const InternalCoordinates &internalCoords)
RDKit
Std stuff.
Definition
Abbreviations.h:19
RDKit::DGeomHelpers::InternalCoordinates
Definition
ZMatrixBuilder.h:29
RDKit::DGeomHelpers::InternalCoordinates::torsionRange
TorsionInfo torsionRange
Definition
ZMatrixBuilder.h:30
RDKit::DGeomHelpers::InternalCoordinates::angles
BondAngleInfo angles
Definition
ZMatrixBuilder.h:31
RDKit::DGeomHelpers::InternalCoordinates::lengths
BondLengthInfo lengths
Definition
ZMatrixBuilder.h:32
RDKit::DGeomHelpers::InternalCoordinates::InternalCoordinates
InternalCoordinates(unsigned int numBonds)
Definition
ZMatrixBuilder.h:33
GraphMol
DistGeomHelpers
ZMatrixBuilder.h
Generated on
for RDKit by
1.17.0