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:
27 const ROMol &query, const FingerprintGenerator<std::uint64_t> &fpGen,
28 const SynthonSpaceSearchParams &params, SynthonSpace *space);
29
30 std::vector<std::unique_ptr<SynthonSpaceHitSet>> searchFragSet(
31 const std::vector<std::shared_ptr<ROMol>> &fragSet,
32 const SynthonSet &reaction) const override;
33
34 bool verifyHit(ROMol &hit, const std::string &rxnId,
35 const std::vector<const std::string *> &synthNames) override;
36
37 protected:
38 bool quickVerify(const SynthonSpaceHitSet *hitset,
39 const std::vector<size_t> &synthNums) const override;
41 const std::vector<size_t> &synthNums) const override;
42
43 private:
44 std::unique_ptr<ExplicitBitVect> d_queryFP;
45
47 // These are the fingerprints for the fragments in this search.
48 // The fingerprints in d_fragFPs are keyed on the addresses of the
49 // corresponding fragment. There are usually multiple fragments
50 // with the same SMILES and this way the fingerprints are
51 // generated the minimum number of times.
52 std::vector<std::unique_ptr<ExplicitBitVect>> d_fragFPPool;
53 std::vector<std::pair<void *, ExplicitBitVect *>> d_fragFPs;
54
55 bool extraSearchSetup(
56 std::vector<std::vector<std::shared_ptr<ROMol>>> &fragSets,
57 const TimePoint *endTime) override;
58};
59} // namespace RDKit::SynthonSpaceSearch
60
61#endif // SYNTHONSPACEFINGERPRINTSEARCHER_H
std::chrono::time_point< Clock > TimePoint
class that generates same fingerprint style for different output formats
double approxSimilarity(const SynthonSpaceHitSet *hitset, const std::vector< size_t > &synthNums) const override
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::shared_ptr< ROMol > > &fragSet, const SynthonSet &reaction) const override
bool verifyHit(ROMol &hit, const std::string &rxnId, const std::vector< const std::string * > &synthNames) override
bool quickVerify(const SynthonSpaceHitSet *hitset, const std::vector< size_t > &synthNums) const override