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::PredictorMfe Class Referenceabstract

#include <PredictorMfe.h>

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

Classes

class  BestInteraction
 

Public Member Functions

 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 ()
 
virtual void predict (const IndexRange &r1=IndexRange(0, RnaSequence::lastPos), const IndexRange &r2=IndexRange(0, RnaSequence::lastPos))=0
 
Z_type getZall () const
 

Protected Types

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

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 traceBack (Interaction &interaction)=0
 
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)
 
virtual void reportOptima () override
 
- 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

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

Generic Predictor interface for MFE interaction computation to avoid code redundancy

Author
Martin Mann

Member Typedef Documentation

◆ BestInteractionE

BestInteraction that stores an energy value.

◆ BestInteractionZ

BestInteraction that stores a partition function value.

◆ HashIdx2E

hash to map index pairs to BestInteractionE entries

◆ InteractionList

list of interactions

Constructor & Destructor Documentation

◆ PredictorMfe()

IntaRNA::PredictorMfe::PredictorMfe ( const InteractionEnergy &  energy,
OutputHandler &  output,
PredictionTracker *  predTracker 
)

Construction call the super constructor

Parameters
energythe interaction energy handler
outputthe output handler to report optimal 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.

◆ ~PredictorMfe()

virtual IntaRNA::PredictorMfe::~PredictorMfe ( )
overridevirtual

Member Function Documentation

◆ getNextBest()

virtual void IntaRNA::PredictorMfe::getNextBest ( Interaction &  curBest)
protectedvirtual

Identifies the next best interaction with an energy equal to or higher than the given interaction. The new interaction will not overlap any index range stored in reportedInteractions.

Parameters
curBestIN/OUT the current best interaction to be replaced with one of equal or higher energy not overlapping with any reported interaction so far; an interaction with energy E_INF is set, if there is no better interaction left

Reimplemented in IntaRNA::PredictorMfe2dHelixBlockHeuristic, IntaRNA::PredictorMfe2dHelixBlockHeuristicSeed, IntaRNA::PredictorMfe2dHeuristic, IntaRNA::PredictorMfe2dHeuristicSeed, and IntaRNA::PredictorSeedExtensionKinetic.

◆ initOptima()

virtual void IntaRNA::PredictorMfe::initOptima ( )
overrideprotectedvirtual

Initializes the global energy minimum storage

Implements IntaRNA::Predictor.

◆ initSeedCandidates()

void IntaRNA::PredictorMfe::initSeedCandidates ( )
protected

Initialize local selection, or use a caller's shared regional collector.

◆ isValidOutputSite()

bool IntaRNA::PredictorMfe::isValidOutputSite ( const size_t  i1,
const size_t  j1,
const size_t  i2,
const size_t  j2 
) const
protected

Checks terminal GU and accessibility constraints for a complete site. Recursion cells may be useful extensions without being valid output sites.

Parameters
i1inclusive start in sequence 1, relative to the energy offset
j1inclusive end in sequence 1, relative to the energy offset
i2inclusive start in reversed sequence 2, relative to its offset
j2inclusive end in reversed sequence 2, relative to its offset
Returns
whether both terminal pairs and ED penalties satisfy output limits

◆ predictPerSeed()

virtual bool IntaRNA::PredictorMfe::predictPerSeed ( const IndexRange &  r1,
const IndexRange &  r2,
SeedHandlerIdxOffset &  seeds,
const std::function< Predictor *(OutputHandler &, PredictionTracker *, SeedHandler *)> &  factory 
)
protectedvirtual

Predict independently with each admitted seed, preserving this mode's recurrences and qualifying traceback. Statistics/trackers use one ordinary prediction; seed-specific passes do not contribute to them.

Parameters
r1target region in original coordinates
r2reversed-query region in original coordinates
seedsowned seed wrapper of this predictor
factoryconstructs this predictor type, owning the supplied tracker and seed adapter; children have per-seed selection disabled
Returns
true if positive-quota prediction was handled completely
Exceptions
std::logic_errorif a custom predictor subclass does not override this hook to supply a factory preserving its custom recurrences

◆ reportOptima()

virtual void IntaRNA::PredictorMfe::reportOptima ( )
overrideprotectedvirtual

Calls for the stored mfe and suboptimal solutions traceBack(i) and pushes the according interactions to the output handler. For non-overlapping interaction enumeration, getNextBest() is called iteratively.

Implements IntaRNA::Predictor.

Reimplemented in IntaRNA::PredictorMfeEns.

◆ traceBack()

virtual void IntaRNA::PredictorMfe::traceBack ( Interaction &  interaction)
protectedpure virtual

◆ updateMfe4leftEnd()

virtual void IntaRNA::PredictorMfe::updateMfe4leftEnd ( const size_t  i1,
const size_t  j1,
const size_t  i2,
const size_t  j2,
const Interaction &  curInteraction 
)
protectedvirtual

Updates the mfe4leftEnd data container.

Overwrite, if no update is to be done.

Parameters
i1interaction start in seq1
j1interaction end in seq1
i2interaction start in seq2
i2interaction end in seq2
curInteractionthe interaction information to be used for update

Reimplemented in IntaRNA::PredictorMfe2dHelixBlockHeuristic, and IntaRNA::PredictorMfe2dHeuristic.

◆ updateOptima()

virtual void IntaRNA::PredictorMfe::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 
)
overrideprotectedvirtual

updates the global optimum to be the mfe interaction if needed

Parameters
i1the index of the first sequence interacting with i2
j1the index of the first sequence interacting with j2
i2the index of the second sequence interacting with i1
j2the index of the second sequence interacting with j1
energythe energy of the interaction
isHybridEwhether or not the given energy is only the hybridization energy (init+loops) or the total interaction energy
incrementZallwhether or not Zall is to be incremented (if needed)

Implements IntaRNA::Predictor.

Member Data Documentation

◆ energy

InteractionEnergyIdxOffset IntaRNA::Predictor::energy
protected

access to the interaction energy handler of the super class

◆ mfe4leftEnd

HashIdx2E IntaRNA::PredictorMfe::mfe4leftEnd
protected

if non-overlapping output is required, this data structure is filled to find non-overlapping interactions

◆ mfeInteractions

InteractionList IntaRNA::PredictorMfe::mfeInteractions
protected

mfe interaction boundaries

◆ output

OutputHandler& IntaRNA::Predictor::output
protected

access to the output handler of the super class

◆ ownedSeedCandidates

std::unique_ptr<OutputHandlerSeedCandidates> IntaRNA::PredictorMfe::ownedSeedCandidates
protected

Local collector for API callers that do not provide a regional collector.

◆ perSeedPass

bool IntaRNA::PredictorMfe::perSeedPass = false
protected

Enforce complete-site spans before ranking a seed-constrained child pass.

◆ predTracker

PredictionTracker* IntaRNA::Predictor::predTracker
protected

access to the prediction tracker of the super class

◆ reportedInteractions

std::pair< IndexRangeList, IndexRangeList > IntaRNA::PredictorMfe::reportedInteractions
protected

index ranges of reported interactions to identify non-overlapping interactions (first = seq1, second = seq2) NOTE: the indices for seq2 are reversed

◆ seedCandidates

OutputHandlerSeedCandidates* IntaRNA::PredictorMfe::seedCandidates = nullptr
protected

Active collector; null on the unchanged default path.


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