File: Stereo.h

package info (click to toggle)
rdkit 201809.1%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 123,688 kB
  • sloc: cpp: 230,509; python: 70,501; java: 6,329; ansic: 5,427; sql: 1,899; yacc: 1,739; lex: 1,243; makefile: 445; xml: 229; fortran: 183; sh: 123; cs: 93
file content (88 lines) | stat: -rw-r--r-- 2,979 bytes parent folder | download
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
//
//  Copyright (C) 2016 Novartis Institutes for BioMedical Research
//
//   @@ 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>
#pragma once
#include "StructChecker.h"
#include "Utilites.h"

namespace RDKit {
namespace StructureCheck {

// ??? stereo parity
static const int ODD = 1;
static const int EVEN = 2;
static const int UNMARKED = 3;

static const int ALLENE_PARITY = -2;
static const int ILLEGAL_REPRESENTATION = -1;
static const int UNDEFINED_PARITY = 0;
static const int ODD_PARITY = 1;
static const int EVEN_PARITY = 2;
static inline int INVERT_PARITY(int p) { return ((p) == 0 ? (0) : (3 - (p))); }

// bond color:
static const int CIS = 1;
static const int TRANS = 2;

// return codes for DubiousStereochemistry()
static const int EITHER_BOND_FOUND = 1;
static const int STEREO_BOND_AT_NON_STEREO_ATOM = 2;
static const int ZEROED_Z_COORDINATES = 4;
static const int CONVERTED_TO_2D = 8;
/* DubiousStereochemistry:
* Checks if there is some ill-defined stereochemistry in the
* molecule *mp. The function returns a bit set integer which defines
* the problems encountered.
*/
RDKIT_STRUCTCHECKER_EXPORT int DubiousStereochemistry(RWMol &mol);

/* FixDubious3DMolecule:
* Checks if the structure has 3D coordinates and/or flat sp3-carbons with
* stereo-bonds and
* converts the designation to 2D, clearing away any Z-component of the
* coordinates.
* Real 3D structures without stereo designations go through untouched.
*/
RDKIT_STRUCTCHECKER_EXPORT int FixDubious3DMolecule(RWMol &mol);

// Removes ill-defined stereodescriptors.
RDKIT_STRUCTCHECKER_EXPORT void RemoveDubiousStereochemistry(RWMol &mol);

/*
* Checks if all potential stereocenters are either completely undefined
* or attributed with hashes and wedges according to MDL rules.
*/
RDKIT_STRUCTCHECKER_EXPORT bool CheckStereo(const ROMol &mol);

/*
* Checks if any two atoms in *mp come closer than 10% of the
* average bond length or if an atom is too close the line
* between two bonded atoms.
*/
RDKIT_STRUCTCHECKER_EXPORT bool AtomClash(RWMol &mol, double clash_limit);

/*
* Computes the stereo parity of atom number iatom in *mp relative
* to its numbering. The immediate neighbours are defined by *nbp
* to speed up processing.
*/
RDKIT_STRUCTCHECKER_EXPORT int AtomParity(const ROMol &mol, unsigned iatom, const Neighbourhood &nbp);

/*
* Sets the color field of the defined double bonds in *mp to CIS,
* TRANS, or NONE depending on the ligands with the lowest numbering[].
* It returns the number of defined double bonds found.
*/
RDKIT_STRUCTCHECKER_EXPORT int CisTransPerception(const ROMol &mol,
                       const std::vector<RDGeom::Point3D> &points,
                       const std::vector<unsigned> &numbering,
                       std::vector<unsigned> &bondColor);
}
}