RDKit
Open-source cheminformatics and machine learning.
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
18namespace RDKit {
19class ROMol;
20namespace DGeomHelpers {
21
23 boost::unordered_flat_map<std::size_t, DistGeom::TorsionCandidates>;
24using BondAngleInfo = boost::unordered_flat_map<std::size_t, double>;
25using BondLengthInfo = std::vector<double>;
26
27//! A struct to store internal coordinates by unified ids through the ids from
28//! the invovled bonds
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*/
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*/
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*/
75 DistGeom::ZMatrix &zmat);
76
77} // namespace DGeomHelpers
78} // namespace RDKit
79#endif
#define RDKIT_DISTGEOMHELPERS_EXPORT
Definition export.h:161
boost::unordered_flat_map< std::size_t, DistGeom::TorsionCandidates > TorsionInfo
std::vector< double > BondLengthInfo
boost::unordered_flat_map< std::size_t, double > BondAngleInfo
RDKIT_DISTGEOMHELPERS_EXPORT void correctChiralCenters(const ROMol &mol, DistGeom::ZMatrix &zmat)
RDKIT_DISTGEOMHELPERS_EXPORT void setMoleculeDFS(const ROMol &mol, DistGeom::ZMatrix &zmat, const InternalCoordinates &internalCoords)
Std stuff.