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

#include <SeedHandler.h>

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

Public Member Functions

 SeedHandler (const InteractionEnergy &energy, const SeedConstraint &seedConstraint)
 
virtual ~SeedHandler ()
 
virtual const SeedConstraint & getConstraint () const
 
virtual const InteractionEnergy & getInteractionEnergy () const
 
virtual size_t fillSeed (const size_t i1, const size_t j1, const size_t i2, const size_t j2)=0
 
virtual void traceBackSeed (Interaction &interaction, const size_t i1, const size_t i2) const =0
 
virtual E_type getSeedE (const size_t i1, const size_t i2) const =0
 
virtual bool isSeedBound (const size_t i1, const size_t i2) const =0
 
virtual size_t getSeedLength1 (const size_t i1, const size_t i2) const =0
 
virtual size_t getSeedLength2 (const size_t i1, const size_t i2) const =0
 
virtual bool updateToNextSeed (size_t &i1, size_t &i2, const size_t i1min=0, const size_t i1max=RnaSequence::lastPos, const size_t i2min=0, const size_t i2max=RnaSequence::lastPos) const
 
virtual void addSeeds (Interaction &i) const
 
virtual bool areLoopOverlapping (const size_t i1, const size_t i2, const size_t k1, const size_t k2) const
 
virtual bool isFeasibleSeedBasePair (const size_t i1, const size_t i2, const bool atEndOfSeed=false) const
 

Protected Attributes

const InteractionEnergy & energy
 the used energy function
 
const SeedConstraint & seedConstraint
 the seed constraint to be applied
 

Detailed Description

Abstract interface to provide seed interaction information

Constructor & Destructor Documentation

◆ SeedHandler()

IntaRNA::SeedHandler::SeedHandler ( const InteractionEnergy &  energy,
const SeedConstraint &  seedConstraint 
)
inline

Construction

Parameters
energythe energy function to be used for seed prediction
seedConstraintthe seed constraint to be applied

◆ ~SeedHandler()

IntaRNA::SeedHandler::~SeedHandler ( )
inlinevirtual

destruction

Member Function Documentation

◆ addSeeds()

virtual void IntaRNA::SeedHandler::addSeeds ( Interaction &  i) const
virtual

Adds all seeds to a given interaction that are completely covered by its base pairs.

Parameters
ithe interaction to update with indexing in global in-sequence order

Reimplemented in IntaRNA::SeedHandlerIdxOffset.

◆ areLoopOverlapping()

virtual bool IntaRNA::SeedHandler::areLoopOverlapping ( const size_t  i1,
const size_t  i2,
const size_t  k1,
const size_t  k2 
) const
virtual

Checks whether or not two seeds are loop overlapping, ie. given i1 < k1, the last x (>1) base pairs of seed(i1,i2) are equal to the first x base pairs of seed(k1,k2), or vice versa if k1 < i1.

Parameters
i1the left most interacting base of seq1 of seedA
i2the left most interacting base of seq2 of seedA
k1the left most interacting base of seq1 of seedB
k2the left most interacting base of seq2 of seedB
Returns
true if seedA and seedB exist and they are loop overlapping; false otherwise

Reimplemented in IntaRNA::SeedHandlerIdxOffset.

◆ fillSeed()

virtual size_t IntaRNA::SeedHandler::fillSeed ( const size_t  i1,
const size_t  j1,
const size_t  i2,
const size_t  j2 
)
pure virtual

Computes the seed information for the given interval boundaries

Parameters
i1the first index of seq1 that might interact
j1the last index of seq1 that might interact
i2the first index of seq2 that might interact
j2the last index of seq2 that might interact
Returns
the number of potential seed interactions

Implemented in IntaRNA::SeedHandlerExplicit, IntaRNA::SeedHandlerIdxOffset, IntaRNA::SeedHandlerMfe, and IntaRNA::SeedHandlerNoBulge.

◆ getConstraint()

const SeedConstraint & IntaRNA::SeedHandler::getConstraint ( ) const
inlinevirtual

Access to the underlying seed constraint

Returns
the used seed constraint

Reimplemented in IntaRNA::SeedHandlerIdxOffset.

◆ getInteractionEnergy()

const InteractionEnergy & IntaRNA::SeedHandler::getInteractionEnergy ( ) const
inlinevirtual

Access to the underlying interaction energy function

Returns
the used energy function

Reimplemented in IntaRNA::SeedHandlerIdxOffset.

◆ getSeedE()

virtual E_type IntaRNA::SeedHandler::getSeedE ( const size_t  i1,
const size_t  i2 
) const
pure virtual

Access to the mfe of any seed with left-most base pair (i1,i2)

Parameters
i1the left most interacting base of seq1
i2the left most interacting base of seq2
Returns
the mfe of any seed starting at (i1,i2) or E_INF if none possible

Implemented in IntaRNA::SeedHandlerExplicit, IntaRNA::SeedHandlerIdxOffset, IntaRNA::SeedHandlerMfe, and IntaRNA::SeedHandlerNoBulge.

◆ getSeedLength1()

virtual size_t IntaRNA::SeedHandler::getSeedLength1 ( const size_t  i1,
const size_t  i2 
) const
pure virtual

Access to the length in seq1 of the mfe seed with left-most base pair (i1,i2)

Parameters
i1the left most interacting base of seq1
i2the left most interacting base of seq2
Returns
the length in seq1 of the mfe seed starting at (i1,i2) or 0 if none possible

Implemented in IntaRNA::SeedHandlerExplicit, IntaRNA::SeedHandlerIdxOffset, IntaRNA::SeedHandlerMfe, and IntaRNA::SeedHandlerNoBulge.

◆ getSeedLength2()

virtual size_t IntaRNA::SeedHandler::getSeedLength2 ( const size_t  i1,
const size_t  i2 
) const
pure virtual

Access to the length in seq2 of the mfe seed with left-most base pair (i1,i2)

Parameters
i1the left most interacting base of seq1
i2the left most interacting base of seq2
Returns
the length in seq2 of the mfe seed starting at (i1,i2) or 0 if none possible

Implemented in IntaRNA::SeedHandlerExplicit, IntaRNA::SeedHandlerIdxOffset, IntaRNA::SeedHandlerMfe, and IntaRNA::SeedHandlerNoBulge.

◆ isFeasibleSeedBasePair()

virtual bool IntaRNA::SeedHandler::isFeasibleSeedBasePair ( const size_t  i1,
const size_t  i2,
const bool  atEndOfSeed = false 
) const
virtual

Checks whether or not a given index pair is a valid seed base pair

Parameters
i1the interacting base of seq1
i2the interacting base of seq2
atEndOfSeedwhether or not the (i1,i2) form the end of a seed
Returns
true if (i1,i2) are complementary, ED(i,i) < maxED, and both i1 and i2 are in allowed regions; false otherwise

Reimplemented in IntaRNA::SeedHandlerIdxOffset.

◆ isSeedBound()

virtual bool IntaRNA::SeedHandler::isSeedBound ( const size_t  i1,
const size_t  i2 
) const
pure virtual

Checks whether or not a given base pair is the left-most base pair of any seed

Parameters
i1the interacting base of seq1
i2the interacting base of seq2
Returns
true if (i1,i2) is the left most base pair of some seed; false otherwise

Implemented in IntaRNA::SeedHandlerExplicit, IntaRNA::SeedHandlerIdxOffset, IntaRNA::SeedHandlerMfe, and IntaRNA::SeedHandlerNoBulge.

◆ traceBackSeed()

virtual void IntaRNA::SeedHandler::traceBackSeed ( Interaction &  interaction,
const size_t  i1,
const size_t  i2 
) const
pure virtual

Identifies the base pairs of the mfe seed interaction starting at i1,i2 and writes them to the provided container

NOTE: the left- and right-most base pairs are excluded!

Parameters
interactionthe container to add the base pairs too
i1the start of the seed in seq1
i2the start of the seed in seq2

Implemented in IntaRNA::SeedHandlerExplicit, IntaRNA::SeedHandlerIdxOffset, IntaRNA::SeedHandlerMfe, and IntaRNA::SeedHandlerNoBulge.

◆ updateToNextSeed()

virtual bool IntaRNA::SeedHandler::updateToNextSeed ( size_t &  i1,
size_t &  i2,
const size_t  i1min = 0,
const size_t  i1max = RnaSequence::lastPos,
const size_t  i2min = 0,
const size_t  i2max = RnaSequence::lastPos 
) const
virtual

Replace the input variables i1 and i2 to values to within the given range that correspond to

  • the first seed (if the given index pair is no valid seed start or one of the indices is out of range bounds)
  • the next seed according to some seed order

The indices are not updated if the last seed within the range is given or no seed within the range could be found. It returns whether or not the input variables have been updated.

Note, if changed, only the seed left-most base pair is within the range but the full seed indices might exceed i1max or i2max.

Parameters
i1seq1 seed index to be changed
i2seq2 seed index to be changed
i1minfirst position within seq1 (inclusive)
i1maxlast position within seq1 (inclusive)
i2minfirst position within seq2 (inclusive)
i2maxlast position within seq2 (inclusive)
Returns
true if the input variables have been changed; false otherwise

Reimplemented in IntaRNA::SeedHandlerExplicit, IntaRNA::SeedHandlerIdxOffset, and IntaRNA::SeedHandlerNoBulge.

Member Data Documentation

◆ energy

const InteractionEnergy& IntaRNA::SeedHandler::energy
protected

the used energy function

◆ seedConstraint

const SeedConstraint& IntaRNA::SeedHandler::seedConstraint
protected

the seed constraint to be applied


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