rdkit_chem 2019.03.3.1 → 2025.09.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/CMakeLists.txt +713 -0
  3. data/Code/CMakeLists.txt +44 -0
  4. data/Code/RubyWrappers/Abbreviations.i +19 -0
  5. data/Code/RubyWrappers/AddHs.i +34 -0
  6. data/Code/RubyWrappers/Atom.i +165 -0
  7. data/Code/RubyWrappers/AtomIterators.i +77 -0
  8. data/Code/RubyWrappers/AtomPairs.i +95 -0
  9. data/Code/RubyWrappers/AvalonLib.i +41 -0
  10. data/Code/RubyWrappers/BitOps.i +72 -0
  11. data/Code/RubyWrappers/Bond.i +87 -0
  12. data/Code/RubyWrappers/BondIterators.i +61 -0
  13. data/Code/RubyWrappers/CMakeLists.txt +67 -0
  14. data/Code/RubyWrappers/Canon.i +40 -0
  15. data/Code/RubyWrappers/ChemDraw.i +81 -0
  16. data/Code/RubyWrappers/ChemReactions.i +166 -0
  17. data/Code/RubyWrappers/ChemTransforms.i +126 -0
  18. data/Code/RubyWrappers/Conformer.i +69 -0
  19. data/Code/RubyWrappers/Descriptors.i +64 -0
  20. data/Code/RubyWrappers/Dict.i +45 -0
  21. data/Code/RubyWrappers/DistGeom.i +217 -0
  22. data/Code/RubyWrappers/DiversityPick.h +49 -0
  23. data/Code/RubyWrappers/DiversityPick.i +10 -0
  24. data/Code/RubyWrappers/ErrorGenerator.i +73 -0
  25. data/Code/RubyWrappers/ExplicitBitVect.i +76 -0
  26. data/Code/RubyWrappers/FMCS.i +63 -0
  27. data/Code/RubyWrappers/FilterCatalog.i +154 -0
  28. data/Code/RubyWrappers/Fingerprints.i +56 -0
  29. data/Code/RubyWrappers/ForceField.i +161 -0
  30. data/Code/RubyWrappers/GeneralizedSubstruct.i +38 -0
  31. data/Code/RubyWrappers/GenericRDKitException.h +27 -0
  32. data/Code/RubyWrappers/Inchi.i +38 -0
  33. data/Code/RubyWrappers/MolBundle.i +16 -0
  34. data/Code/RubyWrappers/MolDraw2D.i +117 -0
  35. data/Code/RubyWrappers/MolEnumerator.i +45 -0
  36. data/Code/RubyWrappers/MolHash.i +25 -0
  37. data/Code/RubyWrappers/MolOps.i +72 -0
  38. data/Code/RubyWrappers/MolStandardize.i +37 -0
  39. data/Code/RubyWrappers/MolSupplier.i +83 -0
  40. data/Code/RubyWrappers/MolTransforms.i +39 -0
  41. data/Code/RubyWrappers/MolWriters.i +41 -0
  42. data/Code/RubyWrappers/MonomerInfo.i +42 -0
  43. data/Code/RubyWrappers/MorganFingerprints.h +21 -0
  44. data/Code/RubyWrappers/MorganFingerprints.i +66 -0
  45. data/Code/RubyWrappers/PeriodicTable.i +44 -0
  46. data/Code/RubyWrappers/Queries.i +289 -0
  47. data/Code/RubyWrappers/QueryAtom.i +47 -0
  48. data/Code/RubyWrappers/QueryBond.i +47 -0
  49. data/Code/RubyWrappers/QueryOps.i +44 -0
  50. data/Code/RubyWrappers/RDKitExceptions.i +75 -0
  51. data/Code/RubyWrappers/RDLogger.i +74 -0
  52. data/Code/RubyWrappers/RDProps.i +44 -0
  53. data/Code/RubyWrappers/RGroupDecomposition.i +52 -0
  54. data/Code/RubyWrappers/ROMol.i +695 -0
  55. data/Code/RubyWrappers/RWMol.i +241 -0
  56. data/Code/RubyWrappers/RascalMCES.i +71 -0
  57. data/Code/RubyWrappers/ReactionFingerprints.i +37 -0
  58. data/Code/RubyWrappers/RingInfo.i +40 -0
  59. data/Code/RubyWrappers/Rings.i +40 -0
  60. data/Code/RubyWrappers/SanitException.i +100 -0
  61. data/Code/RubyWrappers/ScaffoldNetwork.i +28 -0
  62. data/Code/RubyWrappers/SmartsWrite.i +38 -0
  63. data/Code/RubyWrappers/SmilesParse.i +40 -0
  64. data/Code/RubyWrappers/SmilesWrite.i +42 -0
  65. data/Code/RubyWrappers/StereoGroup.i +16 -0
  66. data/Code/RubyWrappers/Streams.i +67 -0
  67. data/Code/RubyWrappers/Subgraphs.i +53 -0
  68. data/Code/RubyWrappers/Subset.i +75 -0
  69. data/Code/RubyWrappers/SubstanceGroup.i +91 -0
  70. data/Code/RubyWrappers/SubstructLibrary.i +80 -0
  71. data/Code/RubyWrappers/TautomerQuery.i +19 -0
  72. data/Code/RubyWrappers/Trajectory.i +34 -0
  73. data/Code/RubyWrappers/boost_tuple.i +64 -0
  74. data/Code/RubyWrappers/extend_std_vector.i +10 -0
  75. data/Code/RubyWrappers/gmwrapper/CMakeLists.txt +69 -0
  76. data/Code/RubyWrappers/gmwrapper/GraphMolRuby.i +431 -0
  77. data/Code/RubyWrappers/gmwrapper/std_list.i +65 -0
  78. data/Code/RubyWrappers/point.i +56 -0
  79. data/Code/RubyWrappers/transforms.i +60 -0
  80. data/Code/RubyWrappers/types.i +40 -0
  81. data/README.md +24 -0
  82. data/Rakefile +165 -4
  83. data/ext/rdkit_chem/CMakeLists.txt +69 -0
  84. data/ext/rdkit_chem/Makefile +5 -0
  85. data/ext/rdkit_chem/extconf.rb +47 -17
  86. data/lib/rdkit_chem/version.rb +2 -2
  87. data/lib/rdkit_chem.rb +31 -1
  88. data/test/test_rdkit_chem.rb +38 -10
  89. metadata +119 -13
@@ -0,0 +1,241 @@
1
+ /*
2
+ * $Id$
3
+ *
4
+ * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are
9
+ * met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright
12
+ * notice, this list of conditions and the following disclaimer.
13
+ * * Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials provided
16
+ * with the distribution.
17
+ * * Neither the name of Novartis Institutes for BioMedical Research Inc.
18
+ * nor the names of its contributors may be used to endorse or promote
19
+ * products derived from this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ %{
35
+ #include <GraphMol/RWMol.h>
36
+ #include <GraphMol/SmilesParse/SmilesParse.h>
37
+ #include <GraphMol/SmilesParse/SmilesWrite.h>
38
+ #include <GraphMol/FileParsers/FileParsers.h>
39
+ #include <GraphMol/FileParsers/CDXMLParser.h>
40
+ #include <GraphMol/FileParsers/SequenceParsers.h>
41
+ #include <GraphMol/Bond.h>
42
+ #include <GraphMol/FileParsers/MolFileStereochem.h>
43
+ %}
44
+
45
+ %template(RWMol_Vect) std::vector< boost::shared_ptr<RDKit::RWMol> >;
46
+
47
+ // ignore the methods that allow the molecule to take ownership of atoms/Bonds
48
+ // (instead of copying them). This just leads to memory problems with Ruby
49
+ %ignore RDKit::RWMol::addAtom(Atom *atom,bool updateLabel,bool takeOwnership);
50
+ %ignore RDKit::RWMol::addBond(Bond *bond,bool takeOwnership);
51
+
52
+ %newobject RDKit::v1::SmilesToMol;
53
+ %newobject RDKit::v1::SmartsToMol;
54
+ %newobject RDKit::v1::MolBlockToMol;
55
+ %newobject RDKit::v1::MolFileToMol;
56
+
57
+ %shared_ptr(RDKit::RWMol)
58
+
59
+ %ignore RDKit::v2::SmilesParse;
60
+
61
+ %ignore RDKit::v1::CDXMLDataStreamToMols;
62
+ %ignore RDKit::v1::CDXMLFileToMols;
63
+ %ignore RDKit::v1::CDXMLToMols;
64
+
65
+ %ignore RDKit::v2::CDXMLParser::MolsFromCDXMLDataStream;
66
+ %ignore RDKit::v2::CDXMLParser::MolsFromCDXML;
67
+ %ignore RDKit::v2::CDXMLParser::MolsFromCDXMLFile;
68
+ %ignore *::MolsFromCDXMLDataStream;
69
+
70
+ // Ignore strip utility function to avoid conflict with MolHash::Strip
71
+ %ignore RDKit::strip;
72
+
73
+ %include <GraphMol/FileParsers/FileParsers.h>
74
+ %include <GraphMol/FileParsers/CDXMLParser.h>
75
+ %include <GraphMol/SmilesParse/SmilesParse.h>
76
+
77
+
78
+ %include <GraphMol/RWMol.h>
79
+
80
+ %extend RDKit::RWMol {
81
+ static RDKit::RWMOL_SPTR MolFromSmiles(const std::string &smi,int debugParse=0,bool sanitize=1,
82
+ std::map<std::string,std::string> *replacements=0){
83
+ return RDKit::RWMOL_SPTR(RDKit::SmilesToMol(smi, debugParse, sanitize,replacements));
84
+ }
85
+ static RDKit::RWMOL_SPTR MolFromSmiles(const std::string &smi, const RDKit::v1::SmilesParserParams &params){
86
+ return RDKit::RWMOL_SPTR(RDKit::SmilesToMol(smi, params));
87
+ }
88
+ static RDKit::RWMOL_SPTR MolFromSmarts(const std::string &sma,int debugParse=0,bool mergeHs=false,
89
+ std::map<std::string,std::string> *replacements=0){
90
+ return RDKit::RWMOL_SPTR(RDKit::SmartsToMol(sma, debugParse, mergeHs,replacements));
91
+ }
92
+ static RDKit::RWMOL_SPTR MolFromMolBlock(const std::string &molB,
93
+ bool sanitize=true,bool removeHs=true,bool strictParsing=true){
94
+ RDKit::RWMol *mol=RDKit::MolBlockToMol(molB,sanitize,removeHs,strictParsing);
95
+ return RDKit::RWMOL_SPTR(mol);
96
+ }
97
+ static RDKit::RWMOL_SPTR MolFromMolFile(const std::string &filename,
98
+ bool sanitize=true,bool removeHs=true,bool strictParsing=true){
99
+ RDKit::RWMol *mol=RDKit::MolFileToMol(filename,sanitize,removeHs,strictParsing);
100
+ return RDKit::RWMOL_SPTR(mol);
101
+ }
102
+ static RDKit::RWMOL_SPTR MolFromTPLFile(const std::string &fName,bool sanitize=true,
103
+ bool skipFirstConf=false) {
104
+ RDKit::RWMol *mol=0;
105
+ mol=RDKit::TPLFileToMol(fName, sanitize, skipFirstConf);
106
+ return RDKit::RWMOL_SPTR(mol);
107
+ }
108
+ static RDKit::RWMOL_SPTR MolFromMol2File(const std::string &fName,bool sanitize=true,bool removeHs=true,
109
+ RDKit::Mol2Type variant=RDKit::Mol2Type::CORINA, bool cleanupSubstructures=true) {
110
+ RDKit::RWMol *mol=0;
111
+ mol=RDKit::Mol2FileToMol(fName, sanitize, removeHs, variant, cleanupSubstructures);
112
+ return RDKit::RWMOL_SPTR(mol);
113
+ }
114
+ static RDKit::RWMOL_SPTR MolFromMol2Block(const std::string &molBlock,bool sanitize=true,bool removeHs=true,
115
+ RDKit::Mol2Type variant=RDKit::Mol2Type::CORINA, bool cleanupSubstructures=true) {
116
+ RDKit::RWMol *mol=0;
117
+ mol=RDKit::Mol2BlockToMol(molBlock, sanitize, removeHs, variant, cleanupSubstructures);
118
+ return RDKit::RWMOL_SPTR(mol);
119
+ }
120
+
121
+ static RDKit::RWMOL_SPTR MolFromPDBBlock(const std::string &molB,
122
+ bool sanitize=true,bool removeHs=true,
123
+ unsigned int flavor=0,bool proximityBonding=true){
124
+ RDKit::RWMol *mol=0;
125
+ mol=RDKit::PDBBlockToMol(molB,sanitize,removeHs,flavor,proximityBonding);
126
+ return RDKit::RWMOL_SPTR(mol);
127
+ }
128
+
129
+ static RDKit::RWMOL_SPTR MolFromPDBFile(const std::string &fName,
130
+ bool sanitize=true,bool removeHs=true,
131
+ unsigned int flavor=0,bool proximityBonding=true){
132
+ RDKit::RWMol *mol=0;
133
+ mol=RDKit::PDBFileToMol(fName,sanitize,removeHs,flavor,proximityBonding);
134
+ return RDKit::RWMOL_SPTR(mol);
135
+ }
136
+ static RDKit::RWMOL_SPTR MolFromSequence(const std::string &text,
137
+ bool sanitize=true,int flavor=0){
138
+ RDKit::RWMol *mol=0;
139
+ mol=RDKit::SequenceToMol(text,sanitize,flavor);
140
+ return RDKit::RWMOL_SPTR(mol);
141
+ }
142
+ static RDKit::RWMOL_SPTR MolFromFASTA(const std::string &text,
143
+ bool sanitize=true,int flavor=0){
144
+ RDKit::RWMol *mol=0;
145
+ mol=RDKit::FASTAToMol(text,sanitize,flavor);
146
+ return RDKit::RWMOL_SPTR(mol);
147
+ }
148
+ static RDKit::RWMOL_SPTR MolFromHELM(const std::string &text,
149
+ bool sanitize=true){
150
+ RDKit::RWMol *mol=0;
151
+ mol=RDKit::HELMToMol(text,sanitize);
152
+ return RDKit::RWMOL_SPTR(mol);
153
+ }
154
+
155
+ static std::vector<RDKit::RWMOL_SPTR> MolsFromCDXML(const std::string &text,
156
+ bool sanitize=true, bool removeHs=true){
157
+ auto res = RDKit::CDXMLToMols(text, sanitize, removeHs);
158
+ std::vector<RDKit::RWMOL_SPTR> mols;
159
+ for(auto &mol: res) {
160
+ mols.emplace_back(mol.release());
161
+ }
162
+ return mols;
163
+
164
+ }
165
+
166
+ static std::vector<RDKit::RWMOL_SPTR> MolsFromCDXML(
167
+ const std::vector<unsigned char> &text, bool sanitize=true, bool removeHs=true) {
168
+ std::string str(text.begin(), text.end());
169
+ RDKit::v2::CDXMLParser::CDXMLParserParams params;
170
+ params.sanitize=sanitize;
171
+ params.removeHs=removeHs;
172
+ auto res = RDKit::v2::CDXMLParser::MolsFromCDXML(str, params);
173
+ std::vector<RDKit::RWMOL_SPTR> mols;
174
+ for(auto &mol: res) {
175
+ mols.emplace_back(mol.release());
176
+ }
177
+ return mols;
178
+ }
179
+
180
+ static std::vector<RDKit::RWMOL_SPTR> MolsFromCDXML(
181
+ const std::string &text,
182
+ const RDKit::v2::CDXMLParser::CDXMLParserParams &params=RDKit::v2::CDXMLParser::CDXMLParserParams()) {
183
+ auto res = RDKit::v2::CDXMLParser::MolsFromCDXML(text, params);
184
+ std::vector<RDKit::RWMOL_SPTR> mols;
185
+ for(auto &mol: res) {
186
+ mols.emplace_back(mol.release());
187
+ }
188
+ return mols;
189
+
190
+ }
191
+
192
+ static std::vector<RDKit::RWMOL_SPTR> MolsFromCDXMLFile(
193
+ const std::string &filename,
194
+ const RDKit::v2::CDXMLParser::CDXMLParserParams &params=RDKit::v2::CDXMLParser::CDXMLParserParams()) {
195
+ auto res = RDKit::v2::CDXMLParser::MolsFromCDXMLFile(filename, params);
196
+ std::vector<RDKit::RWMOL_SPTR> mols;
197
+ for(auto &mol: res) {
198
+ mols.emplace_back(mol.release());
199
+ }
200
+ return mols;
201
+ }
202
+
203
+ static RDKit::ROMOL_SPTR toROMol(RDKit::RWMOL_SPTR target) {
204
+ return RDKit::ROMOL_SPTR(target);
205
+ }
206
+
207
+ /* Methods from MolFileStereoChem.h */
208
+ void DetectAtomStereoChemistry(const RDKit::Conformer *conf) {
209
+ RDKit::DetectAtomStereoChemistry(*($self), conf);
210
+ }
211
+ void DetectBondStereoChemistry(const RDKit::Conformer *conf) {
212
+ RDKit::DetectBondStereoChemistry(*($self), conf);
213
+ }
214
+ void ClearSingleBondDirFlags(bool onlyWedgeFlags=false) {
215
+ RDKit::MolOps::clearSingleBondDirFlags(*($self), onlyWedgeFlags);
216
+ };
217
+ void reapplyMolBlockWedging() {
218
+ RDKit::Chirality::reapplyMolBlockWedging(*($self));
219
+ }
220
+ void clearMolBlockWedgingInfo() {
221
+ RDKit::Chirality::clearMolBlockWedgingInfo(*($self));
222
+ }
223
+ void invertMolBlockWedgingInfo() {
224
+ RDKit::Chirality::invertMolBlockWedgingInfo(*($self));
225
+ }
226
+ void markUnspecifiedStereoAsUnknown(int confId) {
227
+ RDKit::markUnspecifiedStereoAsUnknown(*($self), confId);
228
+ }
229
+
230
+ /* From Kekulize.cpp, MolOps.h */
231
+ void Kekulize(bool markAtomsBonds=true, unsigned int maxBackTracks=100) {
232
+ RDKit::MolOps::Kekulize(*($self), markAtomsBonds, maxBackTracks);
233
+ }
234
+
235
+ /* MolOps.h */
236
+ // Renamed to sanitize() to avoid conflict with standalone sanitizeMol in MolOps.i
237
+ void sanitize() {
238
+ RDKit::MolOps::sanitizeMol(*($self));
239
+ }
240
+
241
+ }
@@ -0,0 +1,71 @@
1
+ /*
2
+ *
3
+ * Copyright (C) 2020 Gareth Jones, Glysade LLC
4
+ *
5
+ * @@ All Rights Reserved @@
6
+ * This file is part of the RDKit.
7
+ * The contents are covered by the terms of the BSD license
8
+ * which is included in the file license.txt, found at the root
9
+ * of the RDKit source tree.
10
+ *
11
+ */
12
+
13
+ %include "std_vector.i"
14
+
15
+ %{
16
+ #include <GraphMol/RascalMCES/RascalClusterOptions.h>
17
+ #include <GraphMol/RascalMCES/RascalOptions.h>
18
+ #include <GraphMol/RascalMCES/RascalResult.h>
19
+ #include <GraphMol/RascalMCES/RascalMCES.h>
20
+ %}
21
+
22
+
23
+
24
+ %include <GraphMol/RascalMCES/RascalClusterOptions.h>
25
+ %include <GraphMol/RascalMCES/RascalOptions.h>
26
+ %ignore RDKit::RascalMCES::RascalResult::getMcesMol;
27
+ %include <GraphMol/RascalMCES/RascalResult.h>
28
+ %ignore RDKit::RascalMCES::rascalCluster;
29
+ %ignore RDKit::RascalMCES::rascalButinaCluster;
30
+ %include <GraphMol/RascalMCES/RascalMCES.h>
31
+ // RascalResult_Vect removed - RascalResult lacks default constructor required by std::vector operations
32
+ // %ignore std::vector<RDKit::RascalMCES::RascalResult>::equals;
33
+ // %ignore std::vector<RDKit::RascalMCES::RascalResult>::vector(size_type);
34
+ // %template(RascalResult_Vect) std::vector<RDKit::RascalMCES::RascalResult>;
35
+ %template(Unsigned_Vect_Vect) std::vector<std::vector<unsigned int>>;
36
+
37
+ // The Rascal code uses std::shared_ptr rather than boost::shared_ptr
38
+
39
+ %extend RDKit::RascalMCES::RascalResult {
40
+ RDKit::ROMol *getMCESMol() {
41
+ auto shared_ptr = ($self)->getMcesMol();
42
+ return shared_ptr.get();
43
+ }
44
+ }
45
+
46
+ %inline %{
47
+ namespace RDKit {
48
+ namespace RascalMCES {
49
+ class RascalApp {
50
+ };
51
+ }
52
+ }
53
+ %}
54
+
55
+
56
+ %extend RDKit::RascalMCES::RascalApp {
57
+ static std::vector<std::vector<unsigned int> > RascalCluster(const std::vector<boost::shared_ptr<RDKit::ROMol> >& mols, const RDKit::RascalMCES::RascalClusterOptions& clusterOptions=RascalClusterOptions()) {
58
+ std::vector<std::shared_ptr<RDKit::ROMol> > rascalMolecules;
59
+ for (auto molIn: mols) {
60
+ rascalMolecules.emplace_back(new RDKit::ROMol(*molIn));
61
+ }
62
+ return RDKit::RascalMCES::rascalCluster(rascalMolecules, clusterOptions);
63
+ }
64
+ static std::vector<std::vector<unsigned int> > RascalButinaCluster(const std::vector<boost::shared_ptr<RDKit::ROMol> >& mols, const RDKit::RascalMCES::RascalClusterOptions& clusterOptions=RascalClusterOptions()) {
65
+ std::vector<std::shared_ptr<RDKit::ROMol> > rascalMolecules;
66
+ for (auto molIn: mols) {
67
+ rascalMolecules.emplace_back(new RDKit::ROMol(*molIn));
68
+ }
69
+ return RDKit::RascalMCES::rascalButinaCluster(rascalMolecules, clusterOptions);
70
+ }
71
+ }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright (c) 2018 Greg Landrum
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are
7
+ * met:
8
+ *
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above
12
+ * copyright notice, this list of conditions and the following
13
+ * disclaimer in the documentation and/or other materials provided
14
+ * with the distribution.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ %{
30
+ #include <DataStructs/ExplicitBitVect.h>
31
+ #include <DataStructs/BitOps.h>
32
+ #include <GraphMol/ChemReactions/ReactionFingerprints.h>
33
+ %}
34
+
35
+ %newobject RDKit::StructuralFingerprintChemReaction;
36
+ %newobject RDKit::DifferenceFingerprintChemReaction;
37
+ %include <GraphMol/ChemReactions/ReactionFingerprints.h>
@@ -0,0 +1,40 @@
1
+ /*
2
+ * $Id$
3
+ *
4
+ * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are
9
+ * met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright
12
+ * notice, this list of conditions and the following disclaimer.
13
+ * * Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials provided
16
+ * with the distribution.
17
+ * * Neither the name of Novartis Institutes for BioMedical Research Inc.
18
+ * nor the names of its contributors may be used to endorse or promote
19
+ * products derived from this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ %{
35
+ #include <map>
36
+ #include <vector>
37
+ #include <GraphMol/RingInfo.h>
38
+ %}
39
+
40
+ %include <GraphMol/RingInfo.h>
@@ -0,0 +1,40 @@
1
+ /*
2
+ * $Id$
3
+ *
4
+ * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are
9
+ * met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright
12
+ * notice, this list of conditions and the following disclaimer.
13
+ * * Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials provided
16
+ * with the distribution.
17
+ * * Neither the name of Novartis Institutes for BioMedical Research Inc.
18
+ * nor the names of its contributors may be used to endorse or promote
19
+ * products derived from this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ %{
35
+ #include <GraphMol/Rings.h>
36
+ %}
37
+
38
+ %template(Int_Int_Vect_Map) std::map< int, std::vector<int> > ;
39
+
40
+ %include <GraphMol/Rings.h>
@@ -0,0 +1,100 @@
1
+ /*
2
+ * $Id$
3
+ *
4
+ * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are
9
+ * met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright
12
+ * notice, this list of conditions and the following disclaimer.
13
+ * * Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials provided
16
+ * with the distribution.
17
+ * * Neither the name of Novartis Institutes for BioMedical Research Inc.
18
+ * nor the names of its contributors may be used to endorse or promote
19
+ * products derived from this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ %{
35
+ #include <GraphMol/SanitException.h>
36
+ %}
37
+
38
+ %include <GraphMol/SanitException.h>
39
+ /* #ifdef SWIGRUBY */
40
+
41
+ // support upcasting from MolSanitizeException to the other exception types so that
42
+ // we can do something with the output of detectChemistryProblems()
43
+
44
+ %exception RDKit::AtomSanitizeException::dynamic_cast(RDKit::MolSanitizeException) {
45
+ $action
46
+ if(!result) {
47
+ static VALUE cpperror = rb_define_class("CPPError", rb_eRuntimeError);
48
+ rb_raise(cpperror, "dynamic_cast exception")
49
+ }
50
+ }
51
+
52
+ %extend RDKit::AtomSanitizeException {
53
+ static RDKit::AtomSanitizeException *dynamic_cast(RDKit::MolSanitizeException *mse){
54
+ return dynamic_cast<RDKit::AtomSanitizeException *>(mse);
55
+ }
56
+ };
57
+
58
+ %exception RDKit::AtomValenceException::dynamic_cast(RDKit::MolSanitizeException) {
59
+ $action
60
+ if(!result) {
61
+ static VALUE cpperror = rb_define_class("CPPError", rb_eRuntimeError);
62
+ rb_raise(cpperror, "dynamic_cast exception")
63
+ }
64
+ }
65
+
66
+ %extend RDKit::AtomValenceException {
67
+ static RDKit::AtomValenceException *dynamic_cast(RDKit::MolSanitizeException *mse){
68
+ return dynamic_cast<RDKit::AtomValenceException *>(mse);
69
+ }
70
+ };
71
+
72
+
73
+ %exception RDKit::AtomKekulizeException::dynamic_cast(RDKit::MolSanitizeException) {
74
+ $action
75
+ if(!result) {
76
+ static VALUE cpperror = rb_define_class("CPPError", rb_eRuntimeError);
77
+ rb_raise(cpperror, "dynamic_cast exception")
78
+ }
79
+ }
80
+
81
+ %extend RDKit::AtomKekulizeException {
82
+ static RDKit::AtomKekulizeException *dynamic_cast(RDKit::MolSanitizeException *mse){
83
+ return dynamic_cast<RDKit::AtomKekulizeException *>(mse);
84
+ }
85
+ };
86
+
87
+ %exception RDKit::KekulizeException::dynamic_cast(RDKit::MolSanitizeException) {
88
+ $action
89
+ if(!result) {
90
+ static VALUE cpperror = rb_define_class("CPPError", rb_eRuntimeError);
91
+ rb_raise(cpperror, "dynamic_cast exception")
92
+ }
93
+ }
94
+
95
+ %extend RDKit::KekulizeException {
96
+ static RDKit::KekulizeException *dynamic_cast(RDKit::MolSanitizeException *mse){
97
+ return dynamic_cast<RDKit::KekulizeException *>(mse);
98
+ }
99
+ };
100
+ /* #endif */
@@ -0,0 +1,28 @@
1
+ /*
2
+ *
3
+ * Copyright (c) 2019, Greg Landrum and T5 Informatics GmbH
4
+ * All rights reserved.
5
+ *
6
+ * This file is part of the RDKit.
7
+ * The contents are covered by the terms of the BSD license
8
+ * which is included in the file license.txt, found at the root
9
+ * of the RDKit source tree.
10
+ *
11
+ */
12
+ %{
13
+ #include <GraphMol/ScaffoldNetwork/ScaffoldNetwork.h>
14
+ typedef std::vector<std::string> STR_VECT;
15
+ typedef std::vector<unsigned> UINT_VECT;
16
+ %}
17
+
18
+
19
+ %template(ROMol_Vect) std::vector<boost::shared_ptr<RDKit::ROMol>>;
20
+ %template(NetworkEdge_Vect) std::vector<RDKit::ScaffoldNetwork::NetworkEdge>;
21
+ %include <GraphMol/ScaffoldNetwork/ScaffoldNetwork.h>
22
+ %template(createScaffoldNetwork) RDKit::ScaffoldNetwork::createScaffoldNetwork<std::vector<boost::shared_ptr<RDKit::ROMol>>>;
23
+
24
+ %extend RDKit::ScaffoldNetwork::ScaffoldNetwork {
25
+ unsigned int nodeCount(unsigned int nodeNumber) {
26
+ return $self->counts.at(nodeNumber);
27
+ }
28
+ }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * $Id$
3
+ *
4
+ * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are
9
+ * met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright
12
+ * notice, this list of conditions and the following disclaimer.
13
+ * * Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials provided
16
+ * with the distribution.
17
+ * * Neither the name of Novartis Institutes for BioMedical Research Inc.
18
+ * nor the names of its contributors may be used to endorse or promote
19
+ * products derived from this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ %{
35
+ #include <GraphMol/SmilesParse/SmartsWrite.h>
36
+ %}
37
+
38
+ %include <GraphMol/SmilesParse/SmartsWrite.h>
@@ -0,0 +1,40 @@
1
+ /*
2
+ * $Id$
3
+ *
4
+ * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are
9
+ * met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright
12
+ * notice, this list of conditions and the following disclaimer.
13
+ * * Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials provided
16
+ * with the distribution.
17
+ * * Neither the name of Novartis Institutes for BioMedical Research Inc.
18
+ * nor the names of its contributors may be used to endorse or promote
19
+ * products derived from this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ %{
35
+ #include <GraphMol/SmilesParse/SmilesParse.h>
36
+ %}
37
+ %ignore RDKit::v2;
38
+ %ignore SmilesToMol;
39
+ %ignore SmartsToMol;
40
+ %include <GraphMol/SmilesParse/SmilesParse.h>
@@ -0,0 +1,42 @@
1
+ /*
2
+ * $Id$
3
+ *
4
+ * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are
9
+ * met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright
12
+ * notice, this list of conditions and the following disclaimer.
13
+ * * Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials provided
16
+ * with the distribution.
17
+ * * Neither the name of Novartis Institutes for BioMedical Research Inc.
18
+ * nor the names of its contributors may be used to endorse or promote
19
+ * products derived from this software without specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ %{
35
+ #include <GraphMol/SmilesParse/SmilesWrite.h>
36
+ #include <GraphMol/SmilesParse/SmilesJSONParsers.h>
37
+ %}
38
+
39
+ %include <RDGeneral/BetterEnums.h>
40
+ %ignore RDKit::SmilesWrite::detail::MolToSmiles;
41
+ %include <GraphMol/SmilesParse/SmilesWrite.h>
42
+ %include <GraphMol/SmilesParse/SmilesJSONParsers.h>