IntaRNA 3.4.1
RNA-RNA interaction prediction | C++ API
Loading...
Searching...
No Matches
PredictorMfeEns2dHeuristicSeedExtension.h
Go to the documentation of this file.
1
2#ifndef INTARNA_PREDICTORMFEENS2DHEURISTICSEEDEXTENSION_H_
3#define INTARNA_PREDICTORMFEENS2DHEURISTICSEEDEXTENSION_H_
4
7#include <unordered_map>
8
9namespace IntaRNA {
10
29
30public:
31
32
50
51
56
57
70 virtual
71 void
73 , const IndexRange & r2 = IndexRange(0,RnaSequence::lastPos) ) override;
74
75
76protected:
77
85 void prepareStackSeedExtensions(size_t n,size_t m,const StackSeedDomain & seeds) override;
88 stackSeedRightSelector() const override;
89
93 std::unordered_map<Interaction::BasePair,Interaction::BasePair,Interaction::BasePair::Hash> stackSeedRight;
94
95
98
101
104
108
112
115
117 size_t j1opt, j2opt;
118
119protected:
120
130 virtual
131 void
132 updateOptRightZ( const size_t i1, const size_t j1
133 , const size_t i2, const size_t j2
134 , const E_type hybridE );
135
144 virtual
145 void
146 fillHybridZ_right( const size_t i1, const size_t i2
147 , const size_t si1, const size_t si2
148 );
149
158 virtual
159 void
160 fillHybridZ_left( const size_t j1, const size_t j2 ) override;
161
162};
163
167
168inline
169void
171updateOptRightZ( const size_t i1, const size_t j1
172 , const size_t i2, const size_t j2
173 , const E_type hybridE )
174{
175 // store boundaries and energy of the optimal right extension
176 E_type fullE = energy.getE( i1, j1, i2, j2, hybridE );
177 if (fullE < E_right_opt
178 && (!output.getOutputConstraint().noGUend || !energy.isGU(j1,j2)))
179 {
180 E_right_opt = fullE;
181 j1opt = j1;
182 j2opt = j2;
183 }
184}
185
187
188} // namespace
189
190#endif /* INTARNA_PREDICTORMFEENS2DHEURISTICSEEDEXTENSION_H_ */
Definition BasePairProbabilities.h:16
Definition IndexRange.h:20
virtual E_type getE(const size_t i1, const size_t j1, const size_t i2, const size_t j2, const E_type hybridE) const override
Definition InteractionEnergyIdxOffset.h:862
virtual bool isGU(const size_t i1, const size_t i2) const override
Definition InteractionEnergyIdxOffset.h:634
Definition InteractionEnergy.h:20
type of a base pair index encoding
Definition Interaction.h:33
const bool noGUend
whether or not inter-molecular UG base pairs are allowed at interaction ends
Definition OutputConstraint.h:54
Definition OutputHandler.h:22
const OutputConstraint & getOutputConstraint() const
Definition OutputHandler.h:180
Definition PredictionTracker.h:15
Definition PredictorMfeEns2dHeuristicSeedExtension.h:28
std::function< Interaction::BasePair(Interaction::BasePair, Interaction::BasePair)> stackSeedRightSelector() const override
size_t j1opt
boundaries of the right extension with the optimal energy
Definition PredictorMfeEns2dHeuristicSeedExtension.h:117
void prepareStackSeedExtensions(size_t n, size_t m, const StackSeedDomain &seeds) override
size_t j2opt
Definition PredictorMfeEns2dHeuristicSeedExtension.h:117
Z_type E_right_opt
optimal energy of the right extension
Definition PredictorMfeEns2dHeuristicSeedExtension.h:114
std::unordered_map< Interaction::BasePair, Interaction::BasePair, Interaction::BasePair::Hash > stackSeedRight
Preferred local endpoint keyed by the local first pair of each seed.
Definition PredictorMfeEns2dHeuristicSeedExtension.h:93
virtual void updateOptRightZ(const size_t i1, const size_t j1, const size_t i2, const size_t j2, const E_type hybridE)
Definition PredictorMfeEns2dHeuristicSeedExtension.h:171
bool selectingStackSeedRight
Only rank right extensions while preparing canonical stack-seed choices.
Definition PredictorMfeEns2dHeuristicSeedExtension.h:91
PredictorMfeEns2dHeuristicSeedExtension(const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker, SeedHandler *seedHandler, BasePairProbabilities *pairProbabilities=nullptr)
virtual void fillHybridZ_right(const size_t i1, const size_t i2, const size_t si1, const size_t si2)
SeedHandlerIdxOffset seedHandler
the seed handler (with idx offset)
Definition PredictorMfeEns2dSeedExtension.h:149
virtual void predict(const IndexRange &r1=IndexRange(0, RnaSequence::lastPos), const IndexRange &r2=IndexRange(0, RnaSequence::lastPos)) override
virtual void fillHybridZ_left(const size_t j1, const size_t j2) override
Definition PredictorMfeEns2dSeedExtension.h:30
BasePairProbabilities * pairProbabilities
optional sequence-pair owner, never deleted or finalized by the predictor
Definition PredictorMfeEns2dSeedExtension.h:137
Z2dMatrix hybridZ_right
partition function of all interaction hybrids that start on the right side of the seed excluding E_in...
Definition PredictorMfeEns2dSeedExtension.h:152
Z2dMatrix hybridZ_left
partition function of all interaction hybrids that start on the left side of the seed including E_ini...
Definition PredictorMfeEns2dSeedExtension.h:146
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
SeedHandlerIdxOffset seedHandler
the seed handler (with idx offset)
Definition PredictorMfeEns2dSeedExtension.h:149
PredictionTracker * predTracker
access to the prediction tracker of the super class
Definition Predictor.h:91
static const size_t lastPos
Definition RnaSequence.h:57
Definition SeedHandler.h:17
Definition StackSeedDomain.h:15
Definition Accessibility.h:13
int E_type
type for energy values (energy + accessibility [ED]) (internally)
Definition general.h:78
double Z_type
type for probabilities, RT and Boltzmann values
Definition general.h:88
const E_type E_INF
Definition general.h:79