RDKit: SynthonSpaceSubstructureSearcher.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
SynthonSpaceSubstructureSearcher.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
11// This file declares a concrete class derived from SynthonSpaceSearcher
12// that does substructure searching of the SynthonSpace.
13
14#ifndef SYNTHONSPACESUBSTRUCTURESEARCHER_H
15#define SYNTHONSPACESUBSTRUCTURESEARCHER_H
16
17#include <RDGeneral/export.h>
18#include <GraphMol/SynthonSpaceSearch/SynthonSpaceSearcher.h>
19
20namespace RDKit::SynthonSpaceSearch {
21
22// Concrete class that does substructure searching using a query
23// molecule.
24 class SynthonSpaceSubstructureSearcher : public SynthonSpaceSearcher {
25 public:
26 SynthonSpaceSubstructureSearcher() = delete;
27 SynthonSpaceSubstructureSearcher(const ROMol &query,
28 const SubstructMatchParameters &matchParams,
29 const SynthonSpaceSearchParams &params,
30 SynthonSpace &space)
31 : SynthonSpaceSearcher(query, params, space),
32 d_matchParams(matchParams) {}
33
34 std::vector<std::unique_ptr<SynthonSpaceHitSet>> searchFragSet(
35 const std::vector<std::unique_ptr<ROMol>> &fragSet,
36 const SynthonSet &reaction) const override;
37
38 private:
39 // These are the pattern fingerprints for the fragments in this
40 // search. They are used for screening the fragments prior to
41 // a substructure search. The pool contains the unique pattern
42 // fingerprints for all the unique fragments (based on SMILES) in
43 // the query fragment set.
44 std::vector<std::unique_ptr<ExplicitBitVect>> d_pattFPsPool;
45 std::vector<std::pair<void *, ExplicitBitVect *>> d_pattFPs;
46 SubstructMatchParameters d_matchParams;
47
48 // Likewise, the connector regions and connector region
49 // fingerprints.
50 std::vector<std::vector<std::unique_ptr<ROMol>>> d_connRegsPool;
51 std::vector<std::pair<void *, std::vector<std::unique_ptr<ROMol>> *>>
52 d_connRegs;
53 std::vector<std::vector<std::string>> d_connRegSmisPool;
54 std::vector<std::pair<void *, std::vector<std::string> *>> d_connRegSmis;
55 std::vector<std::vector<std::unique_ptr<ExplicitBitVect>>> d_connRegFPsPool;
56 std::vector<
57 std::pair<void *, std::vector<std::unique_ptr<ExplicitBitVect>> *>>
58 d_connRegFPs;
59
60 unsigned int getNumQueryFragmentsRequired() override;
61 void extraSearchSetup(
62 std::vector<std::vector<std::unique_ptr<ROMol>>> &fragSets) override;
63
64 bool verifyHit(ROMol &hit) const override;
65
66 void getConnectorRegions(
67 const std::vector<std::unique_ptr<ROMol>> &molFrags,
68 std::vector<std::vector<ROMol *>> &connRegs,
69 std::vector<std::vector<const std::string *>> &connRegSmis,
70 std::vector<std::vector<ExplicitBitVect *>> &connRegFPs) const;
71};
72
73} // namespace RDKit::SynthonSpaceSearch
74
75#endif // SYNTHONSPACESUBSTRUCTURESEARCHER_H
SynthonSpaceSearcher.h
RDKit::ROMol
Definition ROMol.h:199
RDKit::SynthonSpaceSearch::SynthonSet
Definition SynthonSet.h:36
RDKit::SynthonSpaceSearch::SynthonSpaceSearcher::SynthonSpaceSearcher
SynthonSpaceSearcher()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceSubstructureSearcher::searchFragSet
std::vector< std::unique_ptr< SynthonSpaceHitSet > > searchFragSet(const std::vector< std::unique_ptr< ROMol > > &fragSet, const SynthonSet &reaction) const override
RDKit::SynthonSpaceSearch::SynthonSpaceSubstructureSearcher::SynthonSpaceSubstructureSearcher
SynthonSpaceSubstructureSearcher()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceSubstructureSearcher::SynthonSpaceSubstructureSearcher
SynthonSpaceSubstructureSearcher(const ROMol &query, const SubstructMatchParameters &matchParams, const SynthonSpaceSearchParams &params, SynthonSpace &space)
Definition SynthonSpaceSubstructureSearcher.h:27
RDKit::SynthonSpaceSearch::SynthonSpace
Definition SynthonSpace.h:134
export.h
RDKit::SynthonSpaceSearch
Definition MemoryMappedFileReader.h:19
RDKit::SubstructMatchParameters
Definition SubstructMatch.h:42
RDKit::SynthonSpaceSearch::SynthonSpaceSearchParams
Definition SynthonSpace.h:58