RDKit
Open-source cheminformatics and machine learning.
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;
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,
63  ANY_BOND = 8,
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;
77  unsigned SubstitutionCount; // substitution count 0 = don't care
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;
92  std::vector<Ligand> Ligands;
93 
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
118 };
119 
120 struct PathEntry {
122  double Cond;
123  // Used for logging
125 };
126 }
127 }
128 #endif
AugmentedAtom(const std::string &symbol, const std::string &name, int charge, RadicalType radical, AATopology topology)
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28