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