RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
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
20
namespace
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
¶ms,
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::shared_ptr<ROMol>> &fragSet,
36
const
SynthonSet
&reaction)
const override
;
37
38
bool
verifyHit
(
ROMol
&hit,
const
std::string &rxnId,
39
const
std::vector<const std::string *> &synthNames)
override
;
40
41
protected
:
42
// In this case, it's just the number of atoms in the query
43
// divided by the number of atoms in the product.
44
double
approxSimilarity
(
const
SynthonSpaceHitSet
*hitset,
45
const
std::vector<size_t> &synthNums)
const override
;
46
47
private
:
48
// These are the pattern fingerprints for the fragments in this
49
// search. They are used for screening the fragments prior to
50
// a substructure search. The pool contains the unique pattern
51
// fingerprints for all the unique fragments (based on SMILES) in
52
// the query fragment set.
53
std::vector<std::unique_ptr<ExplicitBitVect>> d_pattFPsPool;
54
std::vector<std::pair<void *, ExplicitBitVect *>> d_pattFPs;
55
SubstructMatchParameters
d_matchParams;
56
57
// Likewise, the connector regions and connector region
58
// fingerprints.
59
std::vector<std::vector<std::unique_ptr<ROMol>>> d_connRegsPool;
60
std::vector<std::pair<void *, std::vector<std::unique_ptr<ROMol>> *>>
61
d_connRegs;
62
std::vector<std::vector<std::string>> d_connRegSmisPool;
63
std::vector<std::pair<void *, std::vector<std::string> *>> d_connRegSmis;
64
std::vector<std::vector<std::unique_ptr<ExplicitBitVect>>> d_connRegFPsPool;
65
std::vector<
66
std::pair<void *, std::vector<std::unique_ptr<ExplicitBitVect>> *>>
67
d_connRegFPs;
68
69
bool
extraSearchSetup(
70
std::vector<std::vector<std::shared_ptr<ROMol>>> &fragSets,
71
const
TimePoint
*endTime)
override
;
72
unsigned
int
getNumQueryFragmentsRequired()
override
;
73
74
void
getConnectorRegions(
75
const
std::vector<std::shared_ptr<ROMol>> &molFrags,
76
std::vector<std::vector<ROMol *>> &connRegs,
77
std::vector<std::vector<const std::string *>> &connRegSmis,
78
std::vector<std::vector<ExplicitBitVect *>> &connRegFPs)
const
;
79
};
80
81
}
// namespace RDKit::SynthonSpaceSearch
82
83
#endif
// SYNTHONSPACESUBSTRUCTURESEARCHER_H
TimePoint
std::chrono::time_point< Clock > TimePoint
Definition
SynthonSpaceSearch_details.h:24
SynthonSpaceSearcher.h
RDKit::ROMol
Definition
ROMol.h:344
RDKit::SynthonSpaceSearch::SynthonSet
Definition
SynthonSet.h:51
RDKit::SynthonSpaceSearch::SynthonSpaceSearcher::SynthonSpaceSearcher
SynthonSpaceSearcher()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceSubstructureSearcher::approxSimilarity
double approxSimilarity(const SynthonSpaceHitSet *hitset, const std::vector< size_t > &synthNums) const override
RDKit::SynthonSpaceSearch::SynthonSpaceSubstructureSearcher::verifyHit
bool verifyHit(ROMol &hit, const std::string &rxnId, const std::vector< const std::string * > &synthNames) override
RDKit::SynthonSpaceSearch::SynthonSpaceSubstructureSearcher::searchFragSet
std::vector< std::unique_ptr< SynthonSpaceHitSet > > searchFragSet(const std::vector< std::shared_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 ¶ms, SynthonSpace *space)
Definition
SynthonSpaceSubstructureSearcher.h:27
RDKit::SynthonSpaceSearch::SynthonSpace
Definition
SynthonSpace.h:56
export.h
RDKit::SynthonSpaceSearch
Definition
MemoryMappedFileReader.h:19
RDKit::SubstructMatchParameters
Definition
SubstructMatch.h:42
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet
Definition
SynthonSpaceHitSet.h:27
RDKit::SynthonSpaceSearch::SynthonSpaceSearchParams
Definition
SynthonSpaceSearchHelpers.h:37
GraphMol
SynthonSpaceSearch
SynthonSpaceSubstructureSearcher.h
Generated on
for RDKit by
1.17.0