RDKit: DetermineBonds.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
DetermineBonds.h
Go to the documentation of this file.
1//
2// Copyright (C) 2022 Sreya Gogineni 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
12#ifndef RD_DETERMINEBONDS_H
13#define RD_DETERMINEBONDS_H
14#include <GraphMol/RDKitBase.h>
15
16namespace RDKit {
17
18 class RDKIT_DETERMINEBONDS_EXPORT MaxFindBondOrdersItersExceeded
19 : public std::runtime_error {
20 public:
21 explicit MaxFindBondOrdersItersExceeded()
22 : std::runtime_error(
23 "Max Iterations Exceeded in Determine Bond Orders"){};
24};
25
26// ! assigns atomic connectivity to a molecule using atomic coordinates,
27// disregarding pre-existing bonds
28/*!
29
30 This is based on xyz2mol: https://github.com/jensengroup/xyz2mol
31
32 \param mol is the molecule of interest; it must have a 3D conformer
33 \param useHueckel (optional) if this is \c true, extended Hueckel theory
34 will be used to determine connectivity rather than the van der Waals or
35 connect-the-dots method
36 \param charge (optional) the charge of the molecule; it must be provided if
37 the Hueckel method is used and charge is non-zero
38 \param covFactor (optional) the factor with which to multiply each covalent
39 radius if the van der Waals method is used
40 \param useVdw (optional) if this is \c false, the connect-the-dots method
41 will be used instead of the van der Waals method
42 */
43 RDKIT_DETERMINEBONDS_EXPORT void determineConnectivity(RWMol &mol,
44 bool useHueckel = false,
45 int charge = 0,
46 double covFactor = 1.3,
47 bool useVdw = false);
48
49// ! assigns bond ordering to a molecule that has atomic connectivity defined;
50// it is recommended to sanitize the molecule after calling this function if
51// embedChiral is not set to true
52/*!
53
54 This is based on xyz2mol: https://github.com/jensengroup/xyz2mol
55
56 \param mol is the molecule of interest; it must have single bonds
57 corresponding to the atomic connectivity
58 \param charge (optional) the charge
59 of the molecule; it must be provided if charge is non-zero
60 \param allowChargedFragments (optional) if this is \c true, formal charges
61 will be placed on atoms according to their valency; otherwise, radical
62 electrons will be placed on the atoms
63 \param embedChiral (optional) if this is \c true,
64 chirality information will be embedded into the molecule; the function calls
65 sanitizeMol() when this is true
66 \param useAtomMap (optional) if this is \c
67 true, an atom map will be created for the molecule
68 \param maxIterations (optional) maximum number of iterations to run in the
69 bond order detection algorithm, after which a MaxFindBondOrdersItersExceeded
70 exception will be thrown. Defaults to 0 (no limit)
71
72 \throws MaxFindBondOrdersItersExceeded
73 */
74 RDKIT_DETERMINEBONDS_EXPORT void determineBondOrders(
75 RWMol &mol, int charge = 0, bool allowChargedFragments = true,
76 bool embedChiral = true, bool useAtomMap = false, size_t maxIterations = 0);
77
78// ! assigns atomic connectivity to a molecule using atomic coordinates,
79// disregarding pre-existing bonds; it is recommended to sanitize the molecule
80// after calling this function if embedChiral is not set to true
81/*!
82
83 This is based on xyz2mol: https://github.com/jensengroup/xyz2mol
84
85 \param mol is the molecule of interest; it must have a 3D conformer
86 \param useHueckel (optional) if this is \c true, extended Hueckel theory
87 will be used to determine connectivity rather than the van der Waals or
88 connect-the-dots method
89 \param charge (optional) the charge of the molecule; it must be provided if
90 charge is non-zero
91 \param covFactor (optional) the factor with which to multiply each covalent
92 radius if the van der Waals method is used
93 \param allowChargedFragments (optional) if this is \c true, formal charges
94 will be placed on atoms according to their valency; otherwise, radical
95 electrons will be placed on the atoms
96 \param embedChiral (optional) if this is \c true, chirality information will
97 be embedded into the molecule; the function calls sanitizeMol() when this is
98 true
99 \param useAtomMap (optional) if this is \c true, an atom map will be created
100 for the molecule
101 \param useVdw (optional) if this is \c false, the connect-the-dots method
102 will be used instead of the van der Waals method
103 \param maxIterations (optional) maximum number of iterations to run in the
104 bond order detection algorithm, after which a MaxFindBondOrdersItersExceeded
105 exception will be thrown. Defaults to 0 (no limit)
106
107 \throws MaxFindBondOrdersItersExceeded
108 */
109 RDKIT_DETERMINEBONDS_EXPORT void determineBonds(
110 RWMol &mol, bool useHueckel = false, int charge = 0, double covFactor = 1.3,
111 bool allowChargedFragments = true, bool embedChiral = true,
112 bool useAtomMap = false, bool useVdw = false, size_t maxIterations = 0);
113
114} // namespace RDKit
115
116#endif
RDKitBase.h
pulls in the core RDKit functionality
RDKit::MaxFindBondOrdersItersExceeded::MaxFindBondOrdersItersExceeded
MaxFindBondOrdersItersExceeded()
Definition DetermineBonds.h:21
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
export.h
RDKIT_DETERMINEBONDS_EXPORT
#define RDKIT_DETERMINEBONDS_EXPORT
Definition export.h:121
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::determineBondOrders
RDKIT_DETERMINEBONDS_EXPORT void determineBondOrders(RWMol &mol, int charge=0, bool allowChargedFragments=true, bool embedChiral=true, bool useAtomMap=false, size_t maxIterations=0)
RDKit::determineConnectivity
RDKIT_DETERMINEBONDS_EXPORT void determineConnectivity(RWMol &mol, bool useHueckel=false, int charge=0, double covFactor=1.3, bool useVdw=false)
RDKit::determineBonds
RDKIT_DETERMINEBONDS_EXPORT void determineBonds(RWMol &mol, bool useHueckel=false, int charge=0, double covFactor=1.3, bool allowChargedFragments=true, bool embedChiral=true, bool useAtomMap=false, bool useVdw=false, size_t maxIterations=0)