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

#include <PredictorMfeEns2dSeedExtension.h>

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

Public Member Functions

 PredictorMfeEns2dSeedExtension (const InteractionEnergy &energy, OutputHandler &output, PredictionTracker *predTracker, SeedHandler *seedHandler, BasePairProbabilities *pairProbabilities=nullptr)
 
virtual ~PredictorMfeEns2dSeedExtension () 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::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< 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 addSeedPartition (Interaction::BasePair seed, Interaction::BasePair left, Interaction::BasePair right, Z_type hybridZ)
 
virtual Z_type exactBoundaryWeight (size_t i1, size_t j1, size_t i2, size_t j2) const
 
void predictStackSeeds (const IndexRange &r1, const IndexRange &r2)
 
virtual void prepareStackSeedExtensions (size_t n, size_t m, const StackSeedDomain &seeds)
 
virtual std::function< Interaction::BasePair(Interaction::BasePair, Interaction::BasePair)> stackSeedRightSelector () const
 
void initExtensionProbabilities (size_t n, size_t m)
 
void beginExtensionProbabilitySeed (size_t i1, size_t i2)
 
void addExtensionProbabilityRoot (size_t i1, size_t j1, size_t i2, size_t j2, Z_type partZ, bool left, bool right)
 
void finishExtensionProbabilitySeed ()
 
void commitExtensionProbabilities ()
 
std::vector< Interaction::BasePair > extensionSeedPrefix (size_t i1, size_t i2, size_t before) const
 
virtual void fillHybridZ_left (const size_t j1, const size_t j2)
 
virtual void fillHybridZ_right (const size_t i1, const size_t i2)
 
virtual void traceBack (Interaction &interaction) override
 
virtual E_type getNonOverlappingEnergy (const size_t si1, const size_t si2, const size_t sj1, const size_t sj2)
 
void printMatrix (const Z2dMatrix &matrix)
 
- 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
 
- 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

std::unique_ptr< ExtensionProbabilityTrace > extensionProbabilityTrace
 
BasePairProbabilities * pairProbabilities
 optional sequence-pair owner, never deleted or finalized by the predictor
 
Z2dMatrix hybridZ_left
 partition function of all interaction hybrids that start on the left side of the seed including E_init
 
SeedHandlerIdxOffset seedHandler
 the seed handler (with idx offset)
 
Z2dMatrix hybridZ_right
 partition function of all interaction hybrids that start on the right side of the seed excluding E_init
 
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

Implements seed-based space-efficient interaction prediction based on minimizing ensemble free energy of interaction sites.

Note, for each seed start (i1,i2) only the mfe seed is considered for the overall interaction computation instead of considering all possible seeds starting at (i1,i2). Stack-only seeds use a seed-avoiding left extension and an unconstrained right extension at the first completed seed, counting each interaction once. Gapped seeds retain the legacy extension implementation.

Author
Frank Gelhausen
Martin Raden

Member Typedef Documentation

◆ Z2dMatrix

matrix type to hold the partition functions for interaction site starts

Constructor & Destructor Documentation

◆ PredictorMfeEns2dSeedExtension()

IntaRNA::PredictorMfeEns2dSeedExtension::PredictorMfeEns2dSeedExtension ( const InteractionEnergy &  energy,
OutputHandler &  output,
PredictionTracker *  predTracker,
SeedHandler *  seedHandler,
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; must outlive predictions and remain pending until all disjoint regions have succeeded
seedHandlerthe seed handler to be used

◆ ~PredictorMfeEns2dSeedExtension()

virtual IntaRNA::PredictorMfeEns2dSeedExtension::~PredictorMfeEns2dSeedExtension ( )
overridevirtual

data cleanup

Member Function Documentation

◆ addExtensionProbabilityRoot()

void IntaRNA::PredictorMfeEns2dSeedExtension::addExtensionProbabilityRoot ( size_t  i1,
size_t  j1,
size_t  i2,
size_t  j2,
Z_type  partZ,
bool  left,
bool  right 
)
protected

Add one accepted left/seed/right objective to the optional reverse trace. All coordinates are local, with seed boundaries in increasing DP order.

Parameters
leftwhether the left matrix is a factor (otherwise use initiation)
rightwhether the right matrix is a factor

◆ addSeedPartition()

void IntaRNA::PredictorMfeEns2dSeedExtension::addSeedPartition ( Interaction::BasePair  seed,
Interaction::BasePair  left,
Interaction::BasePair  right,
Z_type  hybridZ 
)
protected

Retain an anchor-specific site ensemble before full-site aggregation.

Parameters
seedlocal anchor start, sequence 2 reversed
leftlocal left site boundary
rightlocal right site boundary
hybridZpartition assigned to this left-most seed, including initiation

◆ beginExtensionProbabilitySeed()

void IntaRNA::PredictorMfeEns2dSeedExtension::beginExtensionProbabilitySeed ( size_t  i1,
size_t  i2 
)
protected

Store the current anchor seed's actual pairs, including its endpoints.

◆ commitExtensionProbabilities()

void IntaRNA::PredictorMfeEns2dSeedExtension::commitExtensionProbabilities ( )
protected

Validate and atomically commit this region in original sequence order.

◆ exactBoundaryWeight()

virtual Z_type IntaRNA::PredictorMfeEns2dSeedExtension::exactBoundaryWeight ( size_t  i1,
size_t  j1,
size_t  i2,
size_t  j2 
) const
protectedvirtual

Shared forward/outside objective coefficient. Override here for supported reweighting; return zero for forbidden boundaries. Coordinates are local.

Returns
complete boundary Boltzmann factor (ED, dangles, ends, energyAdd)

◆ extensionSeedPrefix()

std::vector< Interaction::BasePair > IntaRNA::PredictorMfeEns2dSeedExtension::extensionSeedPrefix ( size_t  i1,
size_t  i2,
size_t  before 
) const
protected

Actual seed pairs strictly before the given local target coordinate.

◆ fillHybridZ_left()

virtual void IntaRNA::PredictorMfeEns2dSeedExtension::fillHybridZ_left ( const size_t  j1,
const size_t  j2 
)
protectedvirtual

Computes all entries of the hybridE matrix for interactions ending in p=j1 and q=j2 and report all valid interactions to updateOptima()

Parameters
j1end of the interaction within seq 1
j2end of the interaction within seq 2

Reimplemented in IntaRNA::PredictorMfeEns2dHeuristicSeedExtension.

◆ fillHybridZ_right()

virtual void IntaRNA::PredictorMfeEns2dSeedExtension::fillHybridZ_right ( const size_t  i1,
const size_t  i2 
)
protectedvirtual

Computes all entries of the hybridE matrix for interactions starting in i1 and i2 and report all valid interactions to updateOptima()

Note: (i1,i2) have to be complementary (right-most base pair of seed)

Parameters
i1end of the interaction within seq 1
i2end of the interaction within seq 2

◆ finishExtensionProbabilitySeed()

void IntaRNA::PredictorMfeEns2dSeedExtension::finishExtensionProbabilitySeed ( )
protected

Reverse both extension traces and accumulate actual pair numerators.

◆ getNonOverlappingEnergy()

virtual E_type IntaRNA::PredictorMfeEns2dSeedExtension::getNonOverlappingEnergy ( const size_t  si1,
const size_t  si2,
const size_t  sj1,
const size_t  sj2 
)
protectedvirtual

Returns the hybridization energy of the non overlapping part of seeds starting at si and sj

Parameters
si1the index of seed1 in the first sequence
si2the index of seed1 in the second sequence
sj1the index of seed2 in the first sequence
sj2the index of seed2 in the second sequence

◆ initExtensionProbabilities()

void IntaRNA::PredictorMfeEns2dSeedExtension::initExtensionProbabilities ( size_t  n,
size_t  m 
)
protected

Begin a regional trace; no allocation if no probability sink was requested.

◆ predict()

virtual void IntaRNA::PredictorMfeEns2dSeedExtension::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.

Each considered interaction contains a seed according to the seed handler constraints.

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

Implements IntaRNA::Predictor.

Reimplemented in IntaRNA::PredictorMfeEns2dHeuristicSeedExtension.

◆ predictStackSeeds()

void IntaRNA::PredictorMfeEns2dSeedExtension::predictStackSeeds ( const IndexRange &  r1,
const IndexRange &  r2 
)
protected

Run the selected disjoint stack-seed partition backend.

◆ prepareStackSeedExtensions()

virtual void IntaRNA::PredictorMfeEns2dSeedExtension::prepareStackSeedExtensions ( size_t  n,
size_t  m,
const StackSeedDomain &  seeds 
)
protectedvirtual

Prepare optional heuristic right endpoints for the admitted stack seeds.

Parameters
nfirst active range length
msecond active range length
seedscontained seeds used by the partition recurrence

Reimplemented in IntaRNA::PredictorMfeEns2dHeuristicSeedExtension.

◆ printMatrix()

void IntaRNA::PredictorMfeEns2dSeedExtension::printMatrix ( const Z2dMatrix &  matrix)
protected

◆ stackSeedRightSelector()

virtual std::function< Interaction::BasePair(Interaction::BasePair, Interaction::BasePair)> IntaRNA::PredictorMfeEns2dSeedExtension::stackSeedRightSelector ( ) const
protectedvirtual

Select one right endpoint per anchor for the heuristic retained ensemble. An empty function requests the full exact ensemble. Nonempty selectors use local increasing coordinates and receive the anchor's first and last pair.

Returns
selector shared by the forward and outside recurrences

Reimplemented in IntaRNA::PredictorMfeEns2dHeuristicSeedExtension.

◆ traceBack()

virtual void IntaRNA::PredictorMfeEns2dSeedExtension::traceBack ( Interaction &  interaction)
overrideprotectedvirtual

adds seed information and calls traceBack() of super class

Parameters
interactionIN/OUT the interaction to fill

Reimplemented from IntaRNA::PredictorMfeEns.

Member Data Documentation

◆ energy

InteractionEnergyIdxOffset IntaRNA::Predictor::energy
protected

access to the interaction energy handler of the super class

◆ extensionProbabilityTrace

std::unique_ptr<ExtensionProbabilityTrace> IntaRNA::PredictorMfeEns2dSeedExtension::extensionProbabilityTrace
protected

◆ hybridZ_left

Z2dMatrix IntaRNA::PredictorMfeEns2dSeedExtension::hybridZ_left
protected

partition function of all interaction hybrids that start on the left side of the seed including E_init

◆ hybridZ_right

Z2dMatrix IntaRNA::PredictorMfeEns2dSeedExtension::hybridZ_right
protected

partition function of all interaction hybrids that start on the right side of the seed excluding E_init

◆ output

OutputHandler& IntaRNA::Predictor::output
protected

access to the output handler of the super class

◆ pairProbabilities

BasePairProbabilities* IntaRNA::PredictorMfeEns2dSeedExtension::pairProbabilities
protected

optional sequence-pair owner, never deleted or finalized by the predictor

◆ seedHandler

SeedHandlerIdxOffset IntaRNA::PredictorMfeEns2dSeedExtension::seedHandler
protected

the seed handler (with idx offset)


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