RDKit
Open-source cheminformatics and machine learning.
Stereo.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2016 Novartis Institutes for BioMedical Research
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 #pragma once
12 #include "StructChecker.h"
13 #include "Utilites.h"
14 
15 namespace RDKit {
16 namespace StructureCheck {
17 
18 // ??? stereo parity
19 static const int ODD = 1;
20 static const int EVEN = 2;
21 static const int UNMARKED = 3;
22 
23 static const int ALLENE_PARITY = -2;
24 static const int ILLEGAL_REPRESENTATION = -1;
25 static const int UNDEFINED_PARITY = 0;
26 static const int ODD_PARITY = 1;
27 static const int EVEN_PARITY = 2;
28 static inline int INVERT_PARITY(int p) { return ((p) == 0 ? (0) : (3 - (p))); }
29 
30 // bond color:
31 static const int CIS = 1;
32 static const int TRANS = 2;
33 
34 // return codes for DubiousStereochemistry()
35 static const int EITHER_BOND_FOUND = 1;
36 static const int STEREO_BOND_AT_NON_STEREO_ATOM = 2;
37 static const int ZEROED_Z_COORDINATES = 4;
38 static const int CONVERTED_TO_2D = 8;
39 /* DubiousStereochemistry:
40  * Checks if there is some ill-defined stereochemistry in the
41  * molecule *mp. The function returns a bit set integer which defines
42  * the problems encountered.
43  */
45 
46 /* FixDubious3DMolecule:
47  * Checks if the structure has 3D coordinates and/or flat sp3-carbons with
48  * stereo-bonds and
49  * converts the designation to 2D, clearing away any Z-component of the
50  * coordinates.
51  * Real 3D structures without stereo designations go through untouched.
52  */
54 
55 // Removes ill-defined stereodescriptors.
57 
58 /*
59  * Checks if all potential stereocenters are either completely undefined
60  * or attributed with hashes and wedges according to MDL rules.
61  */
63 
64 /*
65  * Checks if any two atoms in *mp come closer than 10% of the
66  * average bond length or if an atom is too close the line
67  * between two bonded atoms.
68  */
69 RDKIT_STRUCTCHECKER_EXPORT bool AtomClash(RWMol &mol, double clash_limit);
70 
71 /*
72  * Computes the stereo parity of atom number iatom in *mp relative
73  * to its numbering. The immediate neighbours are defined by *nbp
74  * to speed up processing.
75  */
76 RDKIT_STRUCTCHECKER_EXPORT int AtomParity(const ROMol &mol, unsigned iatom,
77  const Neighbourhood &nbp);
78 
79 /*
80  * Sets the color field of the defined double bonds in *mp to CIS,
81  * TRANS, or NONE depending on the ligands with the lowest numbering[].
82  * It returns the number of defined double bonds found.
83  */
85  const ROMol &mol, const std::vector<RDGeom::Point3D> &points,
86  const std::vector<unsigned> &numbering, std::vector<unsigned> &bondColor);
87 } // namespace StructureCheck
88 } // namespace RDKit
Utilites.h
RDKit::StructureCheck::Neighbourhood
Definition: Utilites.h:18
RDKit::StructureCheck::CheckStereo
RDKIT_STRUCTCHECKER_EXPORT bool CheckStereo(const ROMol &mol)
RDKit::StructureCheck::CisTransPerception
RDKIT_STRUCTCHECKER_EXPORT int CisTransPerception(const ROMol &mol, const std::vector< RDGeom::Point3D > &points, const std::vector< unsigned > &numbering, std::vector< unsigned > &bondColor)
RDKit::StructureCheck::RemoveDubiousStereochemistry
RDKIT_STRUCTCHECKER_EXPORT void RemoveDubiousStereochemistry(RWMol &mol)
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:31
RDKit::StructureCheck::ILLEGAL_REPRESENTATION
static const int ILLEGAL_REPRESENTATION
Definition: Stereo.h:24
RDKit::StructureCheck::CIS
static const int CIS
Definition: Stereo.h:31
RDKit::StructureCheck::AtomClash
RDKIT_STRUCTCHECKER_EXPORT bool AtomClash(RWMol &mol, double clash_limit)
RDKit::StructureCheck::ODD
static const int ODD
Definition: Stereo.h:19
RDKit::StructureCheck::ZEROED_Z_COORDINATES
static const int ZEROED_Z_COORDINATES
Definition: Stereo.h:37
RDKit::ROMol
Definition: ROMol.h:171
RDKit::StructureCheck::UNDEFINED_PARITY
static const int UNDEFINED_PARITY
Definition: Stereo.h:25
RDKit::StructureCheck::EITHER_BOND_FOUND
static const int EITHER_BOND_FOUND
Definition: Stereo.h:35
StructChecker.h
Contains the public API of the StructChecker.
RDKit::StructureCheck::TRANS
static const int TRANS
Definition: Stereo.h:32
RDKit::StructureCheck::STEREO_BOND_AT_NON_STEREO_ATOM
static const int STEREO_BOND_AT_NON_STEREO_ATOM
Definition: Stereo.h:36
RDKit::StructureCheck::CONVERTED_TO_2D
static const int CONVERTED_TO_2D
Definition: Stereo.h:38
RDKit::StructureCheck::DubiousStereochemistry
RDKIT_STRUCTCHECKER_EXPORT int DubiousStereochemistry(RWMol &mol)
RDKit::StructureCheck::UNMARKED
static const int UNMARKED
Definition: Stereo.h:21
RDKit::StructureCheck::EVEN_PARITY
static const int EVEN_PARITY
Definition: Stereo.h:27
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::StructureCheck::AtomParity
RDKIT_STRUCTCHECKER_EXPORT int AtomParity(const ROMol &mol, unsigned iatom, const Neighbourhood &nbp)
RDKit::StructureCheck::FixDubious3DMolecule
RDKIT_STRUCTCHECKER_EXPORT int FixDubious3DMolecule(RWMol &mol)
RDKit::StructureCheck::ALLENE_PARITY
static const int ALLENE_PARITY
Definition: Stereo.h:23
RDKIT_STRUCTCHECKER_EXPORT
#define RDKIT_STRUCTCHECKER_EXPORT
Definition: export.h:645
RDKit::StructureCheck::EVEN
static const int EVEN
Definition: Stereo.h:20
RDKit::StructureCheck::ODD_PARITY
static const int ODD_PARITY
Definition: Stereo.h:26
RDKit::StructureCheck::INVERT_PARITY
static int INVERT_PARITY(int p)
Definition: Stereo.h:28
export.h