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

#include <Interaction.h>

Collaboration diagram for IntaRNA::Interaction:
Collaboration graph
[legend]

Classes

class  BasePair
 type of a base pair index encoding More...
 
class  Boundary
 
class  Seed
 

Public Types

typedef std::vector< BasePair > PairingVec
 type of a vector encoding base pair indices that are interacting
 
typedef std::set< Seed > SeedSet
 type of a vector containing seeds
 

Public Member Functions

 Interaction (const RnaSequence &s1, const RnaSequence &s2)
 
 Interaction (const Interaction &toCopy)
 
 Interaction (const InteractionRange &range)
 
virtual ~Interaction ()
 
bool isValid () const
 
bool isEmpty () const
 
void sort ()
 
void clear ()
 
void setSeedRange (const BasePair bp_left, const BasePair bp_right, const E_type energy)
 
IndexRangeList getSeedRanges1 () const
 
IndexRangeList getSeedRanges2 () const
 
Interaction & operator= (const Interaction &toCopy)
 
Interaction & operator= (const InteractionRange &range)
 
bool operator< (const Interaction &i) const
 
bool operator== (const Interaction &i) const
 

Static Public Member Functions

static bool compareEnergy (const E_type &energy, const Interaction &hasLargerE)
 
static std::string dotBar (const Interaction &i, const bool fullLength=false)
 
static std::string dotBracket (const Interaction &i, const char symOpen='(', const char symClose=')', const bool fullLength=false)
 

Public Attributes

const RnaSequence * s1
 the first interaction partner
 
const RnaSequence * s2
 the second interaction partner
 
PairingVec basePairs
 interacting indices
 
E_type energy
 energy of the interaction
 
SeedSet * seed
 optional: seed information
 

Static Protected Member Functions

template<typename bpIterator >
static std::string dotSomething (bpIterator bpBegin, const bpIterator bpEnd, const bool handleSeq1, const char bpSymbol)
 

Friends

std::ostream & operator<< (std::ostream &out, const BasePair &bp)
 
std::ostream & operator<< (std::ostream &out, const Boundary &b)
 
std::ostream & operator<< (std::ostream &out, const Interaction &i)
 

Detailed Description

Data structure to describe and store an Interaction

Member Typedef Documentation

◆ PairingVec

type of a vector encoding base pair indices that are interacting

◆ SeedSet

type of a vector containing seeds

Constructor & Destructor Documentation

◆ Interaction() [1/3]

IntaRNA::Interaction::Interaction ( const RnaSequence &  s1,
const RnaSequence &  s2 
)
inline

construction

Parameters
s1the sequence of the first interaction partner
s2the sequence of the second interaction partner

◆ Interaction() [2/3]

IntaRNA::Interaction::Interaction ( const Interaction &  toCopy)
inline

copy construction from interaction

Parameters
toCopythe interaction range to make this a copy of

◆ Interaction() [3/3]

IntaRNA::Interaction::Interaction ( const InteractionRange &  range)
inline

construction from interaction range, ie. forming base pairs at the beginning and end of the interaction range.

NOTE: the ends have to be complementary nucleotides

Parameters
rangethe interaction range to be used for initialization

◆ ~Interaction()

IntaRNA::Interaction::~Interaction ( )
inlinevirtual

destruction

Member Function Documentation

◆ clear()

void IntaRNA::Interaction::clear ( )
inline

Clears all interaction information.

◆ compareEnergy()

bool IntaRNA::Interaction::compareEnergy ( const E_type &  energy,
const Interaction &  hasLargerE 
)
inlinestatic

Compares if an interaction has larger energy that a given value

Parameters
energythe energy to compare to
hasLargerEthe interaction that is supposed to have larger energy
Returns
(energy < (hasLargerE.energy-precisionDelta))

◆ dotBar()

static std::string IntaRNA::Interaction::dotBar ( const Interaction &  i,
const bool  fullLength = false 
)
static

Produces a dot-bar encoding of the interaction in the form

startId1 dot-bar-1 & startId2 dot-bar-2

where dot-bar-1/2 encodes all positions of the first/second sequence enclosed by the first and last base pair of the interaction. Here, a '|' bar encodes an intermolecular base pair and a '.' dot encodes unpaired positions.

Note, within this encoding, the '&' separated parts can be swapped if needed yielding still a valid encoding (for the swapped sequences).

Parameters
iinteraction to encode
fullLengthwhether or not full length base pair annotation is to be printed
Returns
the dot-bracket encoding

◆ dotBracket()

static std::string IntaRNA::Interaction::dotBracket ( const Interaction &  i,
const char  symOpen = '(',
const char  symClose = ')',
const bool  fullLength = false 
)
static

Produces a dot-bracket encoding of the interaction in VRNA style in the form

dot-bracket-1 & dot-bracket-2

where dot-bracket-1/2 encodes all positions of the first/second sequence enclosed by the first and last base pair of the interaction. In dot-bracket-1, a closing '(' parenthesis encodes an intermolecular base pair and a '.' dot encodes unpaired positions. In dot-bracket-2, closing ')' parentheses are used to mark base pairs.

Parameters
iinteraction to encode
symOpenthe symbol to be used for base pairs in dot-bracket-1
symClosethe symbol to be used for base pairs in dot-bracket-2
fullLengthwhether or not full length base pair annotation is to be printed
Returns
the VRNA-styled dot-bracket encoding

◆ dotSomething()

template<typename bpIterator >
std::string IntaRNA::Interaction::dotSomething ( bpIterator  bpBegin,
const bpIterator  bpEnd,
const bool  handleSeq1,
const char  bpSymbol 
)
inlinestaticprotected

◆ getSeedRanges1()

IndexRangeList IntaRNA::Interaction::getSeedRanges1 ( ) const

Compiles the list of ranges in seq1 covered by seeds.

Returns
the list of ranges covered by seeds in seq1

◆ getSeedRanges2()

IndexRangeList IntaRNA::Interaction::getSeedRanges2 ( ) const

Compiles the list of ranges in seq2 covered by seeds.

Returns
the list of ranges covered by seeds in seq2

◆ isEmpty()

bool IntaRNA::Interaction::isEmpty ( ) const
inline

Checks whether or not the interaction contains no base pairs.

Returns
true if the interaction encodes no base pair; false otherwise

◆ isValid()

bool IntaRNA::Interaction::isValid ( ) const

checks whether or not the current interaction is non-empty, nested and sorted.

Returns
true if the interaction encoding is non-empty, nested and sorted; false otherwise

◆ operator<()

bool IntaRNA::Interaction::operator< ( const Interaction &  i) const
inline

Checks whether or not this interaction is considered better (smaller) than another interaction of the same sequences

Parameters
ithe interaction to compare to (for the same sequences!)
Returns
energy < i.energy || (energy == i.energy && bpLeft < i.bpLeft) || (energy == i.energy && bpLeft == i.bpLeft && bpRight < i.bpRight)

◆ operator=() [1/2]

Interaction & IntaRNA::Interaction::operator= ( const Interaction &  toCopy)

Creates an interaction with one base pair for each interaction range boundary.

NOTE: the ends have to be complementary nucleotides

NOTE: the interaction energy is reset too.

Parameters
toCopythe interaction to copy
Returns
the altered object (*this)

◆ operator=() [2/2]

Interaction & IntaRNA::Interaction::operator= ( const InteractionRange &  range)

Creates an interaction with one base pair for each interaction range boundary.

NOTE: the ends have to be complementary nucleotides

NOTE: the interaction energy is reset too.

Parameters
rangethe interaction range to copy
Returns
the altered object (*this)

◆ operator==()

bool IntaRNA::Interaction::operator== ( const Interaction &  i) const

Checks whether or not this interaction equals another

Parameters
ithe interaction to compare to (for the same sequences!)
Returns
(equal sequence pointers) && (same energy) && (same positions)

◆ setSeedRange()

void IntaRNA::Interaction::setSeedRange ( const BasePair  bp_left,
const BasePair  bp_right,
const E_type  energy 
)

Sets the seedRange member according to the given data

Parameters
bp_leftleft most base pair in seed
bp_rightright most base pair in seed
energyfull energy of the seed interaction

◆ sort()

void IntaRNA::Interaction::sort ( )
inline

Sorts the stored interacting base pairs.

Friends And Related Symbol Documentation

◆ operator<< [1/3]

std::ostream & operator<< ( std::ostream &  out,
const BasePair &  bp 
)
friend

Prints the interacting base pair to stream

Parameters
outthe ostream to write to
bpthe Interaction base pair object to add
Returns
the altered stream out

◆ operator<< [2/3]

std::ostream & operator<< ( std::ostream &  out,
const Boundary &  b 
)
friend

Prints the interaction boundary to stream

Parameters
outthe ostream to write to
bthe Boundary object to add
Returns
the altered stream out

◆ operator<< [3/3]

std::ostream & operator<< ( std::ostream &  out,
const Interaction &  i 
)
friend

Prints the interacting base pairs to stream

Parameters
outthe ostream to write to
ithe Interaction object to add
Returns
the altered stream out

Member Data Documentation

◆ basePairs

PairingVec IntaRNA::Interaction::basePairs

interacting indices

◆ energy

E_type IntaRNA::Interaction::energy

energy of the interaction

◆ s1

const RnaSequence* IntaRNA::Interaction::s1

the first interaction partner

◆ s2

const RnaSequence* IntaRNA::Interaction::s2

the second interaction partner

◆ seed

SeedSet* IntaRNA::Interaction::seed

optional: seed information


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