RDKit: StructChecker_details.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

StructChecker_details.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 #ifndef RD_STRUCTCHECKER_DETAILS_H
12 #define RD_STRUCTCHECKER_DETAILS_H
13
14 #include <string>
15 #include <vector>
16 #include "../RDKitBase.h"
17
18 /* Example of Usage
19 1) StructChecker chk;
20 int flags = StructureCheck::checkMolStructure( mol ); // use defaults
21 or
22 2)
23 StructureCheck::StructCheckerOptions options; // use defaults
24 // To use external data
25 StructureCheck::loadOptionsFromFiles(options, file1, file2, �);
26 StructChecker chk(options);
27
28 for( mol in mols ) {
29 int flags = StructureCheck::checkMolStructure( mol, &options);
30 if (0!=(flags & StructureCheck::StructureFlags::BAD_SET)) {
31 // write to error file
32 } else if (0!=(flags & StructureCheck::StructureFlags::TRANSFORMED_SET))
33 {
34 // input molecule was transformed
35 } else { // flag == NO_CHANGE
36 // no change
37 }
38 }
39 */
40
41 namespace RDKit {
42 namespace StructureCheck {
43
44 // TypeDefs for translating augmented atom pairs
45 static const int ANY_CHARGE = 8;
46 enum RadicalType {
47 RT_NONE = 0,
48 SINGLET = 1,
49 DOUBLET = 2,
50 TRIPLET = 3,
51 ANY_RADICAL = 0xFF
52 };
53
54 enum AABondType { // MDL CTFile bond types plus extensions
55 BT_NONE = 0, // means REMOVE Bond
56 SINGLE = 1,
57 DOUBLE = 2,
58 TRIPLE = 3,
59 AROMATIC = 4,
60 SINGLE_DOUBLE = 5,
61 SINGLE_AROMATIC = 6,
62 DOUBLE_AROMATIC = 7,
63 ANY_BOND = 8,
64 ALL_BOND_TYPES = 0xF
65 };
66
67 enum AATopology {
68 TP_NONE = 0, // Don't care
69 RING = 1, // Ring
70 CHAIN = 2 // Chain
71 };
72
73 struct Ligand {
74 std::string AtomSymbol;
75 int Charge;
76 RadicalType Radical;
77 unsigned SubstitutionCount; // substitution count 0 = don't care
78 AABondType BondType;
79 Ligand()
80 : Charge(ANY_CHARGE),
81 Radical(ANY_RADICAL),
82 SubstitutionCount(0),
83 BondType(ANY_BOND) {}
84 };
85
86 struct AugmentedAtom {
87 std::string AtomSymbol;
88 std::string ShortName;
89 int Charge;
90 RadicalType Radical;
91 AATopology Topology;
92 std::vector<Ligand> Ligands;
93
94 AugmentedAtom()
95 : Charge(ANY_CHARGE), Radical(ANY_RADICAL), Topology(TP_NONE) {}
96
97 AugmentedAtom(const std::string &symbol, const std::string &name, int charge,
98 RadicalType radical, AATopology topology)
99 : AtomSymbol(symbol),
100 ShortName(name),
101 Charge(charge),
102 Radical(radical),
103 Topology(topology) {}
104 };
105
106 struct IncEntry {
107 std::string AtomSymbol;
108 double LocalInc;
109 double AlphaInc;
110 double BetaInc;
111 double MultInc;
112
113 // Used for logging
114 int local_inc_used;
115 int alpha_inc_used;
116 int beta_inc_used;
117 int mult_inc_used;
118 };
119
120 struct PathEntry {
121 AugmentedAtom Path;
122 double Cond;
123 // Used for logging
124 int cond_used;
125 };
126 }
127 }
128 #endif
RDKit::StructureCheck::AugmentedAtom::Ligands
std::vector< Ligand > Ligands
Definition: StructChecker_details.h:92
RDKit::StructureCheck::BT_NONE
Definition: StructChecker_details.h:55
RDKit::StructureCheck::IncEntry::AtomSymbol
std::string AtomSymbol
Definition: StructChecker_details.h:107
RDKit::StructureCheck::RadicalType
RadicalType
Definition: StructChecker_details.h:46
RDKit::StructureCheck::DOUBLE
Definition: StructChecker_details.h:57
RDKit::StructureCheck::DOUBLE_AROMATIC
Definition: StructChecker_details.h:62
RDKit::StructureCheck::Ligand
Definition: StructChecker_details.h:73
RDKit::StructureCheck::AugmentedAtom::ShortName
std::string ShortName
Definition: StructChecker_details.h:88
RDKit::StructureCheck::TP_NONE
Definition: StructChecker_details.h:68
RDKit::StructureCheck::IncEntry::AlphaInc
double AlphaInc
Definition: StructChecker_details.h:109
RDKit::StructureCheck::SINGLE_AROMATIC
Definition: StructChecker_details.h:61
RDKit::StructureCheck::IncEntry
Definition: StructChecker_details.h:106
RDKit::StructureCheck::CHAIN
Definition: StructChecker_details.h:70
RDKit::StructureCheck::ANY_RADICAL
Definition: StructChecker_details.h:51
RDKit::StructureCheck::TRIPLE
Definition: StructChecker_details.h:58
RDKit::StructureCheck::Ligand::Radical
RadicalType Radical
Definition: StructChecker_details.h:76
RDKit::StructureCheck::SINGLET
Definition: StructChecker_details.h:48
RDKit::StructureCheck::AugmentedAtom::AugmentedAtom
AugmentedAtom(const std::string &symbol, const std::string &name, int charge, RadicalType radical, AATopology topology)
Definition: StructChecker_details.h:97
RDKit::StructureCheck::PathEntry::Cond
double Cond
Definition: StructChecker_details.h:122
RDKit::StructureCheck::Ligand::SubstitutionCount
unsigned SubstitutionCount
Definition: StructChecker_details.h:77
RDKit::StructureCheck::AugmentedAtom::Topology
AATopology Topology
Definition: StructChecker_details.h:91
RDKit::StructureCheck::IncEntry::BetaInc
double BetaInc
Definition: StructChecker_details.h:110
RDKit::StructureCheck::SINGLE
Definition: StructChecker_details.h:56
RDKit::StructureCheck::AROMATIC
Definition: StructChecker_details.h:59
RDKit::StructureCheck::AugmentedAtom::AugmentedAtom
AugmentedAtom()
Definition: StructChecker_details.h:94
RDKit::StructureCheck::SINGLE_DOUBLE
Definition: StructChecker_details.h:60
RDKit::StructureCheck::PathEntry::cond_used
int cond_used
Definition: StructChecker_details.h:124
RDKit::StructureCheck::RT_NONE
Definition: StructChecker_details.h:47
RDKit::StructureCheck::Ligand::Ligand
Ligand()
Definition: StructChecker_details.h:79
RDKit::StructureCheck::IncEntry::MultInc
double MultInc
Definition: StructChecker_details.h:111
RDKit::StructureCheck::AugmentedAtom
Definition: StructChecker_details.h:86
RDKit::StructureCheck::ANY_CHARGE
static const int ANY_CHARGE
Definition: StructChecker_details.h:45
RDKit
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
RDKit::StructureCheck::IncEntry::local_inc_used
int local_inc_used
Definition: StructChecker_details.h:114
RDKit::StructureCheck::ANY_BOND
Definition: StructChecker_details.h:63
RDKit::StructureCheck::AABondType
AABondType
Definition: StructChecker_details.h:54
RDKit::StructureCheck::AugmentedAtom::AtomSymbol
std::string AtomSymbol
Definition: StructChecker_details.h:87
RDKit::StructureCheck::PathEntry
Definition: StructChecker_details.h:120
RDKit::StructureCheck::Ligand::AtomSymbol
std::string AtomSymbol
Definition: StructChecker_details.h:74
RDKit::StructureCheck::AugmentedAtom::Charge
int Charge
Definition: StructChecker_details.h:89
RDKit::StructureCheck::IncEntry::LocalInc
double LocalInc
Definition: StructChecker_details.h:108
RDKit::StructureCheck::DOUBLET
Definition: StructChecker_details.h:49
RDKit::StructureCheck::IncEntry::beta_inc_used
int beta_inc_used
Definition: StructChecker_details.h:116
RDKit::StructureCheck::IncEntry::alpha_inc_used
int alpha_inc_used
Definition: StructChecker_details.h:115
RDKit::StructureCheck::Ligand::BondType
AABondType BondType
Definition: StructChecker_details.h:78
RDKit::StructureCheck::PathEntry::Path
AugmentedAtom Path
Definition: StructChecker_details.h:121
RDKit::StructureCheck::AATopology
AATopology
Definition: StructChecker_details.h:67
RDKit::StructureCheck::Ligand::Charge
int Charge
Definition: StructChecker_details.h:75
RDKit::StructureCheck::AugmentedAtom::Radical
RadicalType Radical
Definition: StructChecker_details.h:90
RDKit::StructureCheck::TRIPLET
Definition: StructChecker_details.h:50
RDKit::StructureCheck::ALL_BOND_TYPES
Definition: StructChecker_details.h:64
RDKit::StructureCheck::IncEntry::mult_inc_used
int mult_inc_used
Definition: StructChecker_details.h:117
RDKit::StructureCheck::RING
Definition: StructChecker_details.h:69