RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MolSupplier.v1API.h
Go to the documentation of this file.
1//
2// Copyright (C) 2024 greg landrum and other RDKit contributors
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#ifndef RD_MOLSUPPLIER_v1_H
11#define RD_MOLSUPPLIER_v1_H
12
13namespace RDKit {
14inline namespace v1 {
15/*!
16//
17// Here are a couple of ways one can interact with MolSuppliers:
18//
19// 1) Lazy (ForwardIterator):
20// while(!supplier.atEnd()){
21// ROMol *mol = supplier.next();
22// if(mol){
23// do something;
24// }
25// }
26// 2) Random Access:
27// for(int i=0;i<supplier.length();i++){
28// ROMol *mol = supplier[i];
29// if(mol){
30// do something;
31// }
32// }
33//
34//
35*/
37 // this is an abstract base class to supply molecules one at a time
38 public:
40 virtual ~MolSupplier() {}
41 void init() {
42 if (dp_supplier) {
43 dp_supplier->init();
44 }
45 }
46 void reset() {
47 if (dp_supplier) {
48 dp_supplier->reset();
49 }
50 }
51
52 bool atEnd() {
53 if (dp_supplier) {
54 return dp_supplier->atEnd();
55 }
56 return true;
57 }
59 PRECONDITION(dp_supplier, "no supplier");
60 return dp_supplier->next().release();
61 }
62
63 virtual void close() {
64 if (dp_supplier) {
65 dp_supplier->close();
66 }
67 }
68
69 private:
70 // disable automatic copy constructors and assignment operators
71 // for this class and its subclasses. They will likely be
72 // carrying around stream pointers and copying those is a recipe
73 // for disaster.
74 MolSupplier(const MolSupplier &);
75 MolSupplier &operator=(const MolSupplier &);
76
77 protected:
78 std::unique_ptr<v2::FileParsers::MolSupplier> dp_supplier;
79};
80
81// \brief a supplier from an SD file that only reads forward:
83 /*************************************************************************
84 * A lazy mol supplier from a SD file.
85 * - When new molecules are read using "next" their positions in the file are
86 *noted.
87 ***********************************************************************************/
88 public:
91
92 explicit ForwardSDMolSupplier(std::istream *inStream,
93 bool takeOwnership = true, bool sanitize = true,
94 bool removeHs = true,
95 bool strictParsing = false) {
97 params.sanitize = sanitize;
98 params.removeHs = removeHs;
99 params.strictParsing = strictParsing;
100 dp_supplier.reset(new v2::FileParsers::ForwardSDMolSupplier(
101 inStream, takeOwnership, params));
102 };
103
105
106 void setProcessPropertyLists(bool val) {
107 PRECONDITION(dp_supplier, "no supplier");
108 static_cast<ContainedType *>(dp_supplier.get())
109 ->setProcessPropertyLists(val);
110 }
112 if (dp_supplier) {
113 return static_cast<ContainedType *>(dp_supplier.get())
114 ->getProcessPropertyLists();
115 }
116 return false;
117 }
118
119 bool getEOFHitOnRead() const {
120 if (dp_supplier) {
121 return static_cast<ContainedType *>(dp_supplier.get())->getEOFHitOnRead();
122 }
123 return false;
124 }
125};
126
127// \brief a lazy supplier from an SD file
129 /*************************************************************************
130 * A lazy mol supplier from a SD file.
131 * - When new molecules are read using "next" their positions in the file are
132 *noted.
133 * - A call to the "length" will automatically parse the entire file and
134 *cache all the mol
135 * block positions
136 * - [] operator is used to access a molecule at "idx", calling next
137 *following this will result
138 * in the next molecule after "idx"
139 ***********************************************************************************/
140
141 public:
143 SDMolSupplier() { dp_supplier.reset(new ContainedType()); }
144
145 /*!
146 * \param fileName - the name of the SD file
147 * \param sanitize - if true sanitize the molecule before returning it
148 * \param removeHs - if true remove Hs from the molecule before returning it
149 * (triggers sanitization)
150 * \param strictParsing - if set to false, the parser is more lax about
151 * correctness
152 * of the contents.
153 */
154 explicit SDMolSupplier(const std::string &fileName, bool sanitize = true,
155 bool removeHs = true, bool strictParsing = true) {
157 params.sanitize = sanitize;
158 params.removeHs = removeHs;
159 params.strictParsing = strictParsing;
160 dp_supplier.reset(new v2::FileParsers::SDMolSupplier(fileName, params));
161 }
162
163 explicit SDMolSupplier(std::istream *inStream, bool takeOwnership = true,
164 bool sanitize = true, bool removeHs = true,
165 bool strictParsing = true) {
167 params.sanitize = sanitize;
168 params.removeHs = removeHs;
169 params.strictParsing = strictParsing;
170 dp_supplier.reset(
171 new v2::FileParsers::SDMolSupplier(inStream, takeOwnership, params));
172 }
173
174 void moveTo(unsigned int idx) {
175 PRECONDITION(dp_supplier, "no supplier");
176 static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
177 }
178 ROMol *operator[](unsigned int idx) {
179 PRECONDITION(dp_supplier, "no supplier");
180 return static_cast<ContainedType *>(dp_supplier.get())
181 ->
182 operator[](idx)
183 .release();
184 }
185 /*! \brief returns the text block for a particular item
186 *
187 * \param idx - which item to return
188 */
189 std::string getItemText(unsigned int idx) {
190 PRECONDITION(dp_supplier, "no supplier");
191 return static_cast<ContainedType *>(dp_supplier.get())->getItemText(idx);
192 }
193 unsigned int length() {
194 PRECONDITION(dp_supplier, "no supplier");
195 return static_cast<ContainedType *>(dp_supplier.get())->length();
196 }
197 void setData(const std::string &text, bool sanitize = true,
198 bool removeHs = true) {
199 PRECONDITION(dp_supplier, "no supplier");
201 params.sanitize = sanitize;
202 params.removeHs = removeHs;
203 static_cast<ContainedType *>(dp_supplier.get())->setData(text, params);
204 }
205 void setData(const std::string &text, bool sanitize, bool removeHs,
206 bool strictParsing) {
208 params.sanitize = sanitize;
209 params.removeHs = removeHs;
210 params.strictParsing = strictParsing;
211 static_cast<ContainedType *>(dp_supplier.get())->setData(text, params);
212 }
213 /*! Resets our internal state and sets the indices of molecules in the stream.
214 * The client should be *very* careful about calling this method, as it's
215 *trivial
216 * to end up with a completely useless supplier.
217 *
218 * \param locs - the vector of stream positions.
219 *
220 * Note that this can be used not only to make reading selected molecules
221 *from a
222 * large SD file much faster, but it can also allow subsetting an SD file or
223 * rearranging the order of the molecules.
224 */
225 void setStreamIndices(const std::vector<std::streampos> &locs) {
226 PRECONDITION(dp_supplier, "no supplier");
227 static_cast<ContainedType *>(dp_supplier.get())->setStreamIndices(locs);
228 }
229};
230
231//! lazy file parser for Smiles tables
233 /**************************************************************************
234 * Lazy file parser for Smiles table file, similar to the lazy SD
235 * file parser above
236 * - As an when new molecules are read using "next" their
237 * positions in the file are noted.
238 * - A call to the "length" will automatically parse the entire
239 * file and cache all the mol block positions
240 * - [] operator is used to access a molecule at "idx", calling
241 * next following this will result in the next molecule after
242 * "idx"
243 ***************************************************************************/
244 public:
246 /*!
247 * \param fileName - the name of smiles table file
248 * \param delimiter - delimiting characters between records on a each
249 * line NOTE that this is not a string, the tokenizer looks for
250 * the individual characters in delimiter, not the full string
251 * itself. So the default delimiter: " \t", means " " or "\t".
252 * \param smilesColumn - column number for the SMILES string (defaults
253 * to the first column)
254 * \param nameColumn - column number for the molecule name (defaults to
255 * the second column) If set to -1 we assume that no name is
256 * available for the molecule and the name is defaulted to the
257 * smiles string
258 * \param titleLine - if true, the first line is assumed to list the
259 * names of properties in order separated by 'delimiter'. It is
260 * also assume that the 'SMILES' column and the 'name' column
261 * are not specified here if false - no title line is assumed
262 * and the properties are recorded as the "columnX" where "X" is
263 * the column number
264 * \param sanitize - if true sanitize the molecule before returning it
265 */
266 explicit SmilesMolSupplier(const std::string &fileName,
267 const std::string &delimiter = " \t",
268 int smilesColumn = 0, int nameColumn = 1,
269 bool titleLine = true, bool sanitize = true) {
271 params.delimiter = delimiter;
272 params.smilesColumn = smilesColumn;
273 params.nameColumn = nameColumn;
274 params.titleLine = titleLine;
275 params.parseParameters.sanitize = sanitize;
276 dp_supplier.reset(new v2::FileParsers::SmilesMolSupplier(fileName, params));
277 }
278 explicit SmilesMolSupplier(std::istream *inStream, bool takeOwnership = true,
279 const std::string &delimiter = " \t",
280 int smilesColumn = 0, int nameColumn = 1,
281 bool titleLine = true, bool sanitize = true) {
283 params.delimiter = delimiter;
284 params.smilesColumn = smilesColumn;
285 params.nameColumn = nameColumn;
286 params.titleLine = titleLine;
287 params.parseParameters.sanitize = sanitize;
288 dp_supplier.reset(new v2::FileParsers::SmilesMolSupplier(
289 inStream, takeOwnership, params));
290 }
291 SmilesMolSupplier() { dp_supplier.reset(new ContainedType()); }
292
293 void setData(const std::string &text, const std::string &delimiter = " ",
294 int smilesColumn = 0, int nameColumn = 1, bool titleLine = true,
295 bool sanitize = true) {
296 PRECONDITION(dp_supplier, "no supplier");
298 params.delimiter = delimiter;
299 params.smilesColumn = smilesColumn;
300 params.nameColumn = nameColumn;
301 params.titleLine = titleLine;
302 params.parseParameters.sanitize = sanitize;
303 static_cast<ContainedType *>(dp_supplier.get())->setData(text, params);
304 }
305 void moveTo(unsigned int idx) {
306 PRECONDITION(dp_supplier, "no supplier");
307 static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
308 }
309 ROMol *operator[](unsigned int idx) {
310 PRECONDITION(dp_supplier, "no supplier");
311 return static_cast<ContainedType *>(dp_supplier.get())
312 ->
313 operator[](idx)
314 .release();
315 }
316 /*! \brief returns the text block for a particular item
317 *
318 * \param idx - which item to return
319 */
320 std::string getItemText(unsigned int idx) {
321 PRECONDITION(dp_supplier, "no supplier");
322 return static_cast<ContainedType *>(dp_supplier.get())->getItemText(idx);
323 }
324 unsigned int length() {
325 PRECONDITION(dp_supplier, "no supplier")
326 return static_cast<ContainedType *>(dp_supplier.get())->length();
327 }
328};
329
330//! lazy file parser for TDT files
332 /**************************************************************************
333 * Lazy file parser for TDT files, similar to the lazy SD
334 * file parser above
335 * - As an when new molecules are read using "next" their
336 * positions in the file are noted.
337 * - A call to the "length" will automatically parse the entire
338 * file and cache all the mol block positions
339 * - [] operator is used to access a molecule at "idx", calling
340 * next following this will result in the next molecule after
341 * "idx"
342 ***************************************************************************/
343 public:
345 /*!
346 * \param fileName - the name of the TDT file
347 * \param nameRecord - property name for the molecule name.
348 * If empty (the default), the name defaults to be empty
349 * \param confId2D - if >=0 and 2D coordinates are provided, the 2D
350 * structure (depiction) in the input will be read into the
351 * corresponding conformer id.
352 * \param confId3D - if >=0 and 3D coordinates are provided, the 3D
353 * structure (depiction) in the input will be read into the
354 * corresponding conformer id.
355 * \param sanitize - if true sanitize the molecule before returning it
356 */
357 explicit TDTMolSupplier(const std::string &fileName,
358 const std::string &nameRecord = "", int confId2D = -1,
359 int confId3D = 0, bool sanitize = true) {
361 params.nameRecord = nameRecord;
362 params.confId2D = confId2D;
363 params.confId3D = confId3D;
364 params.parseParameters.sanitize = sanitize;
365 dp_supplier.reset(new v2::FileParsers::TDTMolSupplier(fileName, params));
366 }
367 explicit TDTMolSupplier(std::istream *inStream, bool takeOwnership = true,
368 const std::string &nameRecord = "", int confId2D = -1,
369 int confId3D = 0, bool sanitize = true) {
371 params.nameRecord = nameRecord;
372 params.confId2D = confId2D;
373 params.confId3D = confId3D;
374 params.parseParameters.sanitize = sanitize;
375 dp_supplier.reset(
376 new v2::FileParsers::TDTMolSupplier(inStream, takeOwnership, params));
377 }
378 TDTMolSupplier() { dp_supplier.reset(new ContainedType()); }
379 void setData(const std::string &text, const std::string &nameRecord = "",
380 int confId2D = -1, int confId3D = 0, bool sanitize = true) {
381 PRECONDITION(dp_supplier, "no supplier");
383 params.nameRecord = nameRecord;
384 params.confId2D = confId2D;
385 params.confId3D = confId3D;
386 params.parseParameters.sanitize = sanitize;
387 static_cast<ContainedType *>(dp_supplier.get())->setData(text, params);
388 }
389 void moveTo(unsigned int idx) {
390 PRECONDITION(dp_supplier, "no supplier");
391 static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
392 }
393 ROMol *operator[](unsigned int idx) {
394 PRECONDITION(dp_supplier, "no supplier");
395 return static_cast<ContainedType *>(dp_supplier.get())
396 ->
397 operator[](idx)
398 .release();
399 }
400 /*! \brief returns the text block for a particular item
401 *
402 * \param idx - which item to return
403 */
404 std::string getItemText(unsigned int idx) {
405 PRECONDITION(dp_supplier, "no supplier");
406 return static_cast<ContainedType *>(dp_supplier.get())->getItemText(idx);
407 }
408 unsigned int length() {
409 PRECONDITION(dp_supplier, "no supplier");
410 return static_cast<ContainedType *>(dp_supplier.get())->length();
411 }
412};
413
414//! Deprecated, will be removed in 2024.09 release
416 public:
417 explicit PDBMolSupplier(std::istream *inStream, bool takeOwnership = true,
418 bool sanitize = true, bool removeHs = true,
419 unsigned int flavor = 0,
420 bool proximityBonding = true) {
422 params.sanitize = sanitize;
423 params.removeHs = removeHs;
424 params.flavor = flavor;
425 params.proximityBonding = proximityBonding;
426 dp_supplier.reset(
427 new v2::FileParsers::PDBMolSupplier(inStream, takeOwnership, params));
428 }
429 explicit PDBMolSupplier(const std::string &fname, bool sanitize = true,
430 bool removeHs = true, unsigned int flavor = 0,
431 bool proximityBonding = true) {
433 params.sanitize = sanitize;
434 params.removeHs = removeHs;
435 params.flavor = flavor;
436 params.proximityBonding = proximityBonding;
437 dp_supplier.reset(new v2::FileParsers::PDBMolSupplier(fname, params));
438 }
439};
440
441#ifdef RDK_BUILD_MAEPARSER_SUPPORT
442//! lazy file parser for MAE files
444 /**
445 * Due to maeparser's shared_ptr<istream> Reader interface, MaeMolSupplier
446 * always requires taking ownership of the istream ptr, as the shared ptr will
447 * always clear it upon destruction.
448 */
449
450 public:
451 using ContainedType = v2::FileParsers::MaeMolSupplier;
452 MaeMolSupplier() { dp_supplier.reset(new ContainedType()); }
453
454 explicit MaeMolSupplier(std::shared_ptr<std::istream> inStream,
455 bool sanitize = true, bool removeHs = true) {
456 v2::FileParsers::MaeMolSupplierParams params;
457 params.sanitize = sanitize;
458 params.removeHs = removeHs;
459 dp_supplier.reset(new ContainedType(inStream, params));
460 }
461
462 explicit MaeMolSupplier(std::istream *inStream, bool takeOwnership = true,
463 bool sanitize = true, bool removeHs = true) {
464 v2::FileParsers::MaeMolSupplierParams params;
465 params.sanitize = sanitize;
466 params.removeHs = removeHs;
467 dp_supplier.reset(new ContainedType(inStream, takeOwnership, params));
468 }
469
470 explicit MaeMolSupplier(const std::string &fname, bool sanitize = true,
471 bool removeHs = true) {
472 v2::FileParsers::MaeMolSupplierParams params;
473 params.sanitize = sanitize;
474 params.removeHs = removeHs;
475 dp_supplier.reset(new ContainedType(fname, params));
476 }
477 void moveTo(unsigned int idx) {
478 PRECONDITION(dp_supplier, "no supplier");
479 static_cast<ContainedType *>(dp_supplier.get())->moveTo(idx);
480 }
481 RWMol *operator[](unsigned int idx) {
482 PRECONDITION(dp_supplier, "no supplier");
483 return static_cast<ContainedType *>(dp_supplier.get())
484 ->
485 operator[](idx)
486 .release();
487 }
488 unsigned int length() {
489 PRECONDITION(dp_supplier, "no supplier");
490 return static_cast<ContainedType *>(dp_supplier.get())->length();
491 }
492
493 void setData(const std::string &text, bool sanitize = true,
494 bool removeHs = true) {
495 PRECONDITION(dp_supplier, "no supplier");
496 v2::FileParsers::MaeMolSupplierParams params;
497 params.sanitize = sanitize;
498 params.removeHs = removeHs;
499 static_cast<ContainedType *>(dp_supplier.get())->setData(text, params);
500 }
501};
502#endif // RDK_BUILD_MAEPARSER_SUPPORT
503
504#if 0
505
506//! This class is still a bit experimental and the public API may change
507//! in future releases.
509 : public MultithreadedMolSupplier {
510 public:
511 explicit MultithreadedSDMolSupplier(
512 const std::string &fileName, bool sanitize = true, bool removeHs = true,
513 bool strictParsing = true, unsigned int numWriterThreads = 1,
514 size_t sizeInputQueue = 5, size_t sizeOutputQueue = 5);
515
516 explicit MultithreadedSDMolSupplier(
517 std::istream *inStream, bool takeOwnership = true, bool sanitize = true,
518 bool removeHs = true, bool strictParsing = true,
519 unsigned int numWriterThreads = 1, size_t sizeInputQueue = 5,
520 size_t sizeOutputQueue = 5);
521
522 MultithreadedSDMolSupplier();
523 ~MultithreadedSDMolSupplier() override;
524 void init() override {}
525
526 void checkForEnd();
527 bool getEnd() const override;
528 void setProcessPropertyLists(bool val) { df_processPropertyLists = val; }
529 bool getProcessPropertyLists() const { return df_processPropertyLists; }
530 bool getEOFHitOnRead() const { return df_eofHitOnRead; }
531
532 //! reads next record and returns whether or not EOF was hit
533 bool extractNextRecord(std::string &record, unsigned int &lineNum,
534 unsigned int &index) override;
535 void readMolProps(RWMol *mol, std::istringstream &inStream);
536 //! parses the record and returns the resulting molecule
537 RWMol *processMoleculeRecord(const std::string &record,
538 unsigned int lineNum) override;
539
540 private:
541 void initFromSettings(bool takeOwnership, bool sanitize, bool removeHs,
542 bool strictParsing, unsigned int numWriterThreads,
543 size_t sizeInputQueue, size_t sizeOutputQueue);
544
545 private:
546 bool df_end = false; //!< have we reached the end of the file?
547 int d_line = 0; //!< line number we are currently on
548 bool df_sanitize = true, df_removeHs = true, df_strictParsing = true;
549 bool df_processPropertyLists = true;
550 bool df_eofHitOnRead = false;
551 unsigned int d_currentRecordId = 1; //!< current record id
552};
553
554//! This class is still a bit experimental and the public API may change
555//! in future releases.
557 : public MultithreadedMolSupplier {
558 public:
559 explicit MultithreadedSmilesMolSupplier(
560 const std::string &fileName, const std::string &delimiter = " \t",
561 int smilesColumn = 0, int nameColumn = 1, bool titleLine = true,
562 bool sanitize = true, unsigned int numWriterThreads = 1,
563 size_t sizeInputQueue = 5, size_t sizeOutputQueue = 5);
564
565 explicit MultithreadedSmilesMolSupplier(
566 std::istream *inStream, bool takeOwnership = true,
567 const std::string &delimiter = " \t", int smilesColumn = 0,
568 int nameColumn = 1, bool titleLine = true, bool sanitize = true,
569 unsigned int numWriterThreads = 1, size_t sizeInputQueue = 5,
570 size_t sizeOutputQueue = 5);
571 MultithreadedSmilesMolSupplier();
572 ~MultithreadedSmilesMolSupplier() override;
573
574 void init() override {}
575 //! returns df_end
576 bool getEnd() const override;
577 //! reads and processes the title line
578 void processTitleLine();
579 //! reads next record and returns whether or not EOF was hit
580 bool extractNextRecord(std::string &record, unsigned int &lineNum,
581 unsigned int &index) override;
582 //! parses the record and returns the resulting molecule
583 ROMol *processMoleculeRecord(const std::string &record,
584 unsigned int lineNum) override;
585
586 private:
587 void initFromSettings(bool takeOwnership, const std::string &delimiter,
588 int smilesColumn, int nameColumn, bool titleLine,
589 bool sanitize, unsigned int numWriterThreads,
590 size_t sizeInputQueue, size_t sizeOutputQueue);
591
592 private:
593 bool df_end = false; //!< have we reached the end of the file?
594 int d_line = 0; //!< line number we are currently on
595 std::string d_delim; //!< the delimiter string
596 bool df_sanitize = true; //!< sanitize molecules before returning them?
597 STR_VECT d_props; //!< vector of property names
598 bool df_title = true; //!< do we have a title line?
599 int d_smi = 0; //!< column id for the smile string
600 int d_name = 1; //!< column id for the name
601 unsigned int d_currentRecordId = 1; //!< current record id
602};
603
604#endif
605} // namespace v1
606} // namespace RDKit
607
608#endif
#define PRECONDITION(expr, mess)
Definition Invariant.h:109
ForwardSDMolSupplier(std::istream *inStream, bool takeOwnership=true, bool sanitize=true, bool removeHs=true, bool strictParsing=false)
std::unique_ptr< v2::FileParsers::MolSupplier > dp_supplier
Deprecated, will be removed in 2024.09 release.
PDBMolSupplier(const std::string &fname, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
PDBMolSupplier(std::istream *inStream, bool takeOwnership=true, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
ROMol * operator[](unsigned int idx)
void moveTo(unsigned int idx)
SDMolSupplier(std::istream *inStream, bool takeOwnership=true, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
void setStreamIndices(const std::vector< std::streampos > &locs)
void setData(const std::string &text, bool sanitize=true, bool removeHs=true)
std::string getItemText(unsigned int idx)
returns the text block for a particular item
void setData(const std::string &text, bool sanitize, bool removeHs, bool strictParsing)
SDMolSupplier(const std::string &fileName, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
lazy file parser for Smiles tables
SmilesMolSupplier(std::istream *inStream, bool takeOwnership=true, const std::string &delimiter=" \t", int smilesColumn=0, int nameColumn=1, bool titleLine=true, bool sanitize=true)
void moveTo(unsigned int idx)
void setData(const std::string &text, const std::string &delimiter=" ", int smilesColumn=0, int nameColumn=1, bool titleLine=true, bool sanitize=true)
ROMol * operator[](unsigned int idx)
SmilesMolSupplier(const std::string &fileName, const std::string &delimiter=" \t", int smilesColumn=0, int nameColumn=1, bool titleLine=true, bool sanitize=true)
std::string getItemText(unsigned int idx)
returns the text block for a particular item
lazy file parser for TDT files
std::string getItemText(unsigned int idx)
returns the text block for a particular item
TDTMolSupplier(const std::string &fileName, const std::string &nameRecord="", int confId2D=-1, int confId3D=0, bool sanitize=true)
ROMol * operator[](unsigned int idx)
void setData(const std::string &text, const std::string &nameRecord="", int confId2D=-1, int confId3D=0, bool sanitize=true)
TDTMolSupplier(std::istream *inStream, bool takeOwnership=true, const std::string &nameRecord="", int confId2D=-1, int confId3D=0, bool sanitize=true)
void moveTo(unsigned int idx)
Deprecated, will be removed in 2024.09 release.
lazy file parser for Smiles tables
lazy file parser for TDT files
#define RDKIT_FILEPARSERS_EXPORT
Definition export.h:161
RDKIT_GRAPHMOL_EXPORT ROMol * removeHs(const ROMol &mol, bool implicitOnly=false, bool updateExplicitCount=false, bool sanitize=true)
returns a copy of a molecule with hydrogens removed
Std stuff.
std::vector< std::string > STR_VECT
Definition Dict.h:29
bool rdvalue_is(const RDValue_cast_t)
v2::SmilesParse::SmilesParserParams parseParameters
v2::SmilesParse::SmilesParserParams parseParameters