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

#include <Accessibility.h>

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

Public Member Functions

 Accessibility (const RnaSequence &sequence, const size_t maxLength, const AccessibilityConstraint *const accConstr)
 
virtual ~Accessibility ()
 
virtual E_type getED (const size_t from, const size_t to) const =0
 
virtual const RnaSequence & getSequence () const
 
virtual size_t getMaxLength () const
 
virtual const AccessibilityConstraint & getAccConstraint () const
 
void writeRNAplfold_Pu_text (std::ostream &out, const Z_type RT) const
 
void writeRNAplfold_ED_text (std::ostream &out) const
 
virtual void writeBinary (std::ostream &out) const
 
IndexRangeList decomposeByMaxED (const size_t maxRangeLength, const size_t winSize, const size_t minRangeLength) const
 
void decomposeByMaxED (IndexRangeList &ranges, const E_type maxED, const size_t minRangeLength) const
 

Static Public Attributes

static const E_type ED_UPPER_BOUND
 upper bound for all ED return values
 

Protected Member Functions

void writeBinary (std::ostream &out, const UpperBandedMatrix< E_type > *matrix) const
 
virtual void checkIndices (const size_t from, const size_t to) const
 
void writeRNAplfold_text (std::ostream &out, const Z_type RT, const bool writeProbs) const
 

Protected Attributes

const RnaSequence & seq
 the RNA sequence the accessibilities correspond to
 
const size_t maxLength
 the maximal length of an unpaired regions to be considered
 
AccessibilityConstraint accConstraint
 accessibility constraint
 

Friends

std::ostream & operator<< (std::ostream &out, const Accessibility &acc)
 

Detailed Description

Abstract interface that represents accessibility data for a given RNA sequence.

TODO : init function to trigger accessibility computation for a certain region

Author
Martin Mann 2014

Constructor & Destructor Documentation

◆ Accessibility()

IntaRNA::Accessibility::Accessibility ( const RnaSequence &  sequence,
const size_t  maxLength,
const AccessibilityConstraint *const  accConstr 
)
inline

Construction

Parameters
sequencethe sequence the accessibility data belongs to
maxLengththe maximal length of accessible regions (>0) to be considered. 0 defaults to the full sequence's length, otherwise is is internally set to min(maxLength,seq.length).
accConstroptional accessibility constraint

◆ ~Accessibility()

IntaRNA::Accessibility::~Accessibility ( )
inlinevirtual

destruction

Member Function Documentation

◆ checkIndices()

void IntaRNA::Accessibility::checkIndices ( const size_t  from,
const size_t  to 
) const
inlineprotectedvirtual

Checks the given indices to be in the range 0 <= from <= to < seq.length and throws a std::runtime_error if the constraint is not met.

Parameters
fromthe start index of the regions
tothe end index of the regions
Exceptions
std::runtime_errorin case it does not hold 0 <= from <= to < seq.length

◆ decomposeByMaxED() [1/2]

IndexRangeList IntaRNA::Accessibility::decomposeByMaxED ( const size_t  maxRangeLength,
const size_t  winSize,
const size_t  minRangeLength 
) const

Identifies regions of high accessibility by decomposing the sequence range at positions with lowest accessibility (highest ED value). This is done recursively, i.e. ranges that exceed the maxRegionLength are further decomposed (using their local max ED value) until the resulting subregions are below the given maxRangeLength.

Parameters
maxRangeLengththe maximal length of a resulting highly accessible sequence region
winSizethe ED window size to be used to identify low accessible regions. The center index of the identified window is used as split point for decomposition. Has to be greater than 0 and smaller than maxRangeLength, i.e in (0,maxRangeLength)
minRangeLengththe minimal length of a resulting sequence region
Returns
the list of index ranges of highly accessible regions of the sequence

◆ decomposeByMaxED() [2/2]

void IntaRNA::Accessibility::decomposeByMaxED ( IndexRangeList &  ranges,
const E_type  maxED,
const size_t  minRangeLength 
) const

Decomposes a given range list into subranges that contain only positions where the position-wise ED value is below or equal to a given threshold, since any interaction site enclosing this positions has a higher ED.

Parameters
rangesINOUT the list of ranges to decompose
maxEDthe maximal ED threshold (inclusive)
minRangeLengththe minimal length of a resulting sequence region

◆ getAccConstraint()

const AccessibilityConstraint & IntaRNA::Accessibility::getAccConstraint ( ) const
inlinevirtual

Access to the globally enforced accessibility constraint. Here '.' denotes unconstrained positions and 'x' positions that have to be unstructured. Regions covering constrained positions will result in ED_UPPER_BOUND accessibility values.

Returns
the global accessibility constraint applied

Reimplemented in IntaRNA::ReverseAccessibility.

◆ getED()

virtual E_type IntaRNA::Accessibility::getED ( const size_t  from,
const size_t  to 
) const
pure virtual

Returns the accessibility energy value for the given range in the sequence, i.e. the energy difference (ED) to make the region accessible.

Parameters
fromthe start index of the regions (from <= to)
tothe end index of the regions (to < seq.length)
Returns
the ED value if (j-1+1) <= maxLength or ED_UPPER_BOUND otherwise
Exceptions
std::runtime_errorin case it does not hold 0 <= from <= to < seq.length

Implemented in IntaRNA::AccessibilityBasePair, IntaRNA::AccessibilityDisabled, IntaRNA::AccessibilityFromStream, IntaRNA::AccessibilityVrna, and IntaRNA::ReverseAccessibility.

◆ getMaxLength()

size_t IntaRNA::Accessibility::getMaxLength ( ) const
inlinevirtual

Access to the maximal length of accessible regions (>0) to be considered.

Returns
the maximal length of accessible regions considered

Reimplemented in IntaRNA::AccessibilityFromStream.

◆ getSequence()

const RnaSequence & IntaRNA::Accessibility::getSequence ( ) const
inlinevirtual

Access to the RnaSequence this accessibility values are accounting for.

Returns
the underlying sequence for this accessibility object.

Reimplemented in IntaRNA::ReverseAccessibility.

◆ writeBinary() [1/2]

virtual void IntaRNA::Accessibility::writeBinary ( std::ostream &  out) const
virtual

Write a native Boost binary archive of exact ED values, including the extra interval length needed for dangling ends. Works for every subclass. Compression is supplied by the stream (e.g. newOutputStream("file.agz")).

Parameters
outbinary output stream
Exceptions
std::exceptionon invalid ED values or output failure

Reimplemented in IntaRNA::AccessibilityFromStream, and IntaRNA::AccessibilityVrna.

◆ writeBinary() [2/2]

void IntaRNA::Accessibility::writeBinary ( std::ostream &  out,
const UpperBandedMatrix< E_type > *  matrix 
) const
protected

Write an archive using stored ED rows when available. Non-empty constraints use getED() to preserve any masking applied by the subclass.

Parameters
outbinary output stream
matrixnon-owning matrix with the same unconstrained ED values as getED(), or nullptr to gather values through getED(); used only during this call

◆ writeRNAplfold_ED_text()

void IntaRNA::Accessibility::writeRNAplfold_ED_text ( std::ostream &  out) const
inline

Writes the ED values in RNAplfold style to stream.

Parameters
outthe output stream to write to

◆ writeRNAplfold_Pu_text()

void IntaRNA::Accessibility::writeRNAplfold_Pu_text ( std::ostream &  out,
const Z_type  RT 
) const
inline

Writes the ED values as unpaired probabilities in RNAplfold style to stream.

Parameters
outthe output stream to write to
RTthe scaled temperature value to be used for conversion of ED to Pu : Pu = exp( -ED/RT )

◆ writeRNAplfold_text()

void IntaRNA::Accessibility::writeRNAplfold_text ( std::ostream &  out,
const Z_type  RT,
const bool  writeProbs 
) const
protected

Writes the ED values as unpaired probabilities in RNAplfold style to stream.

Parameters
outthe output stream to write to
RTthe scaled temperature value to be used for conversion of ED to Pu : Pu = exp( -ED/RT )
writeProbs(true) write unpaired probabilities; (false) write ED

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const Accessibility &  acc 
)
friend

Prints the accessibility values to stream as upper triangular matrix

Parameters
outthe ostream to write to
accthe Accessibility object to add
Returns
the altered stream out

Member Data Documentation

◆ accConstraint

AccessibilityConstraint IntaRNA::Accessibility::accConstraint
protected

accessibility constraint

◆ ED_UPPER_BOUND

const E_type IntaRNA::Accessibility::ED_UPPER_BOUND
static

upper bound for all ED return values

◆ maxLength

const size_t IntaRNA::Accessibility::maxLength
protected

the maximal length of an unpaired regions to be considered

◆ seq

const RnaSequence& IntaRNA::Accessibility::seq
protected

the RNA sequence the accessibilities correspond to


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