RDKit: SynthonSpaceFingerprintSearcher.h Source File

| 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>
18#include <GraphMol/SynthonSpaceSearch/SynthonSpaceSearcher.h>
19
20namespace RDKit::SynthonSpaceSearch {
21
22// Concrete class that does the search by fingerprint similarity.
23 class SynthonSpaceFingerprintSearcher : public SynthonSpaceSearcher {
24 public:
25 SynthonSpaceFingerprintSearcher() = delete;
26 SynthonSpaceFingerprintSearcher(
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::unique_ptr<ROMol>> &fragSet,
32 const SynthonSet &reaction) const override;
33
34 private:
35 std::unique_ptr<ExplicitBitVect> d_queryFP;
36
37 const FingerprintGenerator<std::uint64_t> &d_fpGen;
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(ROMol &hit) const override;
54};
55} // namespace RDKit::SynthonSpaceSearch
56
57#endif // SYNTHONSPACEFINGERPRINTSEARCHER_H
SynthonSpaceSearcher.h
RDKit::FingerprintGenerator
class that generates same fingerprint style for different output formats
Definition FingerprintGenerator.h:321
RDKit::ROMol
Definition ROMol.h:199
RDKit::SynthonSpaceSearch::SynthonSet
Definition SynthonSet.h:36
RDKit::SynthonSpaceSearch::SynthonSpaceFingerprintSearcher::SynthonSpaceFingerprintSearcher
SynthonSpaceFingerprintSearcher(const ROMol &query, const FingerprintGenerator< std::uint64_t > &fpGen, const SynthonSpaceSearchParams &params, SynthonSpace &space)
RDKit::SynthonSpaceSearch::SynthonSpaceFingerprintSearcher::searchFragSet
std::vector< std::unique_ptr< SynthonSpaceHitSet > > searchFragSet(const std::vector< std::unique_ptr< ROMol > > &fragSet, const SynthonSet &reaction) const override
RDKit::SynthonSpaceSearch::SynthonSpaceFingerprintSearcher::SynthonSpaceFingerprintSearcher
SynthonSpaceFingerprintSearcher()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceSearcher::SynthonSpaceSearcher
SynthonSpaceSearcher()=delete
RDKit::SynthonSpaceSearch::SynthonSpace
Definition SynthonSpace.h:134
export.h
RDKit::SynthonSpaceSearch
Definition MemoryMappedFileReader.h:19
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet
Definition SynthonSpaceHitSet.h:27
RDKit::SynthonSpaceSearch::SynthonSpaceSearchParams
Definition SynthonSpace.h:58