RDKit
Open-source cheminformatics and machine learning.
Toggle main menu visibility
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
22
namespace
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::shared_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
// Also required by the shape search. This will be 1 single fragmentation
49
// of the query.
50
std::vector<std::shared_ptr<ROMol>>
frags
;
51
};
52
53
// This sub-class holds results from a SynthonSpaceFingerprintSearch.
54
// It needs pointers to the synthon fingerprints as well.
55
struct
RDKIT_SYNTHONSPACESEARCH_EXPORT
SynthonSpaceFPHitSet
56
:
SynthonSpaceHitSet
{
57
SynthonSpaceFPHitSet
() =
delete
;
58
SynthonSpaceFPHitSet
(
const
SynthonSet
&reaction,
59
const
std::vector<std::vector<size_t>> &stu,
60
const
std::vector<std::shared_ptr<ROMol>> &fragSet);
61
SynthonSpaceFPHitSet
(
const
SynthonSpaceFPHitSet
&lhs) =
delete
;
62
SynthonSpaceFPHitSet
(
SynthonSpaceFPHitSet
&&lhs) =
delete
;
63
~SynthonSpaceFPHitSet
()
override
=
default
;
64
SynthonSpaceFPHitSet
&
operator=
(
const
SynthonSpaceFPHitSet
&rhs) =
delete
;
65
SynthonSpaceFPHitSet
&
operator=
(
SynthonSpaceFPHitSet
&&rhs) =
delete
;
66
67
std::vector<std::vector<ExplicitBitVect *>>
synthonFPs
;
68
ExplicitBitVect
*
addFP
;
69
ExplicitBitVect
*
subtractFP
;
70
};
71
72
// This sub-class holds results from a SynthonSpaceShapeSearch.
73
// It needs pointers to the fragment shapes and the order of the
74
// synthon sets as they matched the fragments.
75
struct
RDKIT_SYNTHONSPACESEARCH_EXPORT
SynthonSpaceShapeHitSet
76
:
SynthonSpaceHitSet
{
77
SynthonSpaceShapeHitSet
() =
delete
;
78
SynthonSpaceShapeHitSet
(
const
SynthonSet
&reaction,
79
const
std::vector<std::vector<size_t>> &stu,
80
const
std::vector<std::shared_ptr<ROMol>> &fragSet,
81
const
std::vector<SynthonShapeInput *> &fShapes,
82
const
std::vector<unsigned int> &sSetOrder);
83
SynthonSpaceShapeHitSet
(
const
SynthonSpaceShapeHitSet
&lhs) =
delete
;
84
SynthonSpaceShapeHitSet
(
SynthonSpaceShapeHitSet
&&lhs) =
delete
;
85
~SynthonSpaceShapeHitSet
()
override
=
default
;
86
SynthonSpaceShapeHitSet
&
operator=
(
const
SynthonSpaceShapeHitSet
&rhs) =
87
delete
;
88
SynthonSpaceShapeHitSet
&
operator=
(
SynthonSpaceShapeHitSet
&&rhs) =
delete
;
89
90
// The shapes corresponding to the frags, for the approximate similarity
91
// calculation.
92
std::vector<SynthonShapeInput *>
fragShapes
;
93
// The order of the synthon sets in the SynthonSet as they matched the
94
// fragments.
95
std::vector<unsigned int>
synthonSetOrder
;
96
};
97
98
}
// namespace RDKit::SynthonSpaceSearch
99
#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:51
export.h
RDKIT_SYNTHONSPACESEARCH_EXPORT
#define RDKIT_SYNTHONSPACESEARCH_EXPORT
Definition
export.h:731
RDKit::SynthonSpaceSearch
Definition
MemoryMappedFileReader.h:19
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::SynthonSpaceFPHitSet
SynthonSpaceFPHitSet(SynthonSpaceFPHitSet &&lhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::synthonFPs
std::vector< std::vector< ExplicitBitVect * > > synthonFPs
Definition
SynthonSpaceHitSet.h:67
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::SynthonSpaceFPHitSet
SynthonSpaceFPHitSet()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::operator=
SynthonSpaceFPHitSet & operator=(SynthonSpaceFPHitSet &&rhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::SynthonSpaceFPHitSet
SynthonSpaceFPHitSet(const SynthonSet &reaction, const std::vector< std::vector< size_t > > &stu, const std::vector< std::shared_ptr< ROMol > > &fragSet)
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::~SynthonSpaceFPHitSet
~SynthonSpaceFPHitSet() override=default
RDKit::SynthonSpaceSearch::SynthonSpaceFPHitSet::subtractFP
ExplicitBitVect * subtractFP
Definition
SynthonSpaceHitSet.h:69
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:68
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::synthonsToUse
std::vector< std::vector< std::pair< std::string, const Synthon * > > > synthonsToUse
Definition
SynthonSpaceHitSet.h:45
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::numHits
size_t numHits
Definition
SynthonSpaceHitSet.h:46
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::frags
std::vector< std::shared_ptr< ROMol > > frags
Definition
SynthonSpaceHitSet.h:50
RDKit::SynthonSpaceSearch::SynthonSpaceHitSet::SynthonSpaceHitSet
SynthonSpaceHitSet(const SynthonSet &reaction, const std::vector< std::vector< size_t > > &stu, const std::vector< std::shared_ptr< ROMol > > &fragSet)
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
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::fragShapes
std::vector< SynthonShapeInput * > fragShapes
Definition
SynthonSpaceHitSet.h:92
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::SynthonSpaceShapeHitSet
SynthonSpaceShapeHitSet(const SynthonSpaceShapeHitSet &lhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::SynthonSpaceShapeHitSet
SynthonSpaceShapeHitSet()=delete
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::SynthonSpaceShapeHitSet
SynthonSpaceShapeHitSet(const SynthonSet &reaction, const std::vector< std::vector< size_t > > &stu, const std::vector< std::shared_ptr< ROMol > > &fragSet, const std::vector< SynthonShapeInput * > &fShapes, const std::vector< unsigned int > &sSetOrder)
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::synthonSetOrder
std::vector< unsigned int > synthonSetOrder
Definition
SynthonSpaceHitSet.h:95
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::operator=
SynthonSpaceShapeHitSet & operator=(const SynthonSpaceShapeHitSet &rhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::SynthonSpaceShapeHitSet
SynthonSpaceShapeHitSet(SynthonSpaceShapeHitSet &&lhs)=delete
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::~SynthonSpaceShapeHitSet
~SynthonSpaceShapeHitSet() override=default
RDKit::SynthonSpaceSearch::SynthonSpaceShapeHitSet::operator=
SynthonSpaceShapeHitSet & operator=(SynthonSpaceShapeHitSet &&rhs)=delete
GraphMol
SynthonSpaceSearch
SynthonSpaceHitSet.h
Generated on
for RDKit by
1.17.0