rdkit_chem 2019.03.3.1 → 2025.09.3.1
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.
- checksums.yaml +4 -4
- data/CMakeLists.txt +713 -0
- data/Code/CMakeLists.txt +44 -0
- data/Code/RubyWrappers/Abbreviations.i +19 -0
- data/Code/RubyWrappers/AddHs.i +34 -0
- data/Code/RubyWrappers/Atom.i +165 -0
- data/Code/RubyWrappers/AtomIterators.i +77 -0
- data/Code/RubyWrappers/AtomPairs.i +95 -0
- data/Code/RubyWrappers/AvalonLib.i +41 -0
- data/Code/RubyWrappers/BitOps.i +72 -0
- data/Code/RubyWrappers/Bond.i +87 -0
- data/Code/RubyWrappers/BondIterators.i +61 -0
- data/Code/RubyWrappers/CMakeLists.txt +67 -0
- data/Code/RubyWrappers/Canon.i +40 -0
- data/Code/RubyWrappers/ChemDraw.i +81 -0
- data/Code/RubyWrappers/ChemReactions.i +166 -0
- data/Code/RubyWrappers/ChemTransforms.i +126 -0
- data/Code/RubyWrappers/Conformer.i +69 -0
- data/Code/RubyWrappers/Descriptors.i +64 -0
- data/Code/RubyWrappers/Dict.i +45 -0
- data/Code/RubyWrappers/DistGeom.i +217 -0
- data/Code/RubyWrappers/DiversityPick.h +49 -0
- data/Code/RubyWrappers/DiversityPick.i +10 -0
- data/Code/RubyWrappers/ErrorGenerator.i +73 -0
- data/Code/RubyWrappers/ExplicitBitVect.i +76 -0
- data/Code/RubyWrappers/FMCS.i +63 -0
- data/Code/RubyWrappers/FilterCatalog.i +154 -0
- data/Code/RubyWrappers/Fingerprints.i +56 -0
- data/Code/RubyWrappers/ForceField.i +161 -0
- data/Code/RubyWrappers/GeneralizedSubstruct.i +38 -0
- data/Code/RubyWrappers/GenericRDKitException.h +27 -0
- data/Code/RubyWrappers/Inchi.i +38 -0
- data/Code/RubyWrappers/MolBundle.i +16 -0
- data/Code/RubyWrappers/MolDraw2D.i +117 -0
- data/Code/RubyWrappers/MolEnumerator.i +45 -0
- data/Code/RubyWrappers/MolHash.i +25 -0
- data/Code/RubyWrappers/MolOps.i +72 -0
- data/Code/RubyWrappers/MolStandardize.i +37 -0
- data/Code/RubyWrappers/MolSupplier.i +83 -0
- data/Code/RubyWrappers/MolTransforms.i +39 -0
- data/Code/RubyWrappers/MolWriters.i +41 -0
- data/Code/RubyWrappers/MonomerInfo.i +42 -0
- data/Code/RubyWrappers/MorganFingerprints.h +21 -0
- data/Code/RubyWrappers/MorganFingerprints.i +66 -0
- data/Code/RubyWrappers/PeriodicTable.i +44 -0
- data/Code/RubyWrappers/Queries.i +289 -0
- data/Code/RubyWrappers/QueryAtom.i +47 -0
- data/Code/RubyWrappers/QueryBond.i +47 -0
- data/Code/RubyWrappers/QueryOps.i +44 -0
- data/Code/RubyWrappers/RDKitExceptions.i +75 -0
- data/Code/RubyWrappers/RDLogger.i +74 -0
- data/Code/RubyWrappers/RDProps.i +44 -0
- data/Code/RubyWrappers/RGroupDecomposition.i +52 -0
- data/Code/RubyWrappers/ROMol.i +695 -0
- data/Code/RubyWrappers/RWMol.i +241 -0
- data/Code/RubyWrappers/RascalMCES.i +71 -0
- data/Code/RubyWrappers/ReactionFingerprints.i +37 -0
- data/Code/RubyWrappers/RingInfo.i +40 -0
- data/Code/RubyWrappers/Rings.i +40 -0
- data/Code/RubyWrappers/SanitException.i +100 -0
- data/Code/RubyWrappers/ScaffoldNetwork.i +28 -0
- data/Code/RubyWrappers/SmartsWrite.i +38 -0
- data/Code/RubyWrappers/SmilesParse.i +40 -0
- data/Code/RubyWrappers/SmilesWrite.i +42 -0
- data/Code/RubyWrappers/StereoGroup.i +16 -0
- data/Code/RubyWrappers/Streams.i +67 -0
- data/Code/RubyWrappers/Subgraphs.i +53 -0
- data/Code/RubyWrappers/Subset.i +75 -0
- data/Code/RubyWrappers/SubstanceGroup.i +91 -0
- data/Code/RubyWrappers/SubstructLibrary.i +80 -0
- data/Code/RubyWrappers/TautomerQuery.i +19 -0
- data/Code/RubyWrappers/Trajectory.i +34 -0
- data/Code/RubyWrappers/boost_tuple.i +64 -0
- data/Code/RubyWrappers/extend_std_vector.i +10 -0
- data/Code/RubyWrappers/gmwrapper/CMakeLists.txt +69 -0
- data/Code/RubyWrappers/gmwrapper/GraphMolRuby.i +431 -0
- data/Code/RubyWrappers/gmwrapper/std_list.i +65 -0
- data/Code/RubyWrappers/point.i +56 -0
- data/Code/RubyWrappers/transforms.i +60 -0
- data/Code/RubyWrappers/types.i +40 -0
- data/README.md +24 -0
- data/Rakefile +125 -4
- data/ext/rdkit_chem/CMakeLists.txt +69 -0
- data/ext/rdkit_chem/Makefile +5 -0
- data/ext/rdkit_chem/extconf.rb +47 -17
- data/lib/rdkit_chem/version.rb +1 -1
- data/lib/rdkit_chem.rb +31 -1
- data/test/test_rdkit_chem.rb +38 -10
- metadata +119 -13
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
|
7
|
+
* modification, are permitted provided that the following conditions are
|
|
8
|
+
* met:
|
|
9
|
+
*
|
|
10
|
+
* * Redistributions of source code must retain the above copyright
|
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
|
12
|
+
* * Redistributions in binary form must reproduce the above
|
|
13
|
+
* copyright notice, this list of conditions and the following
|
|
14
|
+
* disclaimer in the documentation and/or other materials provided
|
|
15
|
+
* with the distribution.
|
|
16
|
+
* * Neither the name of Novartis Institutes for BioMedical Research Inc.
|
|
17
|
+
* nor the names of its contributors may be used to endorse or promote
|
|
18
|
+
* products derived from this software without specific prior written permission.
|
|
19
|
+
*
|
|
20
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
21
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
22
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
23
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
24
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
25
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
26
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
27
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
28
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
29
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
30
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31
|
+
*/
|
|
32
|
+
%module RDKitChem
|
|
33
|
+
|
|
34
|
+
#if defined(SWIGWORDSIZE64)
|
|
35
|
+
%{
|
|
36
|
+
// There's a problem with SWIG, 64bit windows, and modern VC++ versions
|
|
37
|
+
// This fine, fine piece of code fixes that.
|
|
38
|
+
// it's ok to think this is horrible, we won't mind
|
|
39
|
+
#ifdef _MSC_VER
|
|
40
|
+
|
|
41
|
+
#ifndef LONG_MAX
|
|
42
|
+
#include <limits.h>
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
#if LONG_MAX==INT_MAX
|
|
46
|
+
#define LONG_MAX (INT_MAX+1)
|
|
47
|
+
#endif
|
|
48
|
+
|
|
49
|
+
#endif
|
|
50
|
+
%}
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
/* Suppress the unimportant warnings */
|
|
54
|
+
#pragma SWIG nowarn=503,516
|
|
55
|
+
|
|
56
|
+
// Ignore ostream operators globally - they cause redefinition errors and aren't useful in Ruby
|
|
57
|
+
%ignore operator<<;
|
|
58
|
+
|
|
59
|
+
%include <boost_shared_ptr.i>
|
|
60
|
+
%{
|
|
61
|
+
#include <boost/shared_ptr.hpp>
|
|
62
|
+
#include <boost/shared_array.hpp>
|
|
63
|
+
#include <ForceField/UFF/Params.h>
|
|
64
|
+
%}
|
|
65
|
+
// The actual definition isn't in the top level hpp file!
|
|
66
|
+
// The next two lines are to work around a problem caused by the fact that older versions of
|
|
67
|
+
// SWIG don't work with newer versions of boost.
|
|
68
|
+
#define BOOST_SP_NOEXCEPT
|
|
69
|
+
#define BOOST_SP_NOEXCEPT_WITH_ASSERT
|
|
70
|
+
#define BOOST_NOEXCEPT
|
|
71
|
+
#define BOOST_NO_CXX11_RVALUE_REFERENCES
|
|
72
|
+
#define BOOST_NO_CXX11_NULLPTR
|
|
73
|
+
%include <boost/smart_ptr/shared_array.hpp>
|
|
74
|
+
|
|
75
|
+
/* undefine RDKIT_<LIBNAME>_EXPORT macros */
|
|
76
|
+
%include <RDGeneral/RDExportMacros.h>
|
|
77
|
+
%include <RDGeneral/export.h>
|
|
78
|
+
/* Include the base types before anything that will utilize them */
|
|
79
|
+
#ifdef SWIGWIN
|
|
80
|
+
%include "../msvc_stdint.i"
|
|
81
|
+
#else
|
|
82
|
+
%include "../stdint.i"
|
|
83
|
+
#endif
|
|
84
|
+
|
|
85
|
+
%include "std_string.i"
|
|
86
|
+
%include "std_list.i"
|
|
87
|
+
%include "std_vector.i"
|
|
88
|
+
%include "extend_std_vector.i"
|
|
89
|
+
%include "std_map.i"
|
|
90
|
+
%include "std_pair.i"
|
|
91
|
+
%include "carrays.i"
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
* Custom handler for longs. The problem is described in swig-Bugs-2965875
|
|
95
|
+
* and most of this solution is taken from the proposed patch in that bug report.
|
|
96
|
+
* -------------------------------------------------------------------------
|
|
97
|
+
* Define typemaps for `long`
|
|
98
|
+
*
|
|
99
|
+
* This is complicated by the fact `long` is 32-bits on some platforms
|
|
100
|
+
* but is 64-bits on other platforms. We're just going to override the
|
|
101
|
+
* important ones here.
|
|
102
|
+
*/
|
|
103
|
+
#if defined(SWIGWORDSIZE64)
|
|
104
|
+
typedef long long int int64_t;
|
|
105
|
+
typedef unsigned long long int uint64_t;
|
|
106
|
+
typedef long long int int_least64_t;
|
|
107
|
+
typedef unsigned long long int uint_least64_t;
|
|
108
|
+
typedef long long int int_fast64_t;
|
|
109
|
+
typedef unsigned long long int uint_fast64_t;
|
|
110
|
+
typedef long long int intmax_t;
|
|
111
|
+
typedef unsigned long long int uintmax_t;
|
|
112
|
+
|
|
113
|
+
%apply long long { long };
|
|
114
|
+
%apply const long long & { const long & };
|
|
115
|
+
%apply unsigned long long { unsigned long };
|
|
116
|
+
%apply const unsigned long long & { const unsigned long & };
|
|
117
|
+
|
|
118
|
+
/*
|
|
119
|
+
#elif defined(SWIGWORDSIZE32)
|
|
120
|
+
%apply int { long };
|
|
121
|
+
%apply const int & { const long & };
|
|
122
|
+
%apply unsigned int { unsigned long };
|
|
123
|
+
%apply const unsigned int & { const unsigned long & };
|
|
124
|
+
#else
|
|
125
|
+
#error "Neither SWIGWORDSIZE64 nor SWIGWORDSIZE32 is defined"
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
#endif
|
|
129
|
+
|
|
130
|
+
// Tell SWIG that boost and std integer types are equivalent to standard types
|
|
131
|
+
// This prevents duplicate swig::traits definitions
|
|
132
|
+
%apply int { boost::int32_t };
|
|
133
|
+
%apply const int & { const boost::int32_t & };
|
|
134
|
+
%apply unsigned int { boost::uint32_t };
|
|
135
|
+
%apply const unsigned int & { const boost::uint32_t & };
|
|
136
|
+
%apply int { std::int32_t };
|
|
137
|
+
%apply const int & { const std::int32_t & };
|
|
138
|
+
%apply unsigned int { std::uint32_t };
|
|
139
|
+
%apply const unsigned int & { const std::uint32_t & };
|
|
140
|
+
|
|
141
|
+
%shared_ptr(std::exception)
|
|
142
|
+
%shared_ptr(RDKit::RDProps)
|
|
143
|
+
%shared_ptr(RDKit::Conformer)
|
|
144
|
+
%shared_ptr(RDKit::ROMol)
|
|
145
|
+
%shared_ptr(RDKit::RWMol)
|
|
146
|
+
%shared_ptr(RDKit::Atom)
|
|
147
|
+
%shared_ptr(RDKit::Bond)
|
|
148
|
+
%shared_ptr(RDKit::PeriodicTable)
|
|
149
|
+
%shared_ptr(Canon::MolStackElem)
|
|
150
|
+
%shared_ptr(RDKit::QueryAtom)
|
|
151
|
+
%shared_ptr(RDKit::QueryBond)
|
|
152
|
+
%shared_ptr(RDKit::QueryOps)
|
|
153
|
+
%shared_ptr(RDKit::MolBundle)
|
|
154
|
+
%shared_ptr(RDKit::FixedMolSizeMolBundle)
|
|
155
|
+
%shared_ptr(RDKit::MolSanitizeException)
|
|
156
|
+
%shared_ptr(RDKit::AtomSanitizeException)
|
|
157
|
+
%shared_ptr(RDKit::AtomValenceException)
|
|
158
|
+
%shared_ptr(RDKit::AtomKekulizeException)
|
|
159
|
+
%shared_ptr(RDKit::KekulizeException)
|
|
160
|
+
%shared_ptr(RDKit::SmilesParseException)
|
|
161
|
+
%shared_ptr(RDKit::MolPicklerException)
|
|
162
|
+
%shared_ptr(RDKit::RingInfo)
|
|
163
|
+
%shared_ptr(RDKit::ChemicalReaction)
|
|
164
|
+
%shared_ptr(ForceFields::ForceFieldContrib);
|
|
165
|
+
%shared_ptr(ForceFields::UFF::AngleBendContrib);
|
|
166
|
+
%shared_ptr(ForceFields::UFF::BondStretchContrib);
|
|
167
|
+
%shared_ptr(ForceFields::DistanceConstraintContrib);
|
|
168
|
+
%shared_ptr(ForceFields::UFF::vdWContrib);
|
|
169
|
+
%shared_ptr(ForceFields::UFF::TorsionAngleContrib);
|
|
170
|
+
%shared_ptr(ForceFields::UFF::InversionContrib);
|
|
171
|
+
%shared_ptr(RDKit::FilterCatalogEntry);
|
|
172
|
+
|
|
173
|
+
/* http://swig.10945.n7.nabble.com/std-containers-and-pointers-td3728.html */
|
|
174
|
+
%{
|
|
175
|
+
/* template <> struct swig::traits<RDKit::ROMol> { */
|
|
176
|
+
/* typedef pointer_category category; */
|
|
177
|
+
/* static const char* type_name() */
|
|
178
|
+
/* { */
|
|
179
|
+
/* return "ROMol"; */
|
|
180
|
+
/* } */
|
|
181
|
+
/* }; */
|
|
182
|
+
|
|
183
|
+
/* template <> struct swig::traits<ForceFields::UFF::AtomicParams> { */
|
|
184
|
+
/* typedef pointer_category category; */
|
|
185
|
+
/* static const char* type_name() */
|
|
186
|
+
/* { */
|
|
187
|
+
/* return "AtomicParams"; */
|
|
188
|
+
/* } */
|
|
189
|
+
/* }; */
|
|
190
|
+
%}
|
|
191
|
+
|
|
192
|
+
/* Some utility classes for passing arrays in and out */
|
|
193
|
+
%array_class(double, Double_Array);
|
|
194
|
+
|
|
195
|
+
/* Since documentation management is deprecated in SWIG 1.3, we're using the suggested workarounds. Apply them
|
|
196
|
+
here so that can be removed easily later */
|
|
197
|
+
// Documentation
|
|
198
|
+
|
|
199
|
+
// Create a class to throw various sorts of errors for testing. Required for unit tests in ErrorHandlingTests.java
|
|
200
|
+
/* #ifdef INCLUDE_ERROR_GENERATOR */
|
|
201
|
+
/* %include "../ErrorGenerator.i" */
|
|
202
|
+
/* #endif */
|
|
203
|
+
|
|
204
|
+
// Fixes annoying compilation namespace issue
|
|
205
|
+
typedef RDKit::MatchVectType MatchVectType;
|
|
206
|
+
|
|
207
|
+
%define VVTEMPLATE_WRAP(name, T)
|
|
208
|
+
%feature("ignore") std::vector< std::vector<T> >::append;
|
|
209
|
+
%feature("ignore") std::vector< std::vector<T> >::assign;
|
|
210
|
+
%feature("ignore") std::vector< std::vector<T> >::back;
|
|
211
|
+
%feature("ignore") std::vector< std::vector<T> >::begin;
|
|
212
|
+
%feature("ignore") std::vector< std::vector<T> >::capacity;
|
|
213
|
+
%feature("ignore") std::vector< std::vector<T> >::clear;
|
|
214
|
+
%feature("ignore") std::vector< std::vector<T> >::empty;
|
|
215
|
+
%feature("ignore") std::vector< std::vector<T> >::end;
|
|
216
|
+
%feature("ignore") std::vector< std::vector<T> >::equals;
|
|
217
|
+
%feature("ignore") std::vector< std::vector<T> >::erase;
|
|
218
|
+
%feature("ignore") std::vector< std::vector<T> >::front;
|
|
219
|
+
%feature("ignore") std::vector< std::vector<T> >::get_allocator;
|
|
220
|
+
%feature("ignore") std::vector< std::vector<T> >::insert;
|
|
221
|
+
%feature("ignore") std::vector< std::vector<T> >::pop;
|
|
222
|
+
%feature("ignore") std::vector< std::vector<T> >::pop_back;
|
|
223
|
+
%feature("ignore") std::vector< std::vector<T> >::push_back;
|
|
224
|
+
%feature("ignore") std::vector< std::vector<T> >::rbegin;
|
|
225
|
+
%feature("ignore") std::vector< std::vector<T> >::rend;
|
|
226
|
+
%feature("ignore") std::vector< std::vector<T> >::reserve;
|
|
227
|
+
%feature("ignore") std::vector< std::vector<T> >::resize;
|
|
228
|
+
%feature("ignore") std::vector< std::vector<T> >::size;
|
|
229
|
+
%feature("ignore") std::vector< std::vector<T> >::shift;
|
|
230
|
+
%feature("ignore") std::vector< std::vector<T> >::swap;
|
|
231
|
+
%feature("ignore") std::vector< std::vector<T> >::unshift;
|
|
232
|
+
%template(name ## VectVect) std::vector< std::vector<T> >;
|
|
233
|
+
%enddef
|
|
234
|
+
|
|
235
|
+
%define VECTORTEMPLATE_WRAP(vectorname, T)
|
|
236
|
+
%feature("ignore") std::vector<T>::append;
|
|
237
|
+
%feature("ignore") std::vector<T>::assign;
|
|
238
|
+
%feature("ignore") std::vector<T>::back;
|
|
239
|
+
%feature("ignore") std::vector<T>::begin;
|
|
240
|
+
%feature("ignore") std::vector<T>::capacity;
|
|
241
|
+
%feature("ignore") std::vector<T>::clear;
|
|
242
|
+
%feature("ignore") std::vector<T>::empty;
|
|
243
|
+
%feature("ignore") std::vector<T>::end;
|
|
244
|
+
%feature("ignore") std::vector<T>::erase;
|
|
245
|
+
%feature("ignore") std::vector<T>::equals;
|
|
246
|
+
%feature("ignore") std::vector<T>::front;
|
|
247
|
+
%feature("ignore") std::vector<T>::get_allocator;
|
|
248
|
+
%feature("ignore") std::vector<T>::insert;
|
|
249
|
+
%feature("ignore") std::vector<T>::pop;
|
|
250
|
+
%feature("ignore") std::vector<T>::pop_back;
|
|
251
|
+
%feature("ignore") std::vector<T>::push_back;
|
|
252
|
+
%feature("ignore") std::vector<T>::rbegin;
|
|
253
|
+
%feature("ignore") std::vector<T>::rend;
|
|
254
|
+
%feature("ignore") std::vector<T>::reserve;
|
|
255
|
+
%feature("ignore") std::vector<T>::resize;
|
|
256
|
+
%feature("ignore") std::vector<T>::size;
|
|
257
|
+
%feature("ignore") std::vector<T>::shift;
|
|
258
|
+
%feature("ignore") std::vector<T>::swap;
|
|
259
|
+
%feature("ignore") std::vector<T>::unshift;
|
|
260
|
+
%template(vectorname ## Vect) std::vector<T>;
|
|
261
|
+
%enddef
|
|
262
|
+
|
|
263
|
+
// DiceSimilarity template is instantiated in MorganFingerprints.i after SparseIntVect.h is included
|
|
264
|
+
|
|
265
|
+
/* vector */
|
|
266
|
+
%template(Int_Vect) std::vector<int>;
|
|
267
|
+
%template(Byte_Vect) std::vector<signed char>;
|
|
268
|
+
%template(Double_Vect) std::vector<double>;
|
|
269
|
+
// Use base types (unsigned int) to avoid duplicate swig::traits definitions
|
|
270
|
+
%template(UInt_Vect) std::vector<unsigned int>;
|
|
271
|
+
%template(Str_Vect) std::vector<std::string>;
|
|
272
|
+
// Point vector templates removed - Ruby SWIG lacks swig::traits for custom types
|
|
273
|
+
// %template(Point_Vect) std::vector<RDGeom::Point *>;
|
|
274
|
+
// %template(Point2D_Vect) std::vector<RDGeom::Point2D *>;
|
|
275
|
+
// %template(Point3D_Vect) std::vector<RDGeom::Point3D *>;
|
|
276
|
+
// %template(Atomic_Params_Vect) std::vector<const ForceFields::UFF::AtomicParams *>;
|
|
277
|
+
|
|
278
|
+
/* pair */
|
|
279
|
+
// Use base types (int/unsigned int) to avoid duplicate swig::traits definitions
|
|
280
|
+
%template(Int_Pair) std::pair<int, int>;
|
|
281
|
+
%template(Double_Pair) std::pair<double,double>;
|
|
282
|
+
%template(UInt_Pair) std::pair<unsigned int, int>;
|
|
283
|
+
// Long_Pair removed - Ruby SWIG lacks swig::traits support for long long int
|
|
284
|
+
|
|
285
|
+
/* map */
|
|
286
|
+
%template(String_String_Map) std::map<std::string,std::string>;
|
|
287
|
+
%template(Int_Int_Map) std::map<int,int>;
|
|
288
|
+
// Point map templates removed - Ruby SWIG lacks swig::traits for custom types
|
|
289
|
+
// %template(Int_Point2D_Map) std::map<int, RDGeom::Point2D>;
|
|
290
|
+
// %template(Int_Point3D_Map) std::map<int, RDGeom::Point3D>;
|
|
291
|
+
%template(Int_Int_Vect_List_Map) std::map<int,std::list<std::vector<int> > >;
|
|
292
|
+
|
|
293
|
+
/* vector pair */
|
|
294
|
+
// Use base types (int/unsigned int) to avoid duplicate swig::traits definitions
|
|
295
|
+
%template(UInt_Pair_Vect) std::vector<std::pair<unsigned int,int> >;
|
|
296
|
+
%template(Match_Vect) std::vector<std::pair<int,int> >;
|
|
297
|
+
// Long_Pair_Vect removed - Ruby SWIG lacks swig::traits support for long long int
|
|
298
|
+
|
|
299
|
+
/* vector vector */
|
|
300
|
+
%template(Int_Vect_Vect) std::vector<std::vector<int> >;
|
|
301
|
+
|
|
302
|
+
/* list */
|
|
303
|
+
%template(Int_Vect_List) std::list<std::vector<int> >;
|
|
304
|
+
%template(Int_List) std::list<int>;
|
|
305
|
+
%template(UInt_List) std::list<unsigned int>;
|
|
306
|
+
|
|
307
|
+
/* other */
|
|
308
|
+
%template(Match_Vect_Vect) std::vector<std::vector<std::pair<int,int> > >;
|
|
309
|
+
// Flagged_Atomic_Params_Vect removed - Ruby SWIG lacks swig::traits for custom types
|
|
310
|
+
// %template(Flagged_Atomic_Params_Vect) std::pair<std::vector<const ForceFields::UFF::AtomicParams *>,bool>;
|
|
311
|
+
%template(Shared_Int_Array) boost::shared_array<int>;
|
|
312
|
+
%template(Shared_Double_Array) boost::shared_array<double>;
|
|
313
|
+
|
|
314
|
+
// These methods are renamed to valid method names
|
|
315
|
+
%rename(inc) *::operator++;
|
|
316
|
+
%rename(good) *::operator bool;
|
|
317
|
+
%rename(deref) *::operator->;
|
|
318
|
+
%rename(add) *::operator+=;
|
|
319
|
+
%rename(idx) *::operator[];
|
|
320
|
+
|
|
321
|
+
// Methods to get at elements of shared arrays
|
|
322
|
+
%extend boost::shared_array<double> {
|
|
323
|
+
double getElement(int i) {
|
|
324
|
+
return (*($self))[i];
|
|
325
|
+
}
|
|
326
|
+
void setElement(int i, double value) {
|
|
327
|
+
(*($self))[i] = value;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
%extend boost::shared_array<int> {
|
|
331
|
+
int getElement(int i) {
|
|
332
|
+
return (*($self))[i];
|
|
333
|
+
}
|
|
334
|
+
void setElement(int i, int value) {
|
|
335
|
+
(*($self))[i] = value;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// This requires SWIG 4.2 or higher - must be before RDKitExceptions.i
|
|
340
|
+
%include "std_string_view.i"
|
|
341
|
+
|
|
342
|
+
// DO THIS BEFORE ANY OF THE OTHER INCLUDES
|
|
343
|
+
%include "../RDKitExceptions.i"
|
|
344
|
+
|
|
345
|
+
%include "../point.i"
|
|
346
|
+
// Need the types wrapper or we get undefined errors for STR_VECT
|
|
347
|
+
%include "../types.i"
|
|
348
|
+
// Conformer seems to need to come before ROMol
|
|
349
|
+
%include "../Conformer.i"
|
|
350
|
+
%include "../Dict.i"
|
|
351
|
+
%include "../RDLogger.i"
|
|
352
|
+
%include "../RDProps.i"
|
|
353
|
+
%include "../StereoGroup.i"
|
|
354
|
+
%include "../ROMol.i"
|
|
355
|
+
%include "../RWMol.i"
|
|
356
|
+
%include "../Bond.i"
|
|
357
|
+
%include "../BondIterators.i"
|
|
358
|
+
%include "../Atom.i"
|
|
359
|
+
%include "../AtomIterators.i"
|
|
360
|
+
%include "../AtomPairs.i"
|
|
361
|
+
%include "../Canon.i"
|
|
362
|
+
%include "../Conformer.i"
|
|
363
|
+
%include "../QueryAtom.i"
|
|
364
|
+
%include "../QueryBond.i"
|
|
365
|
+
%include "../QueryOps.i"
|
|
366
|
+
%include "../MolBundle.i"
|
|
367
|
+
%include "../MonomerInfo.i"
|
|
368
|
+
%include "../PeriodicTable.i"
|
|
369
|
+
%include "../SanitException.i"
|
|
370
|
+
%include "../SmilesParse.i"
|
|
371
|
+
%include "../SmilesWrite.i"
|
|
372
|
+
%include "../SmartsWrite.i"
|
|
373
|
+
%include "../MolOps.i"
|
|
374
|
+
%include "../MolSupplier.i"
|
|
375
|
+
%include "../MolWriters.i"
|
|
376
|
+
%include "../RingInfo.i"
|
|
377
|
+
%include "../ChemReactions.i"
|
|
378
|
+
%include "../BitOps.i"
|
|
379
|
+
%include "../ExplicitBitVect.i"
|
|
380
|
+
%include "../Fingerprints.i"
|
|
381
|
+
%include "../MorganFingerprints.i"
|
|
382
|
+
%include "../ReactionFingerprints.i"
|
|
383
|
+
%include "../Rings.i"
|
|
384
|
+
%include "../transforms.i"
|
|
385
|
+
%include "../DistGeom.i"
|
|
386
|
+
%include "../ForceField.i"
|
|
387
|
+
%include "../ChemTransforms.i"
|
|
388
|
+
%include "../Subgraphs.i"
|
|
389
|
+
%include "../MolTransforms.i"
|
|
390
|
+
%include "../FMCS.i"
|
|
391
|
+
%include "../MolDraw2D.i"
|
|
392
|
+
%include "../FilterCatalog.i"
|
|
393
|
+
%include "../Trajectory.i"
|
|
394
|
+
%include "../MolStandardize.i"
|
|
395
|
+
%include "../SubstructLibrary.i"
|
|
396
|
+
%include "../RGroupDecomposition.i"
|
|
397
|
+
%include "../ScaffoldNetwork.i"
|
|
398
|
+
%include "../TautomerQuery.i"
|
|
399
|
+
%include "../SubstanceGroup.i"
|
|
400
|
+
%include "../MolEnumerator.i"
|
|
401
|
+
%include "../MolHash.i"
|
|
402
|
+
%include "../Abbreviations.i"
|
|
403
|
+
%include "../Streams.i"
|
|
404
|
+
%include "../GeneralizedSubstruct.i"
|
|
405
|
+
%include "../RascalMCES.i"
|
|
406
|
+
%include "../Queries.i"
|
|
407
|
+
%include "../Subset.i"
|
|
408
|
+
|
|
409
|
+
%include "../Descriptors.i"
|
|
410
|
+
|
|
411
|
+
#ifdef RDK_BUILD_AVALON_SUPPORT
|
|
412
|
+
%include "../AvalonLib.i"
|
|
413
|
+
#endif
|
|
414
|
+
#ifdef RDK_BUILD_INCHI_SUPPORT
|
|
415
|
+
%include "../Inchi.i"
|
|
416
|
+
#endif
|
|
417
|
+
#ifdef RDK_BUILD_CHEMDRAW_SUPPORT
|
|
418
|
+
%include "../ChemDraw.i"
|
|
419
|
+
#endif
|
|
420
|
+
|
|
421
|
+
%include "../DiversityPick.i"
|
|
422
|
+
|
|
423
|
+
%{
|
|
424
|
+
#include <RDGeneral/versions.h>
|
|
425
|
+
%}
|
|
426
|
+
|
|
427
|
+
%immutable RDKit::rdkitVersion;
|
|
428
|
+
%immutable RDKit::boostVersion;
|
|
429
|
+
%immutable RDKit::rdkitBuild;
|
|
430
|
+
|
|
431
|
+
%include <RDGeneral/versions.h>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* -----------------------------------------------------------------------------
|
|
2
|
+
* See the LICENSE file for information on copyright, usage and redistribution
|
|
3
|
+
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
|
|
4
|
+
*
|
|
5
|
+
* std_list.i
|
|
6
|
+
* ----------------------------------------------------------------------------- */
|
|
7
|
+
|
|
8
|
+
%include <std_common.i>
|
|
9
|
+
|
|
10
|
+
%{
|
|
11
|
+
#include <list>
|
|
12
|
+
#include <stdexcept>
|
|
13
|
+
%}
|
|
14
|
+
|
|
15
|
+
namespace std {
|
|
16
|
+
|
|
17
|
+
template<class T> class list {
|
|
18
|
+
public:
|
|
19
|
+
typedef size_t size_type;
|
|
20
|
+
typedef T value_type;
|
|
21
|
+
typedef const value_type& const_reference;
|
|
22
|
+
list();
|
|
23
|
+
size_type size() const;
|
|
24
|
+
%rename(isEmpty) empty;
|
|
25
|
+
bool empty() const;
|
|
26
|
+
void clear();
|
|
27
|
+
%rename(add) push_back;
|
|
28
|
+
void push_back(const value_type& x);
|
|
29
|
+
%extend {
|
|
30
|
+
const_reference get(int i) throw (std::out_of_range) {
|
|
31
|
+
int size = int(self->size());
|
|
32
|
+
int j;
|
|
33
|
+
if (i>=0 && i<size) {
|
|
34
|
+
std::list< T >::const_iterator p;
|
|
35
|
+
p=self->begin();
|
|
36
|
+
for (j=0; j<i; j++) {p++;}
|
|
37
|
+
return (*p);
|
|
38
|
+
}
|
|
39
|
+
else
|
|
40
|
+
throw std::out_of_range("list index out of range");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
bool equals(const list<T> &o){
|
|
44
|
+
if(self->size()==o.size()){
|
|
45
|
+
std::list< T >::const_iterator sIt=self->begin();
|
|
46
|
+
std::list< T >::const_iterator oIt=o.begin();
|
|
47
|
+
while(sIt != self->end()){
|
|
48
|
+
if(*sIt != *oIt) return false;
|
|
49
|
+
++sIt;
|
|
50
|
+
++oIt;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
} else {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
%define specialize_std_list(T)
|
|
63
|
+
#warning "specialize_std_list - specialization for type T no longer needed"
|
|
64
|
+
%enddef
|
|
65
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
#include <Geometry/point.h>
|
|
35
|
+
%}
|
|
36
|
+
|
|
37
|
+
// Ignore ostream operators to prevent redefinition errors
|
|
38
|
+
%ignore RDGeom::operator<<;
|
|
39
|
+
|
|
40
|
+
%include <Geometry/point.h>
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
%extend RDGeom::Point3D {
|
|
44
|
+
RDGeom::Point3D* RDGeom::Point3D::minus(const RDGeom::Point3D &other) {
|
|
45
|
+
RDGeom::Point3D* diff = new RDGeom::Point3D(*($self) - other);
|
|
46
|
+
return diff;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
%extend RDGeom::Point2D {
|
|
51
|
+
RDGeom::Point2D* RDGeom::Point2D::minus(const RDGeom::Point2D &other) {
|
|
52
|
+
RDGeom::Point2D* diff = new RDGeom::Point2D(*($self) - other);
|
|
53
|
+
return diff;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
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 <Numerics/SquareMatrix.h>
|
|
36
|
+
#include <Geometry/Transform.h>
|
|
37
|
+
#include <Geometry/Transform2D.h>
|
|
38
|
+
#include <Geometry/Transform3D.h>
|
|
39
|
+
#include <Numerics/SymmMatrix.h>
|
|
40
|
+
%}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
%include <Numerics/Vector.h>
|
|
44
|
+
%include <Numerics/Matrix.h>
|
|
45
|
+
%include <Numerics/SquareMatrix.h>
|
|
46
|
+
%include <Numerics/SymmMatrix.h>
|
|
47
|
+
|
|
48
|
+
/* These template definitions need to come after the C++ template definition code, but before the
|
|
49
|
+
instantiation by other modules. */
|
|
50
|
+
|
|
51
|
+
%template(IntMatrix) RDNumeric::Matrix<int>;
|
|
52
|
+
%template(DoubleMatrix) RDNumeric::Matrix<double>;
|
|
53
|
+
%template(IntSymmMatrix) RDNumeric::SymmMatrix<int>;
|
|
54
|
+
%template(DoubleSymmMatrix) RDNumeric::SymmMatrix<double>;
|
|
55
|
+
%template(DoubleSquareMatrix) RDNumeric::SquareMatrix<double>;
|
|
56
|
+
|
|
57
|
+
%include <Geometry/Transform.h>
|
|
58
|
+
%include <Geometry/Transform2D.h>
|
|
59
|
+
%include <Geometry/Transform3D.h>
|
|
60
|
+
|
|
@@ -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 <RDGeneral/types.h>
|
|
36
|
+
%}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
%include <RDGeneral/types.h>
|
data/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
# rdkit-chem gem
|
|
3
|
+
|
|
4
|
+
GEM for [RDKIT](http://rdkit.org/), an Open-Source Cheminformatics Software
|
|
5
|
+
|
|
6
|
+
## Environment
|
|
7
|
+
|
|
8
|
+
### Prerequisites
|
|
9
|
+
* cmake 3.8 or later
|
|
10
|
+
* curl
|
|
11
|
+
* tar, sed, make (those should be present anyway)
|
|
12
|
+
* SWIG 2 or later
|
|
13
|
+
* python header (`python-dev`)
|
|
14
|
+
* sqlite (`sqlite3-dev`)
|
|
15
|
+
* boost > 1.58 (`libboost-all-dev`)
|
|
16
|
+
* gcc
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
`gem install rdkit_chem`
|
|
21
|
+
|
|
22
|
+
It downloads the sources, compiles and installs RDKIT with the ruby bindings.
|
|
23
|
+
The installation may last very long - please be patient.
|
|
24
|
+
|