RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
SynthonSpaceFingerprintSearcher.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 fingerprint similarity searching of the SynthonSpace.
13
14#ifndef SYNTHONSPACEFINGERPRINTSEARCHER_H
15#define SYNTHONSPACEFINGERPRINTSEARCHER_H
16
17#include <RDGeneral/export.h>
19
21
22// Concrete class that does the search by fingerprint similarity.
24 public:
29
30 std::vector<std::unique_ptr<SynthonSpaceHitSet>> searchFragSet(
31 const std::vector<std::unique_ptr<ROMol>> &fragSet,
32 const SynthonSet &reaction) const override;
33
34 private:
35 std::unique_ptr<ExplicitBitVect> d_queryFP;
36
38 // These are the fingerprints for the fragments in this search.
39 // The fingerprint in d_fragFPs are keyed on the addresses of the
40 // corresponding fragment. There are usually multiple fragments
41 // with the same SMILES and this way the fingerprints are
42 // generated the minimum number of times.
43 // d_fragFPPool is never read, it is just used as a repository
44 // for the fragFPs for the lifetime of the search.
45 std::vector<std::unique_ptr<ExplicitBitVect>> d_fragFPPool;
46 std::vector<std::pair<void *, ExplicitBitVect *>> d_fragFPs;
47
48 void extraSearchSetup(
49 std::vector<std::vector<std::unique_ptr<ROMol>>> &fragSets) override;
50
51 bool quickVerify(const SynthonSpaceHitSet *hitset,
52 const std::vector<size_t> &synthNums) const override;
53 bool verifyHit(const ROMol &hit) const override;
54};
55} // namespace RDKit::SynthonSpaceSearch
56
57#endif // SYNTHONSPACEFINGERPRINTSEARCHER_H
class that generates same fingerprint style for different output formats
SynthonSpaceFingerprintSearcher(const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SynthonSpaceSearchParams &params, SynthonSpace &space)
std::vector< std::unique_ptr< SynthonSpaceHitSet > > searchFragSet(const std::vector< std::unique_ptr< ROMol > > &fragSet, const SynthonSet &reaction) const override
bool rdvalue_is(const RDValue_cast_t)