IntaRNA 3.4.1
RNA-RNA interaction prediction | C++ API
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
IntaRNA::PredictorMfeEns2dHeuristic Class Reference

#include <PredictorMfeEns2dHeuristic.h>

Inheritance diagram for IntaRNA::PredictorMfeEns2dHeuristic:
Inheritance graph
[legend]
Collaboration diagram for IntaRNA::PredictorMfeEns2dHeuristic:
Collaboration graph
[legend]

Classes

struct  ProbabilityContinuation
 The selected chain owns its first pair and, optionally, its next stack pair. More...
 

Public Member Functions

 PredictorMfeEns2dHeuristic (const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker, BasePairProbabilities *pairProbabilities=nullptr)
 
virtual ~PredictorMfeEns2dHeuristic () override
 
virtual void predict (const IndexRange &r1=IndexRange(0, RnaSequence::lastPos), const IndexRange &r2=IndexRange(0, RnaSequence::lastPos)) override
 
- Public Member Functions inherited from IntaRNA::PredictorMfeEns2d
 PredictorMfeEns2d (const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker, BasePairProbabilities *pairProbabilities=nullptr)
 
virtual ~PredictorMfeEns2d () override
 
- Public Member Functions inherited from IntaRNA::PredictorMfeEns
 PredictorMfeEns (const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker)
 
virtual ~PredictorMfeEns () override
 
- Public Member Functions inherited from IntaRNA::PredictorMfe
 PredictorMfe (const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker)
 
virtual ~PredictorMfe () override
 
- Public Member Functions inherited from IntaRNA::Predictor
 Predictor (const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker)
 
virtual ~Predictor ()
 
Z_type getZall () const
 

Protected Types

typedef Matrix< BestInteractionZ > Z2dMatrix
 matrix type to hold the mfe energies and boundaries for interaction site starts
 
- Protected Types inherited from IntaRNA::PredictorMfeEns2d
typedef Matrix< Z_type > Z2dMatrix
 matrix type to hold the partition functions for interaction site starts
 
- Protected Types inherited from IntaRNA::PredictorMfe
typedef BestInteraction< E_type > BestInteractionE
 BestInteraction that stores an energy value.
 
typedef BestInteraction< Z_type > BestInteractionZ
 BestInteraction that stores a partition function value.
 
typedef std::list< Interaction > InteractionList
 list of interactions
 
typedef boost::unordered_map< Interaction::BasePair, BestInteractionE, Interaction::BasePair::Hash > HashIdx2E
 hash to map index pairs to BestInteractionE entries
 

Protected Member Functions

void predictRegionHeuristic (const IndexRange &r1, const IndexRange &r2)
 
void recordProbabilityCandidate (size_t i1, size_t j1, size_t i2, size_t j2, Z_type hybrid, const ProbabilityContinuation &continuation)
 
void commitProbabilityRegion ()
 
virtual void fillHybridZ ()
 
- Protected Member Functions inherited from IntaRNA::PredictorMfeEns2d
void predictRegion (const IndexRange &r1, const IndexRange &r2)
 
void accumulatePairMasses (size_t j1, size_t j2, Z2dMatrix &outside, Z2dMatrix &masses, Z_type &denominator) const
 
virtual void fillHybridZ (const size_t j1, const size_t j2, const size_t i1init, const size_t i2init, const bool callUpdateZ)
 
- Protected Member Functions inherited from IntaRNA::PredictorMfeEns
void updateExactCompleteZ (size_t i1, size_t j1, size_t i2, size_t j2, Z_type hybrid, Z_type coefficient)
 
virtual void initZ ()
 
virtual void updateZ (const size_t i1, const size_t j1, const size_t i2, const size_t j2, const Z_type partFunct, const bool isHybridZ)
 
void updateCompleteZ (const size_t i1, const size_t j1, const size_t i2, const size_t j2, const Z_type partFunct, const bool isHybridZ)
 
virtual void reportOptima () override
 
virtual void traceBack (Interaction &interaction) override
 
- Protected Member Functions inherited from IntaRNA::PredictorMfe
virtual bool predictPerSeed (const IndexRange &r1, const IndexRange &r2, SeedHandlerIdxOffset &seeds, const std::function< Predictor *(OutputHandler &, PredictionTracker *, SeedHandler *)> &factory)
 
void initSeedCandidates ()
 
virtual void initOptima () override
 
bool isValidOutputSite (const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
 
virtual void updateOptima (const size_t i1, const size_t j1, const size_t i2, const size_t j2, const E_type energy, const bool isHybridE, const bool incrementZall) override
 
virtual void getNextBest (Interaction &curBest)
 
virtual void updateMfe4leftEnd (const size_t i1, const size_t j1, const size_t i2, const size_t j2, const Interaction &curInteraction)
 
- Protected Member Functions inherited from IntaRNA::Predictor
virtual void updateZall (const size_t i1, const size_t j1, const size_t i2, const size_t j2, const E_type energy, const bool isHybridE)
 
void incrementZall (const Z_type partZ)
 

Protected Attributes

Z2dMatrix hybridZ
 energy of all interaction hybrids starting in i1,i2
 
Matrix< ProbabilityContinuation > probabilityContinuation
 Allocated only for probability output; selected continuations form a DAG.
 
Matrix< Z_type > probabilityFlow
 Complete candidate weight flowing into each retained continuation.
 
Matrix< Z_type > probabilityMass
 Numerators in local target/reversed-query coordinates until region commit.
 
Z_type probabilityDenominator = 0
 Independently accumulated objective, required to agree exactly with Zall.
 
InteractionEnergyIdxOffset energy
 access to the interaction energy handler of the super class
 
OutputHandler & output
 access to the output handler of the super class
 
- Protected Attributes inherited from IntaRNA::PredictorMfeEns2d
BasePairProbabilities * pairProbabilities
 optional sequence-pair owner, never deleted or finalized by this predictor
 
Z2dMatrix hybridZ
 
InteractionEnergyIdxOffset energy
 access to the interaction energy handler of the super class
 
OutputHandler & output
 access to the output handler of the super class
 
- Protected Attributes inherited from IntaRNA::PredictorMfeEns
std::unordered_map< Interaction::Boundary, Z_type, Interaction::Boundary::Hash > Z_partition
 map storing the partition of Zall for all considered interaction sites
 
const std::pair< Z_type, Z_type > * exactContribution = nullptr
 scoped coefficient and hybrid expected by the checked complete update
 
bool updateZisComplete
 whether updateZ() currently receives one complete boundary partition
 
InteractionEnergyIdxOffset energy
 access to the interaction energy handler of the super class
 
OutputHandler & output
 access to the output handler of the super class
 
PredictionTracker * predTracker
 access to the prediction tracker of the super class
 
- Protected Attributes inherited from IntaRNA::PredictorMfe
OutputHandlerSeedCandidates * seedCandidates = nullptr
 Active collector; null on the unchanged default path.
 
std::unique_ptr< OutputHandlerSeedCandidates > ownedSeedCandidates
 Local collector for API callers that do not provide a regional collector.
 
bool perSeedPass = false
 Enforce complete-site spans before ranking a seed-constrained child pass.
 
InteractionList mfeInteractions
 mfe interaction boundaries
 
HashIdx2E mfe4leftEnd
 
std::pair< IndexRangeList, IndexRangeList > reportedInteractions
 
InteractionEnergyIdxOffset energy
 access to the interaction energy handler of the super class
 
OutputHandler & output
 access to the output handler of the super class
 
PredictionTracker * predTracker
 access to the prediction tracker of the super class
 
- Protected Attributes inherited from IntaRNA::Predictor
InteractionEnergyIdxOffset energy
 energy computation handler
 
OutputHandler & output
 interaction output handler
 
PredictionTracker * predTracker
 prediction tracker to be used
 
Z_type Zall
 

Additional Inherited Members

- Static Public Member Functions inherited from IntaRNA::Predictor
static size_t getMaxInteractionWidth (const size_t w, const size_t maxLoopSize)
 

Detailed Description

Memory efficient ensemble interaction predictor that uses a heuristic to find the mfe or a close-to-mfe interaction.

To this end, for each interaction start i1,i2 only the optimal right side interaction with boundaries j1,j2 is considered in the recursion instead of all possible interaction ranges.

This yields a quadratic time and space complexity. Optional pair probabilities refer to all admitted candidate chains considered by this pruning rule, with the same Zall as ordinary heuristic prediction. They approximate the unrestricted interaction ensemble. Collection adds quadratic storage and a reverse traversal of the retained continuations.

Author
Martin Raden
Frank Gelhausen

Member Typedef Documentation

◆ Z2dMatrix

matrix type to hold the mfe energies and boundaries for interaction site starts

Constructor & Destructor Documentation

◆ PredictorMfeEns2dHeuristic()

IntaRNA::PredictorMfeEns2dHeuristic::PredictorMfeEns2dHeuristic ( const InteractionEnergy &  energy,
OutputHandler &  output,
PredictionTracker *  predTracker,
BasePairProbabilities *  pairProbabilities = nullptr 
)

Constructs a predictor and stores the energy and output handler

Parameters
energythe interaction energy handler
outputthe output handler to report mfe interactions to
predTrackerthe prediction tracker to be used or NULL if no tracking is to be done; if non-NULL, the tracker gets deleted on this->destruction.
pairProbabilitiesoptional non-owning sink for probabilities of the pruned candidate ensemble; requires needZall

◆ ~PredictorMfeEns2dHeuristic()

virtual IntaRNA::PredictorMfeEns2dHeuristic::~PredictorMfeEns2dHeuristic ( )
overridevirtual

Member Function Documentation

◆ commitProbabilityRegion()

void IntaRNA::PredictorMfeEns2dHeuristic::commitProbabilityRegion ( )
protected

Propagate candidate weights through selected chains and commit this region.

◆ fillHybridZ()

virtual void IntaRNA::PredictorMfeEns2dHeuristic::fillHybridZ ( )
protectedvirtual

Computes all entries of the hybridE matrix and reports all valid interactions via updateOptima()

◆ predict()

virtual void IntaRNA::PredictorMfeEns2dHeuristic::predict ( const IndexRange &  r1 = IndexRange(0, RnaSequence::lastPos),
const IndexRange &  r2 = IndexRange(0, RnaSequence::lastPos) 
)
overridevirtual

Computes the mfe for the given sequence ranges (i1-j1) in the first sequence and (i2-j2) in the second sequence and reports it to the output handler.

Parameters
r1the index range of the first sequence interacting with r2
r2the index range of the second sequence interacting with r1

Reimplemented from IntaRNA::PredictorMfeEns2d.

◆ predictRegionHeuristic()

void IntaRNA::PredictorMfeEns2dHeuristic::predictRegionHeuristic ( const IndexRange &  r1,
const IndexRange &  r2 
)
protected

Compute one region under predict()'s failure guard.

◆ recordProbabilityCandidate()

void IntaRNA::PredictorMfeEns2dHeuristic::recordProbabilityCandidate ( size_t  i1,
size_t  j1,
size_t  i2,
size_t  j2,
Z_type  hybrid,
const ProbabilityContinuation &  continuation 
)
protected

Record precisely the accepted updateZ candidate, crediting newly prepended pairs and routing its full weight to the retained child chain. Coordinates are local and the query is reversed; lastPos denotes an initial candidate.

Member Data Documentation

◆ energy

InteractionEnergyIdxOffset IntaRNA::Predictor::energy
protected

access to the interaction energy handler of the super class

◆ hybridZ

Z2dMatrix IntaRNA::PredictorMfeEns2dHeuristic::hybridZ
protected

energy of all interaction hybrids starting in i1,i2

◆ output

OutputHandler& IntaRNA::Predictor::output
protected

access to the output handler of the super class

◆ probabilityContinuation

Matrix<ProbabilityContinuation> IntaRNA::PredictorMfeEns2dHeuristic::probabilityContinuation
protected

Allocated only for probability output; selected continuations form a DAG.

◆ probabilityDenominator

Z_type IntaRNA::PredictorMfeEns2dHeuristic::probabilityDenominator = 0
protected

Independently accumulated objective, required to agree exactly with Zall.

◆ probabilityFlow

Matrix<Z_type> IntaRNA::PredictorMfeEns2dHeuristic::probabilityFlow
protected

Complete candidate weight flowing into each retained continuation.

◆ probabilityMass

Matrix<Z_type> IntaRNA::PredictorMfeEns2dHeuristic::probabilityMass
protected

Numerators in local target/reversed-query coordinates until region commit.


The documentation for this class was generated from the following file: