![]() |
RDKit
Open-source cheminformatics and machine learning.
|
#include <SynthonSpace.h>
Public Member Functions | |
| SynthonSpace ()=default | |
| ~SynthonSpace ()=default | |
| SynthonSpace (const SynthonSpace &other)=delete | |
| SynthonSpace & | operator= (const SynthonSpace &other)=delete |
| size_t | getNumReactions () const |
| size_t | getNumSynthons () const |
| std::vector< std::string > | getReactionNames () const |
| std::shared_ptr< SynthonSet > | getReaction (std::string reactionName) |
| unsigned int | getPatternFPSize () const |
| unsigned int | getFPSize () const |
| std::string | getInputFileName () const |
| std::uint64_t | getNumProducts () const |
| std::string | getSynthonFingerprintType () const |
| SearchResults | substructureSearch (const ROMol &query, const SubstructMatchParameters &matchParams=SubstructMatchParameters(), const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| void | substructureSearch (const ROMol &query, const SearchResultCallback &callback, const SubstructMatchParameters &matchParams=SubstructMatchParameters(), const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| SearchResults | substructureSearch (const GeneralizedSubstruct::ExtendedQueryMol &query, const SubstructMatchParameters &matchParams=SubstructMatchParameters(), const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| SearchResults | substructureSearch (const ROMol &query, const SubstructMatchParameters &matchParams, const SynthonSpaceSearchParams ¶ms, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max()) |
| SearchResults | substructureSearch (const GeneralizedSubstruct::ExtendedQueryMol &query, const SubstructMatchParameters &matchParams, const SynthonSpaceSearchParams ¶ms, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max()) |
| SearchResults | fingerprintSearch (const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| void | fingerprintSearch (const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SearchResultCallback &callback, const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| SearchResults | fingerprintSearch (const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SynthonSpaceSearchParams ¶ms, 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 ¶ms=SynthonSpaceSearchParams()) |
| void | rascalSearch (const ROMol &query, const RascalMCES::RascalOptions &rascalOptions, const SearchResultCallback &callback, const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| SearchResults | rascalSearch (const ROMol &query, const RascalMCES::RascalOptions &rascalOptions, const SynthonSpaceSearchParams ¶ms, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max()) |
| SearchResults | shapeSearch (const ROMol &query, const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| void | shapeSearch (const ROMol &query, const SearchResultCallback &callback, const SynthonSpaceSearchParams ¶ms=SynthonSpaceSearchParams()) |
| SearchResults | shapeSearch (const ROMol &query, const SynthonSpaceSearchParams ¶ms, std::uint64_t startLine, std::uint64_t finishLine=std::numeric_limits< std::uint64_t >::max()) |
| void | readTextFile (const std::string &inFilename, bool &cancelled) |
| void | readStream (std::istream &is, bool &cancelled) |
| void | writeDBFile (const std::string &outFilename) const |
| void | readDBFile (const std::string &inFilename, int numThreads=1) |
| void | summarise (std::ostream &os) |
| void | writeEnumeratedFile (const std::string &outFilename) const |
| void | enumerateToStream (std::ostream &os) const |
| void | buildSynthonFingerprints (const FingerprintGenerator< std::uint64_t > &fpGen, unsigned int progressBarWidth=0) |
| void | buildSynthonShapes (bool &cancelled, ShapeBuildParams &shapeBuildParams) |
| void | reportSynthonUsage (std::ostream &os) const |
| std::uint64_t | getNumSynthonsWithShapes () const |
Protected Member Functions | |
| unsigned int | getMaxNumSynthons () const |
| unsigned int | getMaxNumConnectors () const |
| bool | hasFingerprints () const |
| bool | hasAddAndSubstractFingerprints () const |
| bool | getHasRingFormer () const |
| unsigned int | getNumConformers () const |
| Synthon * | addSynthonToPool (const std::string &smiles) |
| std::shared_ptr< SynthonSet > | addReactionToPool (const std::string &reactionName) |
| Synthon * | getSynthonFromPool (const std::string &smiles) const |
Friends | |
| class | SynthonSet |
| class | SynthonSpaceSearcher |
| class | SynthonSpaceFingerprintSearcher |
| class | SynthonSpaceRascalSearcher |
| class | SynthonSpaceSubstructureSearcher |
| class | SynthonSpaceShapeSearcher |
Definition at line 56 of file SynthonSpace.h.
|
explicitdefault |
Referenced by operator=(), and SynthonSpace().
|
default |
|
delete |
References SynthonSpace().
|
protected |
|
protected |
| void RDKit::SynthonSpaceSearch::SynthonSpace::buildSynthonFingerprints | ( | const FingerprintGenerator< std::uint64_t > & | fpGen, |
| unsigned int | progressBarWidth = 0 ) |
Create the fingerprints for the synthons ready for fingerprint searches. Will be done by the fingerprint search if not done ahead of time.
| fpGen | a fingerprint generator of the appropriate type |
| void RDKit::SynthonSpaceSearch::SynthonSpace::buildSynthonShapes | ( | bool & | cancelled, |
| ShapeBuildParams & | shapeBuildParams ) |
Create conformers for the synthons ready for shape searching. If a synthon has unspecified stereochemistry, all possibilities will be enumerated and shapes generated for each.
| shapeBuildParams | controls the shape generation for each synthon |
| void RDKit::SynthonSpaceSearch::SynthonSpace::enumerateToStream | ( | std::ostream & | os | ) | const |
| void RDKit::SynthonSpaceSearch::SynthonSpace::fingerprintSearch | ( | const ROMol & | query, |
| const FingerprintGenerator< std::uint64_t > & | fpGen, | ||
| const SearchResultCallback & | callback, | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a fingerprint similarity search with the given query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned. Search results are returned incrementally through the provided callback, which will receive at most toTryChunkSize sized lists of ROMols at a time, thereby reducing the amount of memory required to hold search results.
| query | : query molecule |
| fpGen | a FingerprintGenerator object that will provide the fingerprints for the similarity calculation |
| callback | user-provided callback receiving chunks of ROMols. |
| params | : (optional) settings for the search |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::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() ) |
Take the contents of params.possibleHitsFile, which is assumed to have been written by an earlier search, and extract those that are indeed hits. It makes sense that params is the same as the one used to generate the possible hits, but this is not essential. You could search at a higher similarity threshold than used to create the possible hits, for example. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| fpGen | a FingerprintGenerator object that will provide the fingerprints for the similarity calculation |
| params | : settings for the search |
| startLine | the first line of the file to be considered |
| finishLine | (optional) the last line of the file to be considered. |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::fingerprintSearch | ( | const ROMol & | query, |
| const FingerprintGenerator< std::uint64_t > & | fpGen, | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a fingerprint similarity search with the given query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| fpGen | a FingerprintGenerator object that will provide the fingerprints for the similarity calculation |
| params | : (optional) settings for the search |
| unsigned int RDKit::SynthonSpaceSearch::SynthonSpace::getFPSize | ( | ) | const |
|
inlineprotected |
Definition at line 481 of file SynthonSpace.h.
| std::string RDKit::SynthonSpaceSearch::SynthonSpace::getInputFileName | ( | ) | const |
|
protected |
|
inlineprotected |
Definition at line 475 of file SynthonSpace.h.
|
protected |
| std::uint64_t RDKit::SynthonSpaceSearch::SynthonSpace::getNumProducts | ( | ) | const |
Get the total number of products that the SynthonSpace could produce.
| size_t RDKit::SynthonSpaceSearch::SynthonSpace::getNumReactions | ( | ) | const |
Get the number of different reactions in the SynthonSpace.
| size_t RDKit::SynthonSpaceSearch::SynthonSpace::getNumSynthons | ( | ) | const |
Get the number of unique synthons in the SynthonSpace. Synthons can be used in more than 1 reaction.
| std::uint64_t RDKit::SynthonSpaceSearch::SynthonSpace::getNumSynthonsWithShapes | ( | ) | const |
| unsigned int RDKit::SynthonSpaceSearch::SynthonSpace::getPatternFPSize | ( | ) | const |
| std::shared_ptr< SynthonSet > RDKit::SynthonSpaceSearch::SynthonSpace::getReaction | ( | std::string | reactionName | ) |
| std::vector< std::string > RDKit::SynthonSpaceSearch::SynthonSpace::getReactionNames | ( | ) | const |
Get a list of the names of all the reactions in the SynthonSpace.
|
inline |
Get the info string for the fingerprint generator used to generate the stored fingerprints, so the user can query with the same type.
Definition at line 113 of file SynthonSpace.h.
|
protected |
|
protected |
|
protected |
|
delete |
References SynthonSpace().
| void RDKit::SynthonSpaceSearch::SynthonSpace::rascalSearch | ( | const ROMol & | query, |
| const RascalMCES::RascalOptions & | rascalOptions, | ||
| const SearchResultCallback & | callback, | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::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() ) |
Take the contents of params.possibleHitsFile, which is assumed to have been written by an earlier search, and extract those that are indeed hits. It makes sense that params is the same as the one used to generate the possible hits, but this is not essential. You could search at a higher similarity threshold than used to create the possible hits, for example. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| rascalOptions | RASCAL options. The similarityThreshold value in the rascalOptions will be used rather than params.similarityCutoff, but params.fragSimilarityAdjuster will be used to adjust the threshold for the fragment comparisons. |
| params | : settings for the search |
| startLine | the first line of the file to be considered |
| finishLine | (optional) the last line of the file to be considered. |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::rascalSearch | ( | const ROMol & | query, |
| const RascalMCES::RascalOptions & | rascalOptions, | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a RASCAL similarity search with the given query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| rascalOptions | RASCAL options. The similarityThreshold value in the rascalOptions will be used rather than params.similarityCutoff, but params.fragSimilarityAdjuster will be used to adjust the threshold for the fragment comparisons. |
| params | : (optional) settings for the search |
| void RDKit::SynthonSpaceSearch::SynthonSpace::readDBFile | ( | const std::string & | inFilename, |
| int | numThreads = 1 ) |
Reads from a binary DB File in our format.
| inFilename | the name of the file to read. |
| numThreads | number of threads to use in reading. If negative, adds the number to the number of hardware threads available. |
| void RDKit::SynthonSpaceSearch::SynthonSpace::readStream | ( | std::istream & | is, |
| bool & | cancelled ) |
| void RDKit::SynthonSpaceSearch::SynthonSpace::readTextFile | ( | const std::string & | inFilename, |
| bool & | cancelled ) |
| inFilename | name of the file containing the synthon-based library. |
The original format is: all lines are tab-separated first line:SMILES synton_id synton# reaction_id Note the spelling "synton" from the original paper/example file. Subsequent lines have a single reagent e.g. OCC([U])=NN=[Np] 1-1 0 triazole-1 C1CCCC1N([Pu])[U] 2-1 1 triazole-1 CC1CCN(C1)C(=[Np])[Pu] 3-1 2 triazole-1
Other acceptable formats are as above, but with a 5th column "release": SMILES synton_id synton# reaction_id release
or a comma-separated equivalent of the first format: SMILES,synton_id,synton_role,reaction_id but with the 3rd column named differently but with the same meaning. The formatting of the first 2 formats has been relaxed such that any whitespace may be used as the field separator, but a tab is tried first so that a tab-separated file may have spaces in the columns.
Attachment points are U, Np, Pu and Am for up to 4 synthons per reaction. A product is created by taking a synthon from each synton# value and combining by replacing matching trans-uranic elements and replacing them with a direct bond of the appropriate type. A more (for RDKit) conventional connection flag of isotope labelled dummy atoms is also accepted ([1*] etc.). Throws a std::runtime_error if it doesn't think the format is correct, which it does by checking that the first line is as above and subsequent lines have appropriate number of fields. If it receives a SIGINT, returns cancelled=true.
| void RDKit::SynthonSpaceSearch::SynthonSpace::reportSynthonUsage | ( | std::ostream & | os | ) | const |
| void RDKit::SynthonSpaceSearch::SynthonSpace::shapeSearch | ( | const ROMol & | query, |
| const SearchResultCallback & | callback, | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a shape similarity search with the given query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned. Requires a query with at least 1 3D conformer. Only the first conformer will be used in the search. The query can have 2 non-connected fragments. An exception will be thrown if there are more than 2 fragments.
| query | : query molecule |
| callback | user-provided callback receiving chunks of ROMols. |
| params | : (optional) settings for the search |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::shapeSearch | ( | const ROMol & | query, |
| const SynthonSpaceSearchParams & | params, | ||
| std::uint64_t | startLine, | ||
| std::uint64_t | finishLine = std::numeric_limits< std::uint64_t >::max() ) |
Take the contents of params.possibleHitsFile, which is assumed to have been written by an earlier search, and extract those that are indeed hits. It makes sense that params is the same as the one used to generate the possible hits, but this is not essential. You could search at a higher similarity threshold than used to create the possible hits, for example. Duplicate SMILES strings produced by different reactions will be returned. Requires a query with at least 1 3D conformer. Only the first conformer will be used in the search. The query can have 2 non-connected fragments. An exception will be thrown if there are more than 2 fragments.
| query | : query molecule |
| params | : settings for the search |
| startLine | the first line of the file to be considered |
| finishLine | (optional) the last line of the file to be considered. |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::shapeSearch | ( | const ROMol & | query, |
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a shape similarity search with the given query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned. Requires a query with at least 1 3D conformer. Only the first conformer will be used in the search.
| query | : query molecule |
| params | : (optional) settings for the search |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::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() ) |
Take the contents of params.possibleHitsFile, which is assumed to have been written by an earlier search, and extract those that are indeed hits. It makes sense that params is the same as the one used to generate the possible hits, but this is not essential. You could search at a higher similarity threshold than used to create the possible hits, for example. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| matchParams | settings for the substructure search |
| params | : settings for the search |
| startLine | the first line of the file to be considered |
| finishLine | (optional) the last line of the file to be considered. |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::substructureSearch | ( | const GeneralizedSubstruct::ExtendedQueryMol & | query, |
| const SubstructMatchParameters & | matchParams = SubstructMatchParameters(), | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a substructure search with the given generalized query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| matchParams | (optional) settings for the substructure search |
| params | : (optional) settings for the search |
| void RDKit::SynthonSpaceSearch::SynthonSpace::substructureSearch | ( | const ROMol & | query, |
| const SearchResultCallback & | callback, | ||
| const SubstructMatchParameters & | matchParams = SubstructMatchParameters(), | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a substructure search with the given query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned. Search results are returned incrementally through the provided callback, which will receive at most toTryChunkSize sized lists of ROMols at a time, thereby reducing the amount of memory required to hold search results.
| query | : query molecule |
| callback | user-provided callback receiving chunks of ROMols. |
| matchParams | (optional) settings for the substructure search |
| params | : (optional) settings for the search |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::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() ) |
Take the contents of params.possibleHitsFile, which is assumed to have been written by an earlier search, and extract those that are indeed hits. It makes sense that params is the same as the one used to generate the possible hits, but this is not essential. You could search at a higher similarity threshold than used to create the possible hits, for example. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| matchParams | settings for the substructure search |
| params | : settings for the search |
| startLine | the first line of the file to be considered |
| finishLine | (optional) the last line of the file to be considered. |
| SearchResults RDKit::SynthonSpaceSearch::SynthonSpace::substructureSearch | ( | const ROMol & | query, |
| const SubstructMatchParameters & | matchParams = SubstructMatchParameters(), | ||
| const SynthonSpaceSearchParams & | params = SynthonSpaceSearchParams() ) |
Perform a substructure search with the given query molecule across the synthonspace library. Duplicate SMILES strings produced by different reactions will be returned.
| query | : query molecule |
| matchParams | (optional) settings for the substructure search |
| params | : (optional) settings for the search |
| void RDKit::SynthonSpaceSearch::SynthonSpace::summarise | ( | std::ostream & | os | ) |
Write a summary of the SynthonSpace to given stream.
| os | stream |
| void RDKit::SynthonSpaceSearch::SynthonSpace::writeDBFile | ( | const std::string & | outFilename | ) | const |
Writes to a binary DB File in our format.
| outFilename | the name of the file to write. |
| void RDKit::SynthonSpaceSearch::SynthonSpace::writeEnumeratedFile | ( | const std::string & | outFilename | ) | const |
Writes the enumerated library to file in SMILES format (1 compound per line, SMILES name)
| outFilename | name of the file to write |
|
friend |
|
friend |
Definition at line 59 of file SynthonSpace.h.
References SynthonSpaceFingerprintSearcher.
Referenced by SynthonSpaceFingerprintSearcher.
|
friend |
Definition at line 60 of file SynthonSpace.h.
References SynthonSpaceRascalSearcher.
Referenced by SynthonSpaceRascalSearcher.
|
friend |
Definition at line 58 of file SynthonSpace.h.
References SynthonSpaceSearcher.
Referenced by SynthonSpaceSearcher.
|
friend |
Definition at line 62 of file SynthonSpace.h.
References SynthonSpaceShapeSearcher.
Referenced by SynthonSpaceShapeSearcher.
|
friend |
Definition at line 61 of file SynthonSpace.h.
References SynthonSpaceSubstructureSearcher.
Referenced by SynthonSpaceSubstructureSearcher.