IntaRNA 3.4.1
RNA-RNA interaction prediction | C++ API
Loading...
Searching...
No Matches
PredictorSeedExtensionKinetic.h
Go to the documentation of this file.
1#ifndef INTARNA_PREDICTORSEEDEXTENSIONKINETIC_H_
2#define INTARNA_PREDICTORSEEDEXTENSIONKINETIC_H_
3
6
7#include <array>
8#include <cstdint>
9#include <map>
10#include <vector>
11
12namespace IntaRNA {
13
37public:
38
51 SeedHandler * seedHandler, const char score = 'A');
52
55
65 const IndexRange & r2 = IndexRange(0, RnaSequence::lastPos)) override;
66
67protected:
72 void traceBack(Interaction & interaction) override;
73
78 void getNextBest(Interaction & interaction) override;
79
80private:
82 using Boundary = std::array<size_t, 4>;
84 using InteractionCache = std::map<Boundary, Interaction>;
85
87 struct Candidate {
88 Boundary bounds = {};
89 size_t close1 = 0;
90 size_t close2 = 0;
91 size_t s1 = 0;
92 size_t s2 = 0;
93 bool left = true;
94 bool macro = false;
95 bool topologyKnown = false;
96 bool topologyAllowed = false;
97 bool active = false;
98 bool localKnown = false;
99 E_type local = E_INF;
100 E_type hybrid = E_INF;
101 E_type total = E_INF;
102 std::int64_t delta = 0;
103 };
104
106 struct SideCandidates {
107 std::vector<Candidate> moves;
108 std::vector<signed char> complementary;
109 size_t columns = 0;
110 };
111
113 SeedHandlerIdxOffset seedHandler;
115 const char score;
117 InteractionCache interactions;
119 Boundary getBoundary(const Interaction & interaction) const;
120
128 void extendSeed(Interaction & interaction, E_type hybrid,
129 size_t last1, size_t last2);
130
139 void buildCandidates(SideCandidates & side, const Boundary & bounds,
140 bool left, size_t last1, size_t last2) const;
141
151 const Candidate * updateCandidates(SideCandidates & side, const Boundary & bounds,
152 E_type hybrid, E_type total) const;
153
155 bool isBetter(const Candidate & candidate, const Candidate & best) const;
156
161 void retain(const Interaction & interaction);
162};
163
164} // namespace IntaRNA
165
166#endif /* INTARNA_PREDICTORSEEDEXTENSIONKINETIC_H_ */
Definition IndexRange.h:20
Definition InteractionEnergy.h:20
Definition Interaction.h:28
Definition OutputHandler.h:20
Definition PredictionTracker.h:15
Definition PredictorMfe.h:24
PredictionTracker * predTracker
access to the prediction tracker of the super class
Definition Predictor.h:91
InteractionEnergyIdxOffset energy
access to the interaction energy handler of the super class
Definition Predictor.h:85
OutputHandler & output
access to the output handler of the super class
Definition Predictor.h:88
Definition PredictorSeedExtensionKinetic.h:36
void predict(const IndexRange &r1=IndexRange(0, RnaSequence::lastPos), const IndexRange &r2=IndexRange(0, RnaSequence::lastPos)) override
void getNextBest(Interaction &interaction) override
void traceBack(Interaction &interaction) override
PredictorSeedExtensionKinetic(const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker, SeedHandler *seedHandler, const char score='A')
static const size_t lastPos
Definition RnaSequence.h:57
Definition SeedHandler.h:17
Definition Accessibility.h:13
int E_type
type for energy values (energy + accessibility [ED]) (internally)
Definition general.h:78
const E_type E_INF
Definition general.h:79