RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
SynthonSpace.h
Go to the documentation of this file.
1//
2// Copyright (C) David Cosgrove 2024.
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// This file and others here contain an implementation of
11// synthonspace substructure search similar to that described in
12// 'Fast Substructure Search in Combinatorial Library Spaces',
13// Thomas Liphardt and Thomas Sander,
14// J. Chem. Inf. Model. 2023, 63, 16, 5133–5141
15// https://doi.org/10.1021/acs.jcim.3c00290
16
17#ifndef RDKIT_SYNTHONSPACE_H
18#define RDKIT_SYNTHONSPACE_H
19
20/*! \file SynthonSpace.h
21
22 \brief contains a class for searching combinatorial libraries in
23 Synthon format such as Enamine REAL.
24
25 \b Note that this functionality is experimental and the API may change
26 in future releases.
27*/
28
29#include <limits>
30#include <map>
31#include <sstream>
32#include <string>
33#include <vector>
34
35#include <boost/dynamic_bitset.hpp>
36
37#include <RDGeneral/export.h>
44
45namespace RDKit {
46class ROMol;
47
48namespace RascalMCES {
49struct RascalOptions;
50}
51
52namespace SynthonSpaceSearch {
53
54class Synthon;
55
57 friend class SynthonSet;
63
64 public:
65 explicit SynthonSpace() = default;
66 ~SynthonSpace() = default;
67 SynthonSpace(const SynthonSpace &other) = delete;
68 SynthonSpace &operator=(const SynthonSpace &other) = delete;
69 /*!
70 * Get the number of different reactions in the SynthonSpace.
71 *
72 * @return int
73 */
74 size_t getNumReactions() const;
75
76 /*!
77 * Get the number of unique synthons in the SynthonSpace. Synthons
78 * can be used in more than 1 reaction.
79 *
80 * @return int
81 */
82 size_t getNumSynthons() const;
83 /*!
84 * Get a list of the names of all the reactions in the SynthonSpace.
85 *
86 * @return
87 */
88 std::vector<std::string> getReactionNames() const;
89 std::shared_ptr<SynthonSet> getReaction(std::string reactionName);
90 // The Synthons have a PatternFingerprint for screening in substructure
91 // searches. It's important that the screening process creates ones
92 // of the same size, so this finds out what size that is.
93 unsigned int getPatternFPSize() const;
94 // Likewise for the fingerprints used for similarity searching
95 unsigned int getFPSize() const;
96
97 std::string getInputFileName() const;
98
99 /*!
100 * Get the total number of products that the SynthonSpace could produce.
101 *
102 * @return std::int64_t
103 */
104 std::uint64_t getNumProducts() const;
105
106 /*!
107 * Get the info string for the fingerprint generator used to
108 * generate the stored fingerprints, so the user can query with
109 * the same type.
110 *
111 * @return
112 */
113 std::string getSynthonFingerprintType() const { return d_fpType; }
114
115 /*!
116 * Perform a substructure search with the given query molecule across
117 * the synthonspace library. Duplicate SMILES strings produced by
118 * different reactions will be returned.
119 *
120 * @param query : query molecule
121 * @param matchParams: (optional) settings for the substructure search
122 * @param params : (optional) settings for the search
123 * @return : the hits as a SearchResults object.
124 */
126 const ROMol &query,
129
130 /*!
131 * Perform a substructure search with the given query molecule across
132 * the synthonspace library. Duplicate SMILES strings produced by
133 * different reactions will be returned. Search results are returned
134 * incrementally through the provided callback, which will receive
135 * at most `toTryChunkSize` sized lists of ROMols at a time, thereby
136 * reducing the amount of memory required to hold search results.
137 *
138 * @param query : query molecule
139 * @param callback: user-provided callback receiving chunks of ROMols.
140 * @param matchParams: (optional) settings for the substructure search
141 * @param params : (optional) settings for the search
142 */
144 const ROMol &query, const SearchResultCallback &callback,
147
148 /*!
149 * Perform a substructure search with the given generalized query
150 * molecule across the synthonspace library. Duplicate SMILES strings
151 * produced by different reactions will be returned.
152 *
153 * @param query : query molecule
154 * @param matchParams: (optional) settings for the substructure search
155 * @param params : (optional) settings for the search
156 * @return : the hits as a SearchResults object.
157 */
162
163 /*! Take the contents of params.possibleHitsFile, which is assumed to have
164 * been written by an earlier search, and extract those that are indeed
165 * hits. It makes sense that params is the same as the one used to
166 * generate the possible hits, but this is not essential. You could search
167 * at a higher similarity threshold than used to create the possible hits,
168 * for example.
169 * Duplicate SMILES strings produced by different reactions will
170 * be returned.
171 *
172 * @param query : query molecule
173 * @param matchParams: settings for the substructure search
174 * @param params : settings for the search
175 * @param startLine: the first line of the file to be considered
176 * @param finishLine: (optional) the last line of the file to be considered.
177 * @return : the hits as a SearchResults object.
178 */
180 const ROMol &query, const SubstructMatchParameters &matchParams,
181 const SynthonSpaceSearchParams &params, std::uint64_t startLine,
182 std::uint64_t finishLine = std::numeric_limits<std::uint64_t>::max());
183
184 /*! Take the contents of params.possibleHitsFile, which is assumed to have
185 * been written by an earlier search, and extract those that are indeed
186 * hits. It makes sense that params is the same as the one used to
187 * generate the possible hits, but this is not essential. You could search
188 * at a higher similarity threshold than used to create the possible hits,
189 * for example.
190 * Duplicate SMILES strings produced by different reactions will
191 * be returned.
192 *
193 * @param query : query molecule
194 * @param matchParams: settings for the substructure search
195 * @param params : settings for the search
196 * @param startLine: the first line of the file to be considered
197 * @param finishLine: (optional) the last line of the file to be considered.
198 * @return : the hits as a SearchResults object.
199 */
202 const SubstructMatchParameters &matchParams,
203 const SynthonSpaceSearchParams &params, std::uint64_t startLine,
204 std::uint64_t finishLine = std::numeric_limits<std::uint64_t>::max());
205
206 /*!
207 * Perform a fingerprint similarity search with the given query molecule
208 * across the synthonspace library. Duplicate SMILES strings produced by
209 * different reactions will be returned.
210 * @param query : query molecule
211 * @param fpGen: a FingerprintGenerator object that will provide the
212 * fingerprints for the similarity calculation
213 * @param params : (optional) settings for the search
214 * @return : the hits as a SearchResults object.
215 */
217 const ROMol &query, const FingerprintGenerator<std::uint64_t> &fpGen,
219
220 // Perform a fingerprint similarity search with the given query molecule
221 /*!
222 * Perform a fingerprint similarity search with the given query molecule
223 * across the synthonspace library. Duplicate SMILES strings produced by
224 * different reactions will be returned. Search results are returned
225 * incrementally through the provided callback, which will receive
226 * at most `toTryChunkSize` sized lists of ROMols at a time, thereby
227 * reducing the amount of memory required to hold search results.
228 *
229 * @param query : query molecule
230 * @param fpGen: a FingerprintGenerator object that will provide the
231 * fingerprints for the similarity calculation
232 * @param callback: user-provided callback receiving chunks of ROMols.
233 * @param params : (optional) settings for the search
234 */
236 const ROMol &query, const FingerprintGenerator<std::uint64_t> &fpGen,
237 const SearchResultCallback &callback,
239
240 /*! Take the contents of params.possibleHitsFile, which is assumed to have
241 * been written by an earlier search, and extract those that are indeed
242 * hits. It makes sense that params is the same as the one used to
243 * generate the possible hits, but this is not essential. You could search
244 * at a higher similarity threshold than used to create the possible hits,
245 * for example.
246 * Duplicate SMILES strings produced by different reactions will
247 * be returned.
248 *
249 * @param query : query molecule
250 * @param fpGen: a FingerprintGenerator object that will provide the
251 * fingerprints for the similarity calculation
252 * @param params : settings for the search
253 * @param startLine: the first line of the file to be considered
254 * @param finishLine: (optional) the last line of the file to be considered.
255 * @return : the hits as a SearchResults object.
256 */
258 const ROMol &query, const FingerprintGenerator<std::uint64_t> &fpGen,
259 const SynthonSpaceSearchParams &params, std::uint64_t startLine,
260 std::uint64_t finishLine = std::numeric_limits<std::uint64_t>::max());
261
262 // Perform a RASCAL similarity search with the given query molecule
263 // across the synthonspace library. Duplicate SMILES strings produced by
264 // different reactions will be returned.
265 /*! Perform a RASCAL similarity search with the given query molecule
266 * across the synthonspace library. Duplicate SMILES strings produced by
267 * different reactions will be returned.
268 *
269 * @param query : query molecule
270 * @param rascalOptions: RASCAL options. The similarityThreshold value
271 * in the rascalOptions will be used rather than
272 * params.similarityCutoff,
273 * but params.fragSimilarityAdjuster will be used
274 * to adjust the threshold for the fragment
275 * comparisons.
276 * @param params : (optional) settings for the search
277 * @return : the hits as a SearchResults object.
278 */
280 const ROMol &query, const RascalMCES::RascalOptions &rascalOptions,
282
283 // Perform a RASCAL similarity search with the given query molecule
284 /* across the synthonspace library. Duplicate SMILES strings produced by
285 * different reactions will be returned. Search results are returned
286 * incrementally through the provided callback, which will receive
287 * at most `toTryChunkSize` sized lists of ROMols at a time, thereby
288 * reducing the amount of memory required to hold search results.
289 *
290 * @param query : query molecule
291 * @param callback: user-provided callback receiving chunks of ROMols.
292 * @param rascalOptions: RASCAL options. The similarityThreshold value
293 * in the rascalOptions will be used rather than
294 * params.similarityCutoff,
295 * but params.fragSimilarityAdjuster will be used
296 * to adjust the threshold for the fragment
297 * comparisons.
298 * @param params : (optional) settings for the search
299 */
301 const ROMol &query, const RascalMCES::RascalOptions &rascalOptions,
302 const SearchResultCallback &callback,
304
305 /*! Take the contents of params.possibleHitsFile, which is assumed to have
306 * been written by an earlier search, and extract those that are indeed
307 * hits. It makes sense that params is the same as the one used to
308 * generate the possible hits, but this is not essential. You could search
309 * at a higher similarity threshold than used to create the possible hits,
310 * for example.
311 * Duplicate SMILES strings produced by different reactions will
312 * be returned.
313 *
314 * @param query : query molecule
315 * @param rascalOptions: RASCAL options. The similarityThreshold value
316 * in the rascalOptions will be used rather than
317 * params.similarityCutoff,
318 * but params.fragSimilarityAdjuster will be used
319 * to adjust the threshold for the fragment
320 * comparisons.
321 * @param params : settings for the search
322 * @param startLine: the first line of the file to be considered
323 * @param finishLine: (optional) the last line of the file to be considered.
324 * @return : the hits as a SearchResults object.
325 */
327 const ROMol &query, const RascalMCES::RascalOptions &rascalOptions,
328 const SynthonSpaceSearchParams &params, std::uint64_t startLine,
329 std::uint64_t finishLine = std::numeric_limits<std::uint64_t>::max());
330
331 /*! Perform a shape similarity search with the given query molecule
332 * across the synthonspace library. Duplicate SMILES strings produced by
333 * different reactions will be returned. Requires a query with at least
334 * 1 3D conformer. Only the first conformer will be used in the search.
335 *
336 * @param query : query molecule
337 * @param params : (optional) settings for the search
338 * @return : the hits as a SearchResults object.
339 */
341 const ROMol &query,
343
344 /*! Perform a shape similarity search with the given query molecule
345 * across the synthonspace library. Duplicate SMILES strings produced by
346 * different reactions will be returned. Requires a query with at least
347 * 1 3D conformer. Only the first conformer will be used in the search.
348 * The query can have 2 non-connected fragments. An exception will be
349 * thrown if there are more than 2 fragments.
350 *
351 * @param query : query molecule
352 * @param callback: user-provided callback receiving chunks of ROMols.
353 * @param params : (optional) settings for the search
354 */
356 const ROMol &query, const SearchResultCallback &callback,
358
359 /*! Take the contents of params.possibleHitsFile, which is assumed to have
360 * been written by an earlier search, and extract those that are indeed
361 * hits. It makes sense that params is the same as the one used to
362 * generate the possible hits, but this is not essential. You could search
363 * at a higher similarity threshold than used to create the possible hits,
364 * for example.
365 * Duplicate SMILES strings produced by different reactions will
366 * be returned. Requires a query with at least 1 3D conformer. Only
367 * the first conformer will be used in the search.
368 * The query can have 2 non-connected fragments. An exception will be
369 * thrown if there are more than 2 fragments.
370 *
371 * @param query : query molecule
372 * @param params : settings for the search
373 * @param startLine: the first line of the file to be considered
374 * @param finishLine: (optional) the last line of the file to be considered.
375 * @return : the hits as a SearchResults object.
376 */
378 const ROMol &query, const SynthonSpaceSearchParams &params,
379 std::uint64_t startLine,
380 std::uint64_t finishLine = std::numeric_limits<std::uint64_t>::max());
381
382 /*!
383 *
384 * @param inFilename: name of the file containing the synthon-based library.
385 *
386 * The original format is:
387 * all lines are tab-separated
388 * first line:SMILES synton_id synton# reaction_id
389 * Note the spelling "synton" from the original paper/example file.
390 * Subsequent lines have a single reagent e.g.
391 * OCC([U])=NN=[Np] 1-1 0 triazole-1
392 * C1CCCC1N([Pu])[U] 2-1 1 triazole-1
393 * CC1CCN(C1)C(=[Np])[Pu] 3-1 2 triazole-1
394 *
395 * Other acceptable formats are as above, but with a 5th column "release":
396 * SMILES synton_id synton# reaction_id release
397 *
398 * or a comma-separated equivalent of the first format:
399 * SMILES,synton_id,synton_role,reaction_id
400 * but with the 3rd column named differently but with the same meaning.
401 * The formatting of the first 2 formats has been relaxed such that any
402 * whitespace may be used as the field separator, but a tab is tried first
403 * so that a tab-separated file may have spaces in the columns.
404 *
405 * Attachment points are U, Np, Pu and Am for up to 4 synthons per reaction.
406 * A product is created by taking a synthon from each synton# value and
407 * combining by replacing matching trans-uranic elements and replacing them
408 * with a direct bond of the appropriate type.
409 * A more (for RDKit) conventional connection flag of isotope labelled
410 * dummy atoms is also accepted ([1*] etc.).
411 * Throws a std::runtime_error if it doesn't think the format is correct,
412 * which it does by checking that the first line is as above and subsequent
413 * lines have appropriate number of fields.
414 * If it receives a SIGINT, returns cancelled=true.
415 */
416 void readTextFile(const std::string &inFilename, bool &cancelled);
417 void readStream(std::istream &is, bool &cancelled);
418
419 /*!
420 * Writes to a binary DB File in our format.
421 *
422 * @param outFilename: the name of the file to write.
423 */
424 void writeDBFile(const std::string &outFilename) const;
425
426 /*!
427 * Reads from a binary DB File in our format.
428 *
429 * @param inFilename: the name of the file to read.
430 * @param numThreads: number of threads to use in reading. If negative,
431 * adds the number to the number of hardware threads
432 * available.
433 */
434 void readDBFile(const std::string &inFilename, int numThreads = 1);
435
436 /*!
437 * Write a summary of the SynthonSpace to given stream.
438 *
439 * @param os: stream
440 */
441 void summarise(std::ostream &os);
442
443 /*!
444 * Writes the enumerated library to file in SMILES format
445 * (1 compound per line, SMILES name)
446 *
447 * @param outFilename: name of the file to write
448 */
449 void writeEnumeratedFile(const std::string &outFilename) const;
450 void enumerateToStream(std::ostream &os) const;
451
452 /*!
453 * Create the fingerprints for the synthons ready for fingerprint searches.
454 * Will be done by the fingerprint search if not done ahead of time.
455 *
456 * @param fpGen: a fingerprint generator of the appropriate type
457 */
460 unsigned int progressBarWidth = 0);
461
462 /*!
463 * Create conformers for the synthons ready for shape searching. If a synthon
464 * has unspecified stereochemistry, all possibilities will be enumerated and
465 * shapes generated for each.
466 *
467 * @param shapeBuildParams: controls the shape generation for each synthon
468 */
469 void buildSynthonShapes(bool &cancelled, ShapeBuildParams &shapeBuildParams);
470
471 void reportSynthonUsage(std::ostream &os) const;
472 std::uint64_t getNumSynthonsWithShapes() const;
473
474 protected:
475 unsigned int getMaxNumSynthons() const { return d_maxNumSynthons; }
476 unsigned int getMaxNumConnectors() const;
477 bool hasFingerprints() const;
478
480 // Return whether the space contains a ring-forming reaction.
481 bool getHasRingFormer() const { return d_hasRingFormer; }
482
483 unsigned int getNumConformers() const;
484
485 // Take the SMILES for a Synthon and if it's not in
486 // d_synthonPool make it and add it. If it is in the pool,
487 // just look it up. Either way, return a pointer to the
488 // Synthon.
489 Synthon *addSynthonToPool(const std::string &smiles);
490 std::shared_ptr<SynthonSet> addReactionToPool(
491 const std::string &reactionName);
492
493 // Just do the lookup, and return nullptr if not found.
494 Synthon *getSynthonFromPool(const std::string &smiles) const;
495
496 private:
497 std::string d_fileName;
498 // The reactions, keyed on their IDs as the first value
499 // in the pair.
500 std::vector<std::pair<std::string, std::shared_ptr<SynthonSet>>> d_reactions;
501 // Keep the value of the maximum number of synthon sets used by
502 // any of the reactions. There's no point fragmenting any
503 // query into more than this number of fragments. Shouldn't
504 // ever be higher than 4 at present.
505 unsigned int d_maxNumSynthons{0};
506 std::uint64_t d_numProducts{0};
507
508 // This is actually 1000 * major version + 10 * minor
509 // and hence the full version number.
510 std::int32_t d_fileMajorVersion{-1};
511
512 // The pool of all synthons, keyed on SMILES string. Synthons
513 // are frequently re-used in different reactions, so this means
514 // they're only stored once. They will be sorted and searched
515 // for via first, which is its SMILES string.
516 std::vector<std::pair<std::string, std::unique_ptr<Synthon>>> d_synthonPool;
517
518 // This maps the Synthons (keyed by its SMILES) to the reactions/SynthonSets
519 // they're in.
520 std::unordered_map<std::string, std::vector<SynthonSet *>> d_synthonReactions;
521
522 // For the fingerprint similarity search, this records the generator
523 // used for creating synthon fingerprints that are read from a binary file.
524 std::string d_fpType;
525 // For the shape similarity search, this records the number of conformers
526 // used. It's not necessarily the same as the number of conformers each
527 // synthon has.
528 unsigned int d_numConformers{0};
529
530 // Whether there is a ring-forming reaction in the space.
531 bool d_hasRingFormer{false};
532
533 SearchResults extendedSearch(const MolBundle &query,
534 const SubstructMatchParameters &matchParams,
535 const SynthonSpaceSearchParams &params);
536 SearchResults extendedSearch(
537 const GeneralizedSubstruct::ExtendedQueryMol::TautomerBundle_T &query,
538 const SubstructMatchParameters &matchParams,
539 const SynthonSpaceSearchParams &params);
540 SearchResults extendedSearch(const TautomerQuery &query,
541 const SubstructMatchParameters &matchParams,
542 const SynthonSpaceSearchParams &params);
543 SearchResults extendedSearch(const MolBundle &query,
544 const SubstructMatchParameters &matchParams,
545 const SynthonSpaceSearchParams &params,
546 std::uint64_t startLine,
547 std::uint64_t finishLine);
548 SearchResults extendedSearch(
549 const GeneralizedSubstruct::ExtendedQueryMol::TautomerBundle_T &query,
550 const SubstructMatchParameters &matchParams,
551 const SynthonSpaceSearchParams &params, std::uint64_t startLine,
552 std::uint64_t finishLine);
553 SearchResults extendedSearch(const TautomerQuery &query,
554 const SubstructMatchParameters &matchParams,
555 const SynthonSpaceSearchParams &params,
556 std::uint64_t startLine,
557 std::uint64_t finishLine);
558
559 // Fill up the d_synthonReactions object, listing all the reactions
560 // each synthon is found in.
561 void fillSynthonReactions();
562 // For each synthon, build a sample molecule for each reaction it's in,
563 // using d_synthonReactions. Return them so the samples for a synthon
564 // are in descending order of size so that when building shapes, we
565 // do it on the smallest available example to save time, by popping
566 // them off the back. If maxSynthonAtoms > 0 and the synthon has
567 // more heavy atoms than that (excluding dummy atoms) it is skipped.
568 // The actual molecules in the SampleMolRecs aren't built until they're
569 // needed, but all the information to do so is captured.
570 void buildSynthonSampleMolecules(
571 unsigned int maxSynthonAtoms,
572 std::vector<std::vector<std::unique_ptr<SampleMolRec>>> &sampleMols)
573 const;
574};
575
576/*!
577 * Convert the text file into the binary DB file in our format.
578 * Equivalent to readTextFile() followed by writeDBFile().
579 * If a fingerprint generator is provided, fingerprints will
580 * be created for all the synthons, which can be time-consuming.
581 * @param inFilename name of the text file to read
582 * @param outFilename name of the binary file to write
583 * @param cancelled whether it received a SIGINT
584 * @param fpGen optional fingerprint generator
585 * @param shapeParams optional parameters for conformer generation
586 */
588 const std::string &inFilename, const std::string &outFilename,
589 bool &cancelled, const FingerprintGenerator<std::uint64_t> *fpGen = nullptr,
590 ShapeBuildParams *shapeParams = nullptr);
591
592/*!
593 * Format an integer with spaces every 3 digits for ease
594 * of reading.
595 *
596 * @return std::string
597 */
599 std::int64_t value);
600
601} // namespace SynthonSpaceSearch
602} // namespace RDKit
603
604#endif // RDKIT_SYNTHONSPACE_H
class that generates same fingerprint style for different output formats
std::string getSynthonFingerprintType() const
void fingerprintSearch(const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SearchResultCallback &callback, const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
void readTextFile(const std::string &inFilename, bool &cancelled)
std::uint64_t getNumSynthonsWithShapes() const
SearchResults substructureSearch(const GeneralizedSubstruct::ExtendedQueryMol &query, const SubstructMatchParameters &matchParams=SubstructMatchParameters(), const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
void shapeSearch(const ROMol &query, const SearchResultCallback &callback, const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
SearchResults substructureSearch(const ROMol &query, const SubstructMatchParameters &matchParams, const SynthonSpaceSearchParams &params, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max())
SearchResults rascalSearch(const ROMol &query, const RascalMCES::RascalOptions &rascalOptions, const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
void buildSynthonShapes(bool &cancelled, ShapeBuildParams &shapeBuildParams)
SearchResults shapeSearch(const ROMol &query, const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
Synthon * addSynthonToPool(const std::string &smiles)
SearchResults fingerprintSearch(const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SynthonSpaceSearchParams &params, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max())
SynthonSpace & operator=(const SynthonSpace &other)=delete
SearchResults rascalSearch(const ROMol &query, const RascalMCES::RascalOptions &rascalOptions, const SynthonSpaceSearchParams &params, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max())
SynthonSpace(const SynthonSpace &other)=delete
void writeEnumeratedFile(const std::string &outFilename) const
void reportSynthonUsage(std::ostream &os) const
SearchResults substructureSearch(const GeneralizedSubstruct::ExtendedQueryMol &query, const SubstructMatchParameters &matchParams, const SynthonSpaceSearchParams &params, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max())
void writeDBFile(const std::string &outFilename) const
std::shared_ptr< SynthonSet > getReaction(std::string reactionName)
void substructureSearch(const ROMol &query, const SearchResultCallback &callback, const SubstructMatchParameters &matchParams=SubstructMatchParameters(), const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
void enumerateToStream(std::ostream &os) const
SearchResults fingerprintSearch(const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
std::shared_ptr< SynthonSet > addReactionToPool(const std::string &reactionName)
void rascalSearch(const ROMol &query, const RascalMCES::RascalOptions &rascalOptions, const SearchResultCallback &callback, const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
void buildSynthonFingerprints(const FingerprintGenerator< std::uint64_t > &fpGen, unsigned int progressBarWidth=0)
unsigned int getMaxNumConnectors() const
void readDBFile(const std::string &inFilename, int numThreads=1)
SearchResults substructureSearch(const ROMol &query, const SubstructMatchParameters &matchParams=SubstructMatchParameters(), const SynthonSpaceSearchParams &params=SynthonSpaceSearchParams())
Synthon * getSynthonFromPool(const std::string &smiles) const
std::vector< std::string > getReactionNames() const
SearchResults shapeSearch(const ROMol &query, const SynthonSpaceSearchParams &params, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max())
void readStream(std::istream &is, bool &cancelled)
#define RDKIT_SYNTHONSPACESEARCH_EXPORT
Definition export.h:731
std::function< bool(std::vector< std::unique_ptr< ROMol > > &)> SearchResultCallback
RDKIT_SYNTHONSPACESEARCH_EXPORT std::string formattedIntegerString(std::int64_t value)
RDKIT_SYNTHONSPACESEARCH_EXPORT void convertTextToDBFile(const std::string &inFilename, const std::string &outFilename, bool &cancelled, const FingerprintGenerator< std::uint64_t > *fpGen=nullptr, ShapeBuildParams *shapeParams=nullptr)
Std stuff.