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, const Neighbourhood &nbp);
77 
78 /*
79 * Sets the color field of the defined double bonds in *mp to CIS,
80 * TRANS, or NONE depending on the ligands with the lowest numbering[].
81 * It returns the number of defined double bonds found.
82 */
84  const std::vector<RDGeom::Point3D> &points,
85  const std::vector<unsigned> &numbering,
86  std::vector<unsigned> &bondColor);
87 }
88 }
static const int CIS
Definition: Stereo.h:31
static const int UNMARKED
Definition: Stereo.h:21
static const int ZEROED_Z_COORDINATES
Definition: Stereo.h:37
static const int EVEN_PARITY
Definition: Stereo.h:27
static int INVERT_PARITY(int p)
Definition: Stereo.h:28
static const int ODD
Definition: Stereo.h:19
static const int ALLENE_PARITY
Definition: Stereo.h:23
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:31
Contains the public API of the StructChecker.
static const int TRANS
Definition: Stereo.h:32
static const int ODD_PARITY
Definition: Stereo.h:26
RDKIT_STRUCTCHECKER_EXPORT int FixDubious3DMolecule(RWMol &mol)
RDKIT_STRUCTCHECKER_EXPORT bool AtomClash(RWMol &mol, double clash_limit)
RDKIT_STRUCTCHECKER_EXPORT int DubiousStereochemistry(RWMol &mol)
static const int EVEN
Definition: Stereo.h:20
static const int CONVERTED_TO_2D
Definition: Stereo.h:38
static const int EITHER_BOND_FOUND
Definition: Stereo.h:35
RDKIT_STRUCTCHECKER_EXPORT int CisTransPerception(const ROMol &mol, const std::vector< RDGeom::Point3D > &points, const std::vector< unsigned > &numbering, std::vector< unsigned > &bondColor)
Std stuff.
Definition: Atom.h:30
#define RDKIT_STRUCTCHECKER_EXPORT
Definition: export.h:606
RDKIT_STRUCTCHECKER_EXPORT void RemoveDubiousStereochemistry(RWMol &mol)
static const int UNDEFINED_PARITY
Definition: Stereo.h:25
RDKIT_STRUCTCHECKER_EXPORT int AtomParity(const ROMol &mol, unsigned iatom, const Neighbourhood &nbp)
RDKIT_STRUCTCHECKER_EXPORT bool CheckStereo(const ROMol &mol)
static const int ILLEGAL_REPRESENTATION
Definition: Stereo.h:24
static const int STEREO_BOND_AT_NON_STEREO_ATOM
Definition: Stereo.h:36