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>
21
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.
30 const std::vector<std::vector<size_t>> &stu,
31 const std::vector<std::shared_ptr<ROMol>> &fragSet);
34 virtual ~SynthonSpaceHitSet() = default;
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 *>>>
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.
59 const std::vector<std::vector<size_t>> &stu,
60 const std::vector<std::shared_ptr<ROMol>> &fragSet);
63 ~SynthonSpaceFPHitSet() override = default;
66
67 std::vector<std::vector<ExplicitBitVect *>> synthonFPs;
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.
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);
85 ~SynthonSpaceShapeHitSet() override = default;
87 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
Defines the primary molecule class ROMol as well as associated typedefs.
a class for bit vectors that are densely occupied
#define RDKIT_SYNTHONSPACESEARCH_EXPORT
Definition export.h:731
SynthonSpaceFPHitSet(SynthonSpaceFPHitSet &&lhs)=delete
std::vector< std::vector< ExplicitBitVect * > > synthonFPs
SynthonSpaceFPHitSet & operator=(SynthonSpaceFPHitSet &&rhs)=delete
SynthonSpaceFPHitSet(const SynthonSet &reaction, const std::vector< std::vector< size_t > > &stu, const std::vector< std::shared_ptr< ROMol > > &fragSet)
SynthonSpaceFPHitSet & operator=(const SynthonSpaceFPHitSet &rhs)=delete
SynthonSpaceFPHitSet(const SynthonSpaceFPHitSet &lhs)=delete
std::vector< std::vector< std::pair< std::string, const Synthon * > > > synthonsToUse
SynthonSpaceHitSet & operator=(const SynthonSpaceHitSet &rhs)=delete
std::vector< std::shared_ptr< ROMol > > frags
SynthonSpaceHitSet(const SynthonSet &reaction, const std::vector< std::vector< size_t > > &stu, const std::vector< std::shared_ptr< ROMol > > &fragSet)
SynthonSpaceHitSet(const SynthonSpaceHitSet &lhs)=delete
SynthonSpaceHitSet(SynthonSpaceHitSet &&lhs)=delete
SynthonSpaceHitSet & operator=(SynthonSpaceHitSet &&rhs)=delete
SynthonSpaceShapeHitSet(const SynthonSpaceShapeHitSet &lhs)=delete
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)
SynthonSpaceShapeHitSet & operator=(const SynthonSpaceShapeHitSet &rhs)=delete
SynthonSpaceShapeHitSet(SynthonSpaceShapeHitSet &&lhs)=delete
SynthonSpaceShapeHitSet & operator=(SynthonSpaceShapeHitSet &&rhs)=delete