RDKit: Chirality.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Chirality.h
Go to the documentation of this file.
1//
2// Copyright (C) 2008-2022 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/*! \file Chirality.h
11
12*/
13#include <RDGeneral/export.h>
14#ifndef RD_CHIRALITY_20AUG2008_H
15#define RD_CHIRALITY_20AUG2008_H
16#include <RDGeneral/types.h>
17#include <GraphMol/Atom.h> /* for Atom:ChiralType enum */
18#include <GraphMol/Bond.h> /* for Bond::BondDir enum */
19#include <boost/dynamic_bitset.hpp>
20#include <limits>
21
22namespace RDKit {
23class Atom;
24class Bond;
25class ROMol;
26class Conformer;
27
28 namespace Chirality {
29
30//! double bond stereo will be ignored/removed for rings smaller than this:
31 constexpr unsigned int minRingSizeForDoubleBondStereo = 8;
32
33 constexpr auto nonTetrahedralStereoEnvVar = "RDK_ENABLE_NONTETRAHEDRAL_STEREO";
34 constexpr auto useLegacyStereoEnvVar = "RDK_USE_LEGACY_STEREO_PERCEPTION";
35 constexpr bool nonTetrahedralStereoDefaultVal =
36 true; //!< whether or not nontetrahedral stereo is perceived by default
37 constexpr bool useLegacyStereoDefaultVal =
38 true; //!< whether or not the legacy stereo perception code is used by
39 //!< default
40
41 RDKIT_GRAPHMOL_EXPORT extern void setAllowNontetrahedralChirality(bool val);
42 RDKIT_GRAPHMOL_EXPORT extern bool getAllowNontetrahedralChirality();
43
44 RDKIT_GRAPHMOL_EXPORT extern void setUseLegacyStereoPerception(bool val);
45 RDKIT_GRAPHMOL_EXPORT extern bool getUseLegacyStereoPerception();
46
47 RDKIT_GRAPHMOL_EXPORT void removeNonExplicit3DChirality(ROMol &mol);
48
49 RDKIT_GRAPHMOL_EXPORT extern bool
50 useLegacyStereoPerception; //!< Toggle usage of the legacy stereo
51 //!< perception code
52
53 RDKIT_GRAPHMOL_EXPORT extern bool
54 useLegacyStereoPerception; //!< Toggle usage of the legacy stereo
55 //!< perception code
56
57/// @cond
58/*!
59 \param mol the molecule to be altered
60 \param ranks used to return the set of ranks.
61 Should be at least mol.getNumAtoms() long.
62
63 <b>Notes:</b>
64 - All atoms gain a property common_properties::_CIPRank with their overall
65 CIP ranking.
66
67*/
68 RDKIT_GRAPHMOL_EXPORT void assignAtomCIPRanks(const ROMol &mol,
69 UINT_VECT &ranks);
70
71 RDKIT_GRAPHMOL_EXPORT bool hasStereoBondDir(const Bond *bond);
72
73/**
74 * Returns the first neighboring bond that can be found which has a stereo
75 * bond direction set. If no such bond can be found, it returns null. No
76 * checks are made to ensure there aren't any other conflicting directed bonds.
77 */
78 RDKIT_GRAPHMOL_EXPORT const Bond *getNeighboringDirectedBond(const ROMol &mol,
79 const Atom *atom);
80
81/**
82 * This just translates the labels, setting/translating StereoAtoms or the
83 * label is not the responsibility of this function. If the passed label is not
84 * E/Z, it will be returned unchanged.
85 */
86 RDKIT_GRAPHMOL_EXPORT Bond::BondStereo translateEZLabelToCisTrans(
87 Bond::BondStereo label);
88/// @endcond
89
90 enum class StereoType {
91 Unspecified,
92 Atom_Tetrahedral,
93 Atom_SquarePlanar,
94 Atom_TrigonalBipyramidal,
95 Atom_Octahedral,
96 Bond_Double, // single double bond and odd-numbered cumulenes
97 Bond_Cumulene_Even, // even-numbered cumulenes
98 Bond_Atropisomer
99};
100
101 enum class StereoDescriptor {
102 None,
103 Tet_CW,
104 Tet_CCW,
105 Bond_Cis,
106 Bond_Trans,
107 Bond_AtropCW,
108 Bond_AtropCCW
109};
110
111 enum class StereoSpecified {
112 Unspecified, // no information provided
113 Specified,
114 Unknown // deliberately marked as unknown
115};
116
117 struct RDKIT_GRAPHMOL_EXPORT StereoInfo {
118 // REVIEW: absolute stereo data member?
119
120 // used to mark missing atoms
121 [[deprecated(
122 "please use Atom::NOATOM")]] inline static constexpr unsigned int NOATOM =
123 Atom::NOATOM;
124
125 StereoType type = StereoType::Unspecified;
126 StereoSpecified specified = StereoSpecified::Unspecified;
127 unsigned centeredOn = Atom::NOATOM;
128 StereoDescriptor descriptor = StereoDescriptor::None;
129 unsigned permutation = 0; // for the non-tetrahedral stereo cases
130 std::vector<unsigned> controllingAtoms; // all atoms around the atom or bond.
131 // Order is important
132 bool operator==(const StereoInfo &other) const {
133 return type == other.type && specified == other.specified &&
134 centeredOn == other.centeredOn && descriptor == other.descriptor &&
135 permutation == other.permutation &&
136 controllingAtoms == other.controllingAtoms;
137 }
138 bool operator!=(const StereoInfo &other) const { return !(*this == other); }
139};
140
141//! identifies potential stereoatoms and stereobonds in a molecule
142/*!
143 Note that this function is still somewhat experimental and the API
144 and results may change in a future release.
145
146 \param mol the molecule to look for stereo in
147 \param cleanIt remove chirality/stereo specifications from atoms/bonds that
148 cannot be chiral/stereo
149*/
150 RDKIT_GRAPHMOL_EXPORT std::vector<StereoInfo> findPotentialStereo(
151 ROMol &mol, bool cleanIt, bool flagPossible = true);
152//! overload
153 RDKIT_GRAPHMOL_EXPORT std::vector<StereoInfo> findPotentialStereo(
154 const ROMol &mol);
155
156//! removes atoms without specified chirality from stereo groups
157 RDKIT_GRAPHMOL_EXPORT void cleanupStereoGroups(ROMol &mol);
158
159//! calls the approximate legacy code for assigning CIP labels
160 RDKIT_GRAPHMOL_EXPORT void assignLegacyCIPLabels(
161 ROMol &mol, bool flagPossibleStereoCenters = false);
162
163/// @cond
164namespace detail {
165 RDKIT_GRAPHMOL_EXPORT bool isAtomPotentialNontetrahedralCenter(
166 const Atom *atom);
167 RDKIT_GRAPHMOL_EXPORT bool isAtomPotentialTetrahedralCenter(const Atom *atom);
168 RDKIT_GRAPHMOL_EXPORT bool isAtomPotentialStereoAtom(const Atom *atom);
169 RDKIT_GRAPHMOL_EXPORT bool isBondPotentialStereoBond(const Bond *bond);
170 RDKIT_GRAPHMOL_EXPORT StereoInfo getStereoInfo(const Bond *bond);
171 RDKIT_GRAPHMOL_EXPORT StereoInfo getStereoInfo(const Atom *atom);
172 RDKIT_GRAPHMOL_EXPORT bool bondAffectsAtomChirality(const Bond *bond,
173 const Atom *atom);
174 RDKIT_GRAPHMOL_EXPORT unsigned int getAtomNonzeroDegree(const Atom *atom);
175
176 RDKIT_GRAPHMOL_EXPORT bool has_protium_neighbor(const ROMol &mol,
177 const Atom *atom);
178
179} // namespace detail
180/// @endcond
181
182 RDKIT_GRAPHMOL_EXPORT INT_VECT findStereoAtoms(const Bond *bond);
183
184//! \name Non-tetrahedral stereochemistry
185//! @{
186 RDKIT_GRAPHMOL_EXPORT bool hasNonTetrahedralStereo(const Atom *center);
187 RDKIT_GRAPHMOL_EXPORT Bond *getChiralAcrossBond(const Atom *center,
188 const Bond *qry);
189 RDKIT_GRAPHMOL_EXPORT Bond *getChiralAcrossBond(const Atom *center,
190 const Atom *qry);
191 RDKIT_GRAPHMOL_EXPORT Atom *getChiralAcrossAtom(const Atom *center,
192 const Bond *qry);
193 RDKIT_GRAPHMOL_EXPORT Atom *getChiralAcrossAtom(const Atom *center,
194 const Atom *qry);
195//! \param which: if this is -1 then the second axial bond will be returned,
196//! otherwise the first
197 RDKIT_GRAPHMOL_EXPORT Bond *getTrigonalBipyramidalAxialBond(const Atom *center,
198 int which = 0);
199 RDKIT_GRAPHMOL_EXPORT Atom *getTrigonalBipyramidalAxialAtom(const Atom *center,
200 int which = 0);
201
202//! \returns 1 if it's the first axial atom, -1 if it's the second
203 RDKIT_GRAPHMOL_EXPORT int isTrigonalBipyramidalAxialBond(const Atom *center,
204 const Bond *qry);
205 RDKIT_GRAPHMOL_EXPORT int isTrigonalBipyramidalAxialAtom(const Atom *center,
206 const Atom *qry);
207
208 RDKIT_GRAPHMOL_EXPORT double getIdealAngleBetweenLigands(const Atom *center,
209 const Atom *lig1,
210 const Atom *lig2);
211
212 RDKIT_GRAPHMOL_EXPORT unsigned int getMaxNbors(const Atom::ChiralType tag);
213
214//
215// Get the chiral permutation from the storage order of bonds on an atom
216// to the desired output order (probe). Missing/implicit neihgbors can be
217// represented with (-1). To get the inverse order, i.e. from the probe to the
218// current storage order set (inverse=true)
219//
220 RDKIT_GRAPHMOL_EXPORT unsigned int getChiralPermutation(const Atom *center,
221 const INT_LIST &probe,
222 bool inverse = false);
223//! @}
224
225 RDKIT_GRAPHMOL_EXPORT std::ostream &operator<<(std::ostream &oss,
226 const StereoSpecified &s);
227 RDKIT_GRAPHMOL_EXPORT std::ostream &operator<<(std::ostream &oss,
228 const StereoType &s);
229
230 struct RDKIT_GRAPHMOL_EXPORT BondWedgingParameters {
231 bool wedgeTwoBondsIfPossible =
232 false; //!< If this is enabled then two bonds will be wedged at chiral
233 //!< centers subject to the following constraints:
234 //!< 1. ring bonds will not be wedged
235 //!< 2. bonds to chiral centers will not be wedged
236 //!< 3. bonds separated by more than 120 degrees will not be
237 //!< wedged
238};
239
240 enum class WedgeInfoType {
241 WedgeInfoTypeChiral,
242 WedgeInfoTypeAtropisomer,
243};
244
245 class WedgeInfoBase {
246 public:
247 WedgeInfoBase(int idxInit) : idx(idxInit){};
248 virtual ~WedgeInfoBase(){};
249
250 virtual WedgeInfoType getType() const = 0;
251 virtual Bond::BondDir getDir() const = 0;
252
253 int getIdx() const { return idx; }
254
255 private:
256 int idx = -1;
257};
258
259 class WedgeInfoChiral : public WedgeInfoBase {
260 public:
261 WedgeInfoChiral(int atomId) : WedgeInfoBase(atomId){};
262 ~WedgeInfoChiral() override {}
263
264 WedgeInfoType getType() const override {
265 return Chirality::WedgeInfoType::WedgeInfoTypeChiral;
266 }
267 Bond::BondDir getDir() const override {
268 throw std::runtime_error(
269 "BondDir is not stored/used in Chiral type WedgInfos");
270 }
271};
272
273 class WedgeInfoAtropisomer : public WedgeInfoBase {
274 public:
275 WedgeInfoAtropisomer(int bondId, RDKit::Bond::BondDir dirInit)
276 : WedgeInfoBase(bondId) {
277 dir = dirInit;
278 };
279 ~WedgeInfoAtropisomer() override {}
280
281 RDKit::Bond::BondDir dir = RDKit::Bond::BondDir::NONE;
282
283 WedgeInfoType getType() const override {
284 return Chirality::WedgeInfoType::WedgeInfoTypeAtropisomer;
285 }
286
287 Bond::BondDir getDir() const override { return dir; }
288};
289
290 namespace detail {
291 RDKIT_GRAPHMOL_EXPORT Bond::BondDir determineBondWedgeState(
292 const Bond *bond, unsigned int fromAtomIdx, const Conformer *conf);
293 RDKIT_GRAPHMOL_EXPORT Bond::BondDir determineBondWedgeState(
294 const Bond *bond,
295 const std::map<int, std::unique_ptr<RDKit::Chirality::WedgeInfoBase>>
296 &wedgeBonds,
297 const Conformer *conf);
298
299 RDKIT_GRAPHMOL_EXPORT std::pair<bool, INT_VECT> countChiralNbrs(
300 const ROMol &mol, int noNbrs);
301 RDKIT_GRAPHMOL_EXPORT int pickBondToWedge(
302 const Atom *atom, const ROMol &mol, const INT_VECT &nChiralNbrs,
303 const std::map<int, std::unique_ptr<RDKit::Chirality::WedgeInfoBase>>
304 &resSoFar,
305 int noNbrs);
306
307//! If useCXSmilesOrdering is true, the stereo will be assigned relative to the
308/// lowest-numbered neighbor of each double bond atom.
309/// Otherwise it uses the lowest-numbered neighbor on the lower-numbered atom of
310/// the double bond and the highest-numbered neighbor on the higher-numbered
311/// atom
312 RDKIT_GRAPHMOL_EXPORT void setStereoForBond(ROMol &mol, Bond *bond,
313 Bond::BondStereo stereo,
314 bool useCXSmilesOrdering = false);
315} // namespace detail
316
317//! picks the bonds which should be wedged
318/// returns a map from bond idx -> controlling atom idx
319 RDKIT_GRAPHMOL_EXPORT
320std::map<int, std::unique_ptr<Chirality::WedgeInfoBase>> pickBondsToWedge(
321 const ROMol &mol, const BondWedgingParameters *params = nullptr);
322
323 RDKIT_GRAPHMOL_EXPORT
324std::map<int, std::unique_ptr<Chirality::WedgeInfoBase>> pickBondsToWedge(
325 const ROMol &mol, const BondWedgingParameters *params,
326 const Conformer *conf);
327
328 RDKIT_GRAPHMOL_EXPORT void wedgeMolBonds(
329 ROMol &mol, const Conformer *conf = nullptr,
330 const BondWedgingParameters *params = nullptr);
331 RDKIT_GRAPHMOL_EXPORT void wedgeBond(Bond *bond, unsigned int fromAtomIdx,
332 const Conformer *conf);
333
334//! Returns true for double bonds which should be shown as a crossed bonds.
335// It always returns false if any adjacent bond is a squiggle bond.
336 RDKIT_GRAPHMOL_EXPORT bool shouldBeACrossedBond(const Bond *bond);
337
338//! Clears existing bond wedging and forces use of atom wedging from MolBlock.
339/*!
340 \param mol: molecule to have its wedges altered
341 \param allBondTypes: reapply the wedging also on bonds other than single and
342 aromatic ones
343 \param verify: if true, the function will check that the wedges are only
344 applied in sensible places (i.e. single bonds connected to chiral centers or
345 atropisomeric bonds)
346 */
347 RDKIT_GRAPHMOL_EXPORT void reapplyMolBlockWedging(ROMol &mol,
348 bool allBondTypes = true,
349 bool verify = false);
350
351//! Remove MolBlock bond wedging information from molecule.
352/*!
353 \param mol: molecule to modify
354 */
355 RDKIT_GRAPHMOL_EXPORT void clearMolBlockWedgingInfo(ROMol &mol);
356//! Invert bond wedging information read from a mol block (if present).
357/*!
358 \param mol: molecule to modify
359 */
360 RDKIT_GRAPHMOL_EXPORT void invertMolBlockWedgingInfo(ROMol &mol);
361
362//! gets stereo info for a bond
363/*!
364 \param bond: bond to check
365 \param wedgeBonds - the list of bonds to have wedges
366 \param conf - Conformer to use
367 \param dirCode - receives the dircode for the bond
368 \param reverse - receives the reverse flag
369 only returned if it was exlicility set witha wiggle bond
370 */
371
372 RDKIT_GRAPHMOL_EXPORT void GetMolFileBondStereoInfo(
373 const Bond *bond,
374 const std::map<int, std::unique_ptr<RDKit::Chirality::WedgeInfoBase>>
375 &wedgeBonds,
376 const Conformer *conf, int &dirCode, bool &reverse);
377
378 RDKIT_GRAPHMOL_EXPORT void GetMolFileBondStereoInfo(
379 const Bond *bond,
380 const std::map<int, std::unique_ptr<RDKit::Chirality::WedgeInfoBase>>
381 &wedgeBonds,
382 const Conformer *conf, Bond::BondDir &dir, bool &reverse);
383
384//! add R/S, relative stereo, and E/Z annotations to atoms and bonds
385/*!
386 \param mol: molecule to modify
387 \param absLabel: label for atoms in an ABS stereo group
388 \param orLabel: label for atoms in an OR stereo group
389 \param andLabel: label for atoms in an AND stereo group
390 \param cipLabel: label for chiral atoms that aren't in a stereo group.
391 \param bondLabel: label for CIP stereochemistry on bonds
392
393 If any label is empty, the corresponding annotations will not be added.
394
395 The labels can contain the following placeholders:
396 {id} - the stereo group's index
397 {cip} - the atom or bond's CIP stereochemistry
398
399 Note that CIP labels will only be added if CIP stereochemistry has been
400 assigned to the molecule.
401
402 */
403 RDKIT_GRAPHMOL_EXPORT void addStereoAnnotations(
404 ROMol &mol, std::string absLabel = "abs ({cip})",
405 std::string orLabel = "or{id}", std::string andLabel = "and{id}",
406 std::string cipLabel = "({cip})", std::string bondLabel = "({cip})");
407
408//! simplifies the stereochemical representation of a molecule where all
409//! specified stereocenters are in the same StereoGroup
410/*!
411 \param mol: molecule to modify
412 \param removeAffectedStereoGroups: if set then the affected StereoGroups will
413 be removed
414
415If all specified stereocenters are in the same AND or OR stereogroup, a
416moleculeNote property will be set on the molecule with the value "AND
417enantiomer" or "OR enantiomer". CIP labels, if present, are removed.
418
419*/
420 RDKIT_GRAPHMOL_EXPORT void simplifyEnhancedStereo(
421 ROMol &mol, bool removeAffectedStereoGroups = true);
422
423//! returns the meso centers in a molecule (if any)
424/*!
425 \param mol: molecule to work with
426
427*/
428 RDKIT_GRAPHMOL_EXPORT std::vector<std::pair<unsigned int, unsigned int>>
429findMesoCenters(const ROMol &mol, bool includeIsotopes = true,
430 bool includeAtomMaps = false);
431
432} // namespace Chirality
433} // namespace RDKit
434#endif
Atom.h
Defines the Atom class and associated typedefs.
Bond.h
RDKit::Atom
The class for representing atoms.
Definition Atom.h:74
RDKit::Atom::NOATOM
static constexpr unsigned int NOATOM
Definition Atom.h:85
RDKit::Atom::ChiralType
ChiralType
store type of chirality
Definition Atom.h:105
RDKit::Bond
class for representing a bond
Definition Bond.h:46
RDKit::Bond::BondDir
BondDir
the bond's direction (for chirality)
Definition Bond.h:82
RDKit::Bond::NONE
@ NONE
no special style
Definition Bond.h:83
RDKit::Bond::BondStereo
BondStereo
the nature of the bond's stereochem (for cis/trans)
Definition Bond.h:94
RDKit::Chirality::WedgeInfoAtropisomer::~WedgeInfoAtropisomer
~WedgeInfoAtropisomer() override
Definition Chirality.h:279
RDKit::Chirality::WedgeInfoAtropisomer::getType
WedgeInfoType getType() const override
Definition Chirality.h:283
RDKit::Chirality::WedgeInfoAtropisomer::dir
RDKit::Bond::BondDir dir
Definition Chirality.h:281
RDKit::Chirality::WedgeInfoAtropisomer::WedgeInfoAtropisomer
WedgeInfoAtropisomer(int bondId, RDKit::Bond::BondDir dirInit)
Definition Chirality.h:275
RDKit::Chirality::WedgeInfoAtropisomer::getDir
Bond::BondDir getDir() const override
Definition Chirality.h:287
RDKit::Chirality::WedgeInfoBase::~WedgeInfoBase
virtual ~WedgeInfoBase()
Definition Chirality.h:248
RDKit::Chirality::WedgeInfoBase::WedgeInfoBase
WedgeInfoBase(int idxInit)
Definition Chirality.h:247
RDKit::Chirality::WedgeInfoBase::getIdx
int getIdx() const
Definition Chirality.h:253
RDKit::Chirality::WedgeInfoBase::getDir
virtual Bond::BondDir getDir() const =0
RDKit::Chirality::WedgeInfoBase::getType
virtual WedgeInfoType getType() const =0
RDKit::Chirality::WedgeInfoChiral::getDir
Bond::BondDir getDir() const override
Definition Chirality.h:267
RDKit::Chirality::WedgeInfoChiral::WedgeInfoChiral
WedgeInfoChiral(int atomId)
Definition Chirality.h:261
RDKit::Chirality::WedgeInfoChiral::getType
WedgeInfoType getType() const override
Definition Chirality.h:264
RDKit::Chirality::WedgeInfoChiral::~WedgeInfoChiral
~WedgeInfoChiral() override
Definition Chirality.h:262
RDKit::Conformer
The class for representing 2D or 3D conformation of a molecule.
Definition Conformer.h:46
RDKit::ROMol
Definition ROMol.h:199
export.h
RDKIT_GRAPHMOL_EXPORT
#define RDKIT_GRAPHMOL_EXPORT
Definition export.h:249
RDKit::Chirality::detail
Definition Chirality.h:290
RDKit::Chirality::detail::countChiralNbrs
RDKIT_GRAPHMOL_EXPORT std::pair< bool, INT_VECT > countChiralNbrs(const ROMol &mol, int noNbrs)
RDKit::Chirality::detail::setStereoForBond
RDKIT_GRAPHMOL_EXPORT void setStereoForBond(ROMol &mol, Bond *bond, Bond::BondStereo stereo, bool useCXSmilesOrdering=false)
RDKit::Chirality::detail::pickBondToWedge
RDKIT_GRAPHMOL_EXPORT int pickBondToWedge(const Atom *atom, const ROMol &mol, const INT_VECT &nChiralNbrs, const std::map< int, std::unique_ptr< RDKit::Chirality::WedgeInfoBase > > &resSoFar, int noNbrs)
RDKit::Chirality::detail::determineBondWedgeState
RDKIT_GRAPHMOL_EXPORT Bond::BondDir determineBondWedgeState(const Bond *bond, unsigned int fromAtomIdx, const Conformer *conf)
RDKit::Chirality
Definition Chirality.h:28
RDKit::Chirality::getUseLegacyStereoPerception
RDKIT_GRAPHMOL_EXPORT bool getUseLegacyStereoPerception()
RDKit::Chirality::isTrigonalBipyramidalAxialAtom
RDKIT_GRAPHMOL_EXPORT int isTrigonalBipyramidalAxialAtom(const Atom *center, const Atom *qry)
RDKit::Chirality::StereoDescriptor
StereoDescriptor
Definition Chirality.h:101
RDKit::Chirality::StereoDescriptor::Tet_CW
@ Tet_CW
Definition Chirality.h:103
RDKit::Chirality::StereoDescriptor::Bond_AtropCCW
@ Bond_AtropCCW
Definition Chirality.h:108
RDKit::Chirality::StereoDescriptor::Bond_Trans
@ Bond_Trans
Definition Chirality.h:106
RDKit::Chirality::StereoDescriptor::None
@ None
Definition Chirality.h:102
RDKit::Chirality::StereoDescriptor::Bond_AtropCW
@ Bond_AtropCW
Definition Chirality.h:107
RDKit::Chirality::StereoDescriptor::Tet_CCW
@ Tet_CCW
Definition Chirality.h:104
RDKit::Chirality::StereoDescriptor::Bond_Cis
@ Bond_Cis
Definition Chirality.h:105
RDKit::Chirality::getChiralPermutation
RDKIT_GRAPHMOL_EXPORT unsigned int getChiralPermutation(const Atom *center, const INT_LIST &probe, bool inverse=false)
RDKit::Chirality::getAllowNontetrahedralChirality
RDKIT_GRAPHMOL_EXPORT bool getAllowNontetrahedralChirality()
RDKit::Chirality::wedgeMolBonds
RDKIT_GRAPHMOL_EXPORT void wedgeMolBonds(ROMol &mol, const Conformer *conf=nullptr, const BondWedgingParameters *params=nullptr)
RDKit::Chirality::getMaxNbors
RDKIT_GRAPHMOL_EXPORT unsigned int getMaxNbors(const Atom::ChiralType tag)
RDKit::Chirality::getTrigonalBipyramidalAxialAtom
RDKIT_GRAPHMOL_EXPORT Atom * getTrigonalBipyramidalAxialAtom(const Atom *center, int which=0)
RDKit::Chirality::invertMolBlockWedgingInfo
RDKIT_GRAPHMOL_EXPORT void invertMolBlockWedgingInfo(ROMol &mol)
Invert bond wedging information read from a mol block (if present).
RDKit::Chirality::setUseLegacyStereoPerception
RDKIT_GRAPHMOL_EXPORT void setUseLegacyStereoPerception(bool val)
RDKit::Chirality::findMesoCenters
RDKIT_GRAPHMOL_EXPORT std::vector< std::pair< unsigned int, unsigned int > > findMesoCenters(const ROMol &mol, bool includeIsotopes=true, bool includeAtomMaps=false)
returns the meso centers in a molecule (if any)
RDKit::Chirality::simplifyEnhancedStereo
RDKIT_GRAPHMOL_EXPORT void simplifyEnhancedStereo(ROMol &mol, bool removeAffectedStereoGroups=true)
RDKit::Chirality::shouldBeACrossedBond
RDKIT_GRAPHMOL_EXPORT bool shouldBeACrossedBond(const Bond *bond)
Returns true for double bonds which should be shown as a crossed bonds.
RDKit::Chirality::minRingSizeForDoubleBondStereo
constexpr unsigned int minRingSizeForDoubleBondStereo
double bond stereo will be ignored/removed for rings smaller than this:
Definition Chirality.h:31
RDKit::Chirality::useLegacyStereoDefaultVal
constexpr bool useLegacyStereoDefaultVal
Definition Chirality.h:37
RDKit::Chirality::GetMolFileBondStereoInfo
RDKIT_GRAPHMOL_EXPORT void GetMolFileBondStereoInfo(const Bond *bond, const std::map< int, std::unique_ptr< RDKit::Chirality::WedgeInfoBase > > &wedgeBonds, const Conformer *conf, int &dirCode, bool &reverse)
gets stereo info for a bond
RDKit::Chirality::getChiralAcrossAtom
RDKIT_GRAPHMOL_EXPORT Atom * getChiralAcrossAtom(const Atom *center, const Bond *qry)
RDKit::Chirality::setAllowNontetrahedralChirality
RDKIT_GRAPHMOL_EXPORT void setAllowNontetrahedralChirality(bool val)
RDKit::Chirality::getTrigonalBipyramidalAxialBond
RDKIT_GRAPHMOL_EXPORT Bond * getTrigonalBipyramidalAxialBond(const Atom *center, int which=0)
RDKit::Chirality::nonTetrahedralStereoEnvVar
constexpr auto nonTetrahedralStereoEnvVar
Definition Chirality.h:33
RDKit::Chirality::removeNonExplicit3DChirality
RDKIT_GRAPHMOL_EXPORT void removeNonExplicit3DChirality(ROMol &mol)
RDKit::Chirality::useLegacyStereoEnvVar
constexpr auto useLegacyStereoEnvVar
Definition Chirality.h:34
RDKit::Chirality::useLegacyStereoPerception
RDKIT_GRAPHMOL_EXPORT bool useLegacyStereoPerception
Definition Chirality.h:54
RDKit::Chirality::reapplyMolBlockWedging
RDKIT_GRAPHMOL_EXPORT void reapplyMolBlockWedging(ROMol &mol, bool allBondTypes=true, bool verify=false)
Clears existing bond wedging and forces use of atom wedging from MolBlock.
RDKit::Chirality::operator<<
RDKIT_GRAPHMOL_EXPORT std::ostream & operator<<(std::ostream &oss, const StereoSpecified &s)
RDKit::Chirality::wedgeBond
RDKIT_GRAPHMOL_EXPORT void wedgeBond(Bond *bond, unsigned int fromAtomIdx, const Conformer *conf)
RDKit::Chirality::pickBondsToWedge
RDKIT_GRAPHMOL_EXPORT std::map< int, std::unique_ptr< Chirality::WedgeInfoBase > > pickBondsToWedge(const ROMol &mol, const BondWedgingParameters *params=nullptr)
RDKit::Chirality::findPotentialStereo
RDKIT_GRAPHMOL_EXPORT std::vector< StereoInfo > findPotentialStereo(ROMol &mol, bool cleanIt, bool flagPossible=true)
identifies potential stereoatoms and stereobonds in a molecule
RDKit::Chirality::addStereoAnnotations
RDKIT_GRAPHMOL_EXPORT void addStereoAnnotations(ROMol &mol, std::string absLabel="abs ({cip})", std::string orLabel="or{id}", std::string andLabel="and{id}", std::string cipLabel="({cip})", std::string bondLabel="({cip})")
add R/S, relative stereo, and E/Z annotations to atoms and bonds
RDKit::Chirality::hasNonTetrahedralStereo
RDKIT_GRAPHMOL_EXPORT bool hasNonTetrahedralStereo(const Atom *center)
RDKit::Chirality::isTrigonalBipyramidalAxialBond
RDKIT_GRAPHMOL_EXPORT int isTrigonalBipyramidalAxialBond(const Atom *center, const Bond *qry)
RDKit::Chirality::StereoType
StereoType
Definition Chirality.h:90
RDKit::Chirality::StereoType::Bond_Atropisomer
@ Bond_Atropisomer
Definition Chirality.h:98
RDKit::Chirality::StereoType::Atom_TrigonalBipyramidal
@ Atom_TrigonalBipyramidal
Definition Chirality.h:94
RDKit::Chirality::StereoType::Atom_SquarePlanar
@ Atom_SquarePlanar
Definition Chirality.h:93
RDKit::Chirality::StereoType::Atom_Tetrahedral
@ Atom_Tetrahedral
Definition Chirality.h:92
RDKit::Chirality::StereoType::Bond_Cumulene_Even
@ Bond_Cumulene_Even
Definition Chirality.h:97
RDKit::Chirality::StereoType::Unspecified
@ Unspecified
Definition Chirality.h:91
RDKit::Chirality::StereoType::Atom_Octahedral
@ Atom_Octahedral
Definition Chirality.h:95
RDKit::Chirality::StereoType::Bond_Double
@ Bond_Double
Definition Chirality.h:96
RDKit::Chirality::getIdealAngleBetweenLigands
RDKIT_GRAPHMOL_EXPORT double getIdealAngleBetweenLigands(const Atom *center, const Atom *lig1, const Atom *lig2)
RDKit::Chirality::cleanupStereoGroups
RDKIT_GRAPHMOL_EXPORT void cleanupStereoGroups(ROMol &mol)
removes atoms without specified chirality from stereo groups
RDKit::Chirality::StereoSpecified
StereoSpecified
Definition Chirality.h:111
RDKit::Chirality::StereoSpecified::Unspecified
@ Unspecified
Definition Chirality.h:112
RDKit::Chirality::StereoSpecified::Unknown
@ Unknown
Definition Chirality.h:114
RDKit::Chirality::StereoSpecified::Specified
@ Specified
Definition Chirality.h:113
RDKit::Chirality::getChiralAcrossBond
RDKIT_GRAPHMOL_EXPORT Bond * getChiralAcrossBond(const Atom *center, const Bond *qry)
RDKit::Chirality::nonTetrahedralStereoDefaultVal
constexpr bool nonTetrahedralStereoDefaultVal
whether or not nontetrahedral stereo is perceived by default
Definition Chirality.h:35
RDKit::Chirality::clearMolBlockWedgingInfo
RDKIT_GRAPHMOL_EXPORT void clearMolBlockWedgingInfo(ROMol &mol)
Remove MolBlock bond wedging information from molecule.
RDKit::Chirality::findStereoAtoms
RDKIT_GRAPHMOL_EXPORT INT_VECT findStereoAtoms(const Bond *bond)
RDKit::Chirality::assignLegacyCIPLabels
RDKIT_GRAPHMOL_EXPORT void assignLegacyCIPLabels(ROMol &mol, bool flagPossibleStereoCenters=false)
calls the approximate legacy code for assigning CIP labels
RDKit::Chirality::WedgeInfoType
WedgeInfoType
Definition Chirality.h:240
RDKit::Chirality::WedgeInfoType::WedgeInfoTypeAtropisomer
@ WedgeInfoTypeAtropisomer
Definition Chirality.h:242
RDKit::Chirality::WedgeInfoType::WedgeInfoTypeChiral
@ WedgeInfoTypeChiral
Definition Chirality.h:241
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::INT_LIST
std::list< int > INT_LIST
Definition types.h:309
RDKit::INT_VECT
std::vector< int > INT_VECT
Definition types.h:303
RDKit::UINT_VECT
std::vector< UINT > UINT_VECT
Definition types.h:322
RDKit::Chirality::BondWedgingParameters
Definition Chirality.h:230
RDKit::Chirality::BondWedgingParameters::wedgeTwoBondsIfPossible
bool wedgeTwoBondsIfPossible
Definition Chirality.h:231
RDKit::Chirality::StereoInfo
Definition Chirality.h:117
RDKit::Chirality::StereoInfo::controllingAtoms
std::vector< unsigned > controllingAtoms
Definition Chirality.h:130
RDKit::Chirality::StereoInfo::permutation
unsigned permutation
Definition Chirality.h:129
RDKit::Chirality::StereoInfo::specified
StereoSpecified specified
Definition Chirality.h:126
RDKit::Chirality::StereoInfo::centeredOn
unsigned centeredOn
Definition Chirality.h:127
RDKit::Chirality::StereoInfo::type
StereoType type
Definition Chirality.h:125
RDKit::Chirality::StereoInfo::NOATOM
static constexpr unsigned int NOATOM
Definition Chirality.h:122
RDKit::Chirality::StereoInfo::descriptor
StereoDescriptor descriptor
Definition Chirality.h:128
RDKit::Chirality::StereoInfo::operator!=
bool operator!=(const StereoInfo &other) const
Definition Chirality.h:138
RDKit::Chirality::StereoInfo::operator==
bool operator==(const StereoInfo &other) const
Definition Chirality.h:132
types.h