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>
19
21
22// Concrete class that does substructure searching using a query
23// molecule.
25 public:
29 const SynthonSpaceSearchParams &params,
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 void extraSearchSetup(
61 std::vector<std::vector<std::unique_ptr<ROMol>>> &fragSets) override;
62
63 bool verifyHit(const ROMol &hit) const override;
64
65 void getConnectorRegions(
66 const std::vector<std::unique_ptr<ROMol>> &molFrags,
67 std::vector<std::vector<ROMol *>> &connRegs,
68 std::vector<std::vector<const std::string *>> &connRegSmis,
69 std::vector<std::vector<ExplicitBitVect *>> &connRegFPs) const;
70};
71
72} // namespace RDKit::SynthonSpaceSearch
73
74#endif // SYNTHONSPACESUBSTRUCTURESEARCHER_H
std::vector< std::unique_ptr< SynthonSpaceHitSet > > searchFragSet(const std::vector< std::unique_ptr< ROMol > > &fragSet, const SynthonSet &reaction) const override
SynthonSpaceSubstructureSearcher(const ROMol &query, const SubstructMatchParameters &matchParams, const SynthonSpaceSearchParams &params, SynthonSpace &space)
bool rdvalue_is(const RDValue_cast_t)