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

#include <SeedHandlerMfe.h>

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

Public Types

typedef boost::multi_array< E_type, 5 > SeedRecMatrix
 
typedef boost::array< SeedRecMatrix::index, 5 > SeedIndex
 
typedef Matrix< std::pair< E_type, size_t > > SeedMatrix
 

Public Member Functions

 SeedHandlerMfe (const InteractionEnergy &energy, const SeedConstraint &seedConstraint)
 
virtual ~SeedHandlerMfe ()
 
virtual size_t fillSeed (const size_t i1, const size_t j1, const size_t i2, const size_t j2)
 
virtual void traceBackSeed (Interaction &interaction, const size_t i1, const size_t i2) const
 
virtual E_type getSeedE (const size_t i1, const size_t i2) const
 
virtual bool isSeedBound (const size_t i1, const size_t i2) const
 
virtual size_t getSeedLength1 (const size_t i1, const size_t i2) const
 
virtual size_t getSeedLength2 (const size_t i1, const size_t i2) const
 
- Public Member Functions inherited from IntaRNA::SeedHandler
 SeedHandler (const InteractionEnergy &energy, const SeedConstraint &seedConstraint)
 
virtual ~SeedHandler ()
 
virtual const SeedConstraint & getConstraint () const
 
virtual const InteractionEnergy & getInteractionEnergy () const
 
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 Member Functions

E_type getSeedE (const size_t i1, const size_t i2, const size_t bpInbetween, const size_t u1, const size_t u2) const
 
void setSeedE (const size_t i1, const size_t i2, const size_t bpInbetween, const size_t u1, const size_t u2, const E_type E)
 
size_t encodeSeedLength (const size_t l1, const size_t l2) const
 
size_t decodeSeedLength1 (const size_t code) const
 
size_t decodeSeedLength2 (const size_t code) const
 
void traceBackSeed (Interaction &interaction, const size_t i1, const size_t i2, const size_t bp, const size_t u1, const size_t u2) const
 

Protected Attributes

SeedRecMatrix seedE_rec
 
SeedMatrix seed
 
size_t offset1
 offset for seq1 indices for the current (restricted) matrices
 
size_t offset2
 offset for seq2 indices for the current (restricted) matrices
 
- Protected Attributes inherited from IntaRNA::SeedHandler
const InteractionEnergy & energy
 the used energy function
 
const SeedConstraint & seedConstraint
 the seed constraint to be applied
 

Detailed Description

Handler to provide mfe seed interaction information for each intermolecular index combination (= left end of seed).

Member Typedef Documentation

◆ SeedIndex

typedef boost::array<SeedRecMatrix::index, 5> IntaRNA::SeedHandlerMfe::SeedIndex

defines the seed data {{ i1, i2, bpInbetween, u1, u2 }} to access elements of the SeedRecMatrix

◆ SeedMatrix

typedef Matrix< std::pair<E_type, size_t> > IntaRNA::SeedHandlerMfe::SeedMatrix

matrix to store the seed information for each seed left side (i1,i2); it holds both the energy (first) as well as the length of the seed using the length combination using encodeSeedLength()

◆ SeedRecMatrix

typedef boost::multi_array<E_type,5> IntaRNA::SeedHandlerMfe::SeedRecMatrix

5D matrix type to hold the mfe energies for seed interactions of the ranges i1..(i1+bp+u1-1) with i2..(i2+bp+u2-1), with i1,i2 = the start index of the seed in seq1/2 bp = the number of base pairs within the seed bpInbetween = the number of base pairs enclosed by left and right base pair, ie. == (bp-2) u1/u2 = the number of unpaired positions within the seed, using the index [i1][i2][bpInbetween][u1][u2] or a SeedIndex object

Constructor & Destructor Documentation

◆ SeedHandlerMfe()

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

Construction

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

◆ ~SeedHandlerMfe()

IntaRNA::SeedHandlerMfe::~SeedHandlerMfe ( )
inlinevirtual

destruction

Member Function Documentation

◆ decodeSeedLength1()

size_t IntaRNA::SeedHandlerMfe::decodeSeedLength1 ( const size_t  code) const
inlineprotected

Decodes the length of the seed within sequence 1 from an encoding generated with encodeSeedLength()

Parameters
codethe lengths encoding
Returns
the length of the seed in seq1

◆ decodeSeedLength2()

size_t IntaRNA::SeedHandlerMfe::decodeSeedLength2 ( const size_t  code) const
inlineprotected

Decodes the length of the seed within sequence 2 from an encoding generated with encodeSeedLength()

Parameters
codethe lengths encoding
Returns
the length of the seed in seq2

◆ encodeSeedLength()

size_t IntaRNA::SeedHandlerMfe::encodeSeedLength ( const size_t  l1,
const size_t  l2 
) const
inlineprotected

Encodes the seed lengths into one number

Parameters
l1the length of the seed in seq1
l2the length of the seed in seq2
Returns
the combined encoding = (l1 + l2*(max_l1+1))

◆ fillSeed()

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

Computes the seed matrix 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

Implements IntaRNA::SeedHandler.

◆ getSeedE() [1/2]

E_type IntaRNA::SeedHandlerMfe::getSeedE ( const size_t  i1,
const size_t  i2 
) const
inlinevirtual

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

Implements IntaRNA::SeedHandler.

◆ getSeedE() [2/2]

E_type IntaRNA::SeedHandlerMfe::getSeedE ( const size_t  i1,
const size_t  i2,
const size_t  bpInbetween,
const size_t  u1,
const size_t  u2 
) const
inlineprotected

Provides the seed energy during recursion.

Parameters
i1the seed left end in seq 1
i2the seed left end in seq 2
bpInbetweenthe number of seed base pairs enclosed by the left- and right-most base pair, ie. bpSeed-2
u1the number of unpaired bases within seq 1
u2the number of unpaired bases within seq 2
Returns
the energy of the according (sub)seed

◆ getSeedLength1()

size_t IntaRNA::SeedHandlerMfe::getSeedLength1 ( const size_t  i1,
const size_t  i2 
) const
inlinevirtual

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

Implements IntaRNA::SeedHandler.

◆ getSeedLength2()

size_t IntaRNA::SeedHandlerMfe::getSeedLength2 ( const size_t  i1,
const size_t  i2 
) const
inlinevirtual

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

Implements IntaRNA::SeedHandler.

◆ isSeedBound()

bool IntaRNA::SeedHandlerMfe::isSeedBound ( const size_t  i1,
const size_t  i2 
) const
inlinevirtual

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

Implements IntaRNA::SeedHandler.

◆ setSeedE()

void IntaRNA::SeedHandlerMfe::setSeedE ( const size_t  i1,
const size_t  i2,
const size_t  bpInbetween,
const size_t  u1,
const size_t  u2,
const E_type  E 
)
inlineprotected

Fills the seed energy during recursion.

NOTE: internally a ring-list data structure is used which reuses memory instead of allocating mem for all possible parameter combinations. Thus, you have to call the method in appropriate order depending on your seed recursion.

Parameters
i1the seed left end in seq 1
i2the seed left end in seq 2
bpInbetweenthe number of seed base pairs enclosed by the left- and right-most base pair, ie. bpSeed-2
u1the number of unpaired bases within seq 1
u2the number of unpaired bases within seq 2
Ethe energy value to be set

◆ traceBackSeed() [1/2]

void IntaRNA::SeedHandlerMfe::traceBackSeed ( Interaction &  interaction,
const size_t  i1,
const size_t  i2 
) const
inlinevirtual

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

Implements IntaRNA::SeedHandler.

◆ traceBackSeed() [2/2]

void IntaRNA::SeedHandlerMfe::traceBackSeed ( Interaction &  interaction,
const size_t  i1,
const size_t  i2,
const size_t  bp,
const size_t  u1,
const size_t  u2 
) const
protected

Fills a given interaction with the according hybridizing base pairs of the provided seed interaction (excluding the right-most seed base pair)

Parameters
interactionIN/OUT the interaction to fill
i1the seed left end in seq 1 (index including offset)
i2the seed left end in seq 2 (index including offset)
bpthe number of base pairs (bp+2) within the seed so far
u1the number of unpaired bases within seq 1
u2the number of unpaired bases within seq 2

Member Data Documentation

◆ offset1

size_t IntaRNA::SeedHandlerMfe::offset1
protected

offset for seq1 indices for the current (restricted) matrices

◆ offset2

size_t IntaRNA::SeedHandlerMfe::offset2
protected

offset for seq2 indices for the current (restricted) matrices

◆ seed

SeedMatrix IntaRNA::SeedHandlerMfe::seed
protected

the seed mfe information for seeds starting at (i1,i2) TODO replace with sparse data structure

◆ seedE_rec

SeedRecMatrix IntaRNA::SeedHandlerMfe::seedE_rec
protected

the recursion data for the computation of a seed interaction i1..(i1+bpInbetween+u1-1) with i2..(i2+bpInbetween+u2-1) using the indexing [i1][i2][bpInbetween][u1][u2]


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