RDKit: Stereo.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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