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

#include <SeedHandlerIdxOffset.h>

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

Public Member Functions

 SeedHandlerIdxOffset (SeedHandler *seedHandler, const bool deleteOnDestruction=true)
 
virtual ~SeedHandlerIdxOffset ()
 
size_t getOffset1 () const
 
void setOffset1 (size_t offset1)
 
size_t getOffset2 () const
 
void setOffset2 (size_t offset2)
 
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)
 
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
 
virtual SeedHandler & getOriginalSeedHandler ()
 
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
 
- Public Member Functions inherited from IntaRNA::SeedHandler
 SeedHandler (const InteractionEnergy &energy, const SeedConstraint &seedConstraint)
 
virtual ~SeedHandler ()
 

Protected Attributes

SeedHandler * seedHandlerOriginal
 the index shifted seed handler
 
const bool deleteOnDestruction
 whether or not the original seed handler is to be destroyed
 
SeedConstraint seedConstraintOffset
 the index shifted seed constraint
 
size_t idxOffset1
 offset for indices in seq1
 
size_t idxOffset2
 offset for indices in seq2
 
InteractionEnergyIdxOffset energyIdxOffset
 dedicated energy object to avoid
 
- Protected Attributes inherited from IntaRNA::SeedHandler
const InteractionEnergy & energy
 the used energy function
 
const SeedConstraint & seedConstraint
 the seed constraint to be applied
 

Detailed Description

Wrapper around a SeedHandler object where indices are shifted by a given positive offset (shifted towards infinity). This is useful for local interaction computations.

Author
Martin Mann

Constructor & Destructor Documentation

◆ SeedHandlerIdxOffset()

IntaRNA::SeedHandlerIdxOffset::SeedHandlerIdxOffset ( SeedHandler *  seedHandler,
const bool  deleteOnDestruction = true 
)
inline

Construction

Parameters
seedHandlerthe seed handler to be wrapped
deleteOnDestructionwhether or not the seedHandler is to be deleted within the destructor

◆ ~SeedHandlerIdxOffset()

IntaRNA::SeedHandlerIdxOffset::~SeedHandlerIdxOffset ( )
inlinevirtual

destruction of this object and the wrapped seed handler

Member Function Documentation

◆ addSeeds()

void IntaRNA::SeedHandlerIdxOffset::addSeeds ( Interaction &  i) const
inlinevirtual

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 from IntaRNA::SeedHandler.

◆ areLoopOverlapping()

bool IntaRNA::SeedHandlerIdxOffset::areLoopOverlapping ( const size_t  i1,
const size_t  i2,
const size_t  k1,
const size_t  k2 
) const
inlinevirtual

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 from IntaRNA::SeedHandler.

◆ fillSeed()

size_t IntaRNA::SeedHandlerIdxOffset::fillSeed ( const size_t  i1,
const size_t  j1,
const size_t  i2,
const size_t  j2 
)
inlinevirtual

Computes the seed matrix for the given interval boundaries

Note, the indices are shifted by an offset for computation.

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
number of possible seed interactions

Implements IntaRNA::SeedHandler.

◆ getConstraint()

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

Access to the underlying seed constraint

Returns
the used seed constraint

Reimplemented from IntaRNA::SeedHandler.

◆ getInteractionEnergy()

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

Access to the underlying interaction energy function

Returns
the used energy function

Reimplemented from IntaRNA::SeedHandler.

◆ getOffset1()

size_t IntaRNA::SeedHandlerIdxOffset::getOffset1 ( ) const
inline

Access to the currently used index offset for sequence 1

Returns
the index offset for sequence 1 used

◆ getOffset2()

size_t IntaRNA::SeedHandlerIdxOffset::getOffset2 ( ) const
inline

Access to the currently used index offset for sequence 2

Returns
the index offset for sequence 2 used

◆ getOriginalSeedHandler()

SeedHandler & IntaRNA::SeedHandlerIdxOffset::getOriginalSeedHandler ( )
inlinevirtual

Access to the wrapped SeedHandler instance.

Returns
the internally used SeedHandler without offset

◆ getSeedE()

E_type IntaRNA::SeedHandlerIdxOffset::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)

Note, the indices are shifted by an offset for computation.

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.

◆ getSeedLength1()

size_t IntaRNA::SeedHandlerIdxOffset::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)

Note, the indices are shifted by an offset for computation.

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::SeedHandlerIdxOffset::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)

Note, the indices are shifted by an offset for computation.

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.

◆ isFeasibleSeedBasePair()

bool IntaRNA::SeedHandlerIdxOffset::isFeasibleSeedBasePair ( const size_t  i1,
const size_t  i2,
const bool  atEndOfSeed = false 
) const
inlinevirtual

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 from IntaRNA::SeedHandler.

◆ isSeedBound()

bool IntaRNA::SeedHandlerIdxOffset::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.

◆ setOffset1()

void IntaRNA::SeedHandlerIdxOffset::setOffset1 ( size_t  offset1)
inline

Sets the index offset to be used for sequence 1

Parameters
offset1the index offset for sequence 1 to be used

◆ setOffset2()

void IntaRNA::SeedHandlerIdxOffset::setOffset2 ( size_t  offset2)
inline

Sets the index offset to be used for sequence 2

Parameters
offset2the index offset for sequence 2 to be used

◆ traceBackSeed()

void IntaRNA::SeedHandlerIdxOffset::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!

Note, the indices are shifted by an offset for computation.

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.

◆ updateToNextSeed()

bool IntaRNA::SeedHandlerIdxOffset::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
inlinevirtual

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 from IntaRNA::SeedHandler.

Member Data Documentation

◆ deleteOnDestruction

const bool IntaRNA::SeedHandlerIdxOffset::deleteOnDestruction
protected

whether or not the original seed handler is to be destroyed

◆ energyIdxOffset

InteractionEnergyIdxOffset IntaRNA::SeedHandlerIdxOffset::energyIdxOffset
protected

dedicated energy object to avoid

◆ idxOffset1

size_t IntaRNA::SeedHandlerIdxOffset::idxOffset1
protected

offset for indices in seq1

◆ idxOffset2

size_t IntaRNA::SeedHandlerIdxOffset::idxOffset2
protected

offset for indices in seq2

◆ seedConstraintOffset

SeedConstraint IntaRNA::SeedHandlerIdxOffset::seedConstraintOffset
protected

the index shifted seed constraint

◆ seedHandlerOriginal

SeedHandler* IntaRNA::SeedHandlerIdxOffset::seedHandlerOriginal
protected

the index shifted seed handler


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