RDKit: SynthonSpaceHitSet.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
SynthonSpaceHitSet.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#ifndef SYNTHONSPACEHITSET_H
12#define SYNTHONSPACEHITSET_H
13
14#include <numeric>
15#include <string>
16#include <vector>
17
18#include <RDGeneral/export.h>
19#include <GraphMol/ROMol.h>
20#include <GraphMol/SynthonSpaceSearch/SynthonSet.h>
21
22namespace RDKit::SynthonSpaceSearch {
23// Holds the information about a set of hits. The molecules can be built
24// by making all combinations of synthons, one taken from each synthon set.
25// The synthons are copied from the SynthonSet so it is not needed to
26// build the hits.
27 struct RDKIT_SYNTHONSPACESEARCH_EXPORT SynthonSpaceHitSet {
28 SynthonSpaceHitSet() = delete;
29 SynthonSpaceHitSet(const SynthonSet &reaction,
30 const std::vector<std::vector<size_t>> &stu,
31 const std::vector<std::unique_ptr<ROMol>> &fragSet);
32 SynthonSpaceHitSet(const SynthonSpaceHitSet &lhs) = delete;
33 SynthonSpaceHitSet(SynthonSpaceHitSet &&lhs) = delete;
34 virtual ~SynthonSpaceHitSet() = default;
35 SynthonSpaceHitSet &operator=(const SynthonSpaceHitSet &rhs) = delete;
36 SynthonSpaceHitSet &operator=(SynthonSpaceHitSet &&rhs) = delete;
37
38 const SynthonSet *d_reaction{nullptr};
39 // The outer vector of synthonsToUse is the size of the synthon lists
40 // in the reaction. So synthonsToUse[0] is all the synthons selected
41 // from reaction->synthons[0], likewise for synthonsToUse[1] etc.
42 // There should be at least one entry in each outer vector, but there
43 // may be different numbers in each.
44 std::vector<std::vector<std::pair<std::string, const Synthon *>>>
45 synthonsToUse;
46 size_t numHits{0};
47 // The fragments that this hitset is derived from, useful for debugging.
48 std::vector<const ROMol *> frags;
49};
50
51// This sub-class holds results from a SynthonSpaceFingerprintSearch.
52// It needs pointers to the synthon fingerprints as well.
53 struct RDKIT_SYNTHONSPACESEARCH_EXPORT SynthonSpaceFPHitSet
54 : SynthonSpaceHitSet {
55 SynthonSpaceFPHitSet() = delete;
56 SynthonSpaceFPHitSet(const SynthonSet &reaction,
57 const std::vector<std::vector<size_t>> &stu,
58 const std::vector<std::unique_ptr<ROMol>> &fragSet);
59 SynthonSpaceFPHitSet(const SynthonSpaceFPHitSet &lhs) = delete;
60 SynthonSpaceFPHitSet(SynthonSpaceFPHitSet &&lhs) = delete;
61 ~SynthonSpaceFPHitSet() override = default;
62 SynthonSpaceFPHitSet &operator=(const SynthonSpaceFPHitSet &rhs) = delete;
63 SynthonSpaceFPHitSet &operator=(SynthonSpaceFPHitSet &&rhs) = delete;
64
65 std::vector<std::vector<ExplicitBitVect *>> synthonFPs;
66 ExplicitBitVect *addFP;
67 ExplicitBitVect *subtractFP;
68};
69
70} // namespace RDKit::SynthonSpaceSearch
71#endif // SYNTHONSPACEHITSET_H
ROMol.h
Defines the primary molecule class ROMol as well as associated typedefs.
SynthonSet.h
ExplicitBitVect
a class for bit vectors that are densely occupied
Definition ExplicitBitVect.h:29
RDKit::SynthonSpaceSearch::SynthonSet
Definition SynthonSet.h:36
export.h
RDKIT_SYNTHONSPACESEARCH_EXPORT
#define RDKIT_SYNTHONSPACESEARCH_EXPORT
Definition export.h:577
RDKit::SynthonSpaceSearch
Definition MemoryMappedFileReader.h:19
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::SynthonSpaceFPHitSet
SynthonSpaceFPHitSet(const SynthonSet &reaction, const std::vector< std::vector< size_t > > &stu, const std::vector< std::unique_ptr< ROMol > > &fragSet)
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::SynthonSpaceFPHitSet
SynthonSpaceFPHitSet(SynthonSpaceFPHitSet &&lhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::synthonFPs
std::vector< std::vector< ExplicitBitVect * > > synthonFPs
Definition SynthonSpaceHitSet.h:65
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::SynthonSpaceFPHitSet
SynthonSpaceFPHitSet()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::operator=
SynthonSpaceFPHitSet & operator=(SynthonSpaceFPHitSet &&rhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::~SynthonSpaceFPHitSet
~SynthonSpaceFPHitSet() override=default
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::subtractFP
ExplicitBitVect * subtractFP
Definition SynthonSpaceHitSet.h:67
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::operator=
SynthonSpaceFPHitSet & operator=(const SynthonSpaceFPHitSet &rhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::SynthonSpaceFPHitSet
SynthonSpaceFPHitSet(const SynthonSpaceFPHitSet &lhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::addFP
ExplicitBitVect * addFP
Definition SynthonSpaceHitSet.h:66
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::synthonsToUse
std::vector< std::vector< std::pair< std::string, const Synthon * > > > synthonsToUse
Definition SynthonSpaceHitSet.h:45
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::SynthonSpaceHitSet
SynthonSpaceHitSet(const SynthonSet &reaction, const std::vector< std::vector< size_t > > &stu, const std::vector< std::unique_ptr< ROMol > > &fragSet)
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::numHits
size_t numHits
Definition SynthonSpaceHitSet.h:46
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::frags
std::vector< const ROMol * > frags
Definition SynthonSpaceHitSet.h:48
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::operator=
SynthonSpaceHitSet & operator=(const SynthonSpaceHitSet &rhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::d_reaction
const SynthonSet * d_reaction
Definition SynthonSpaceHitSet.h:38
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::SynthonSpaceHitSet
SynthonSpaceHitSet(const SynthonSpaceHitSet &lhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::SynthonSpaceHitSet
SynthonSpaceHitSet()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::~SynthonSpaceHitSet
virtual ~SynthonSpaceHitSet()=default
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::SynthonSpaceHitSet
SynthonSpaceHitSet(SynthonSpaceHitSet &&lhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::operator=
SynthonSpaceHitSet & operator=(SynthonSpaceHitSet &&rhs)=delete