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

#include <AccessibilityFromStream.h>

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

Public Types

enum  InStreamType { Pu_RNAplfold_Text , ED_RNAplfold_Text , IntaRNA_Binary }
 

Public Member Functions

 AccessibilityFromStream (const RnaSequence &sequence, const size_t maxLength, const AccessibilityConstraint *const accConstraint, std::istream &inStream, const InStreamType inStreamType, const Z_type RT)
 
virtual ~AccessibilityFromStream ()
 
virtual E_type getED (const size_t from, const size_t to) const
 
virtual size_t getMaxLength () const
 
void writeBinary (std::ostream &out) const override
 
- Public Member Functions inherited from IntaRNA::Accessibility
 Accessibility (const RnaSequence &sequence, const size_t maxLength, const AccessibilityConstraint *const accConstr)
 
virtual ~Accessibility ()
 
virtual const RnaSequence & getSequence () 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
 
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
 

Protected Types

typedef UpperBandedMatrix< E_type > EdMatrix
 type for the ED value matrix (upper triangular matrix banded by maxLength)
 

Protected Member Functions

void parseBinary (std::istream &inStream)
 
void parsePu_RNAplfold_text (std::istream &inStream, const Z_type RT)
 
void parseED_RNAplfold_text (std::istream &inStream)
 
void parseRNAplfold_text (std::istream &inStream, const Z_type RT, const bool parseProbs)
 
- Protected Member Functions inherited from IntaRNA::Accessibility
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

EdMatrix edValues
 the ED values for the given sequence
 
size_t availMaxLength
 maximal available window size
 
- Protected Attributes inherited from IntaRNA::Accessibility
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
 

Additional Inherited Members

- Static Public Attributes inherited from IntaRNA::Accessibility
static const E_type ED_UPPER_BOUND
 upper bound for all ED return values
 

Detailed Description

Reads accessibility information from a data stream, e.g. from file or STDIN

Member Typedef Documentation

◆ EdMatrix

type for the ED value matrix (upper triangular matrix banded by maxLength)

Member Enumeration Documentation

◆ InStreamType

Enumerator
Pu_RNAplfold_Text 

Pu values in RNAplfold text format.

ED_RNAplfold_Text 

ED values in RNAplfold text Pu format.

IntaRNA_Binary 

native Boost binary ED archive, already decompressed

Constructor & Destructor Documentation

◆ AccessibilityFromStream()

IntaRNA::AccessibilityFromStream::AccessibilityFromStream ( const RnaSequence &  sequence,
const size_t  maxLength,
const AccessibilityConstraint *const  accConstraint,
std::istream &  inStream,
const InStreamType  inStreamType,
const Z_type  RT 
)

construction

Parameters
sequencethe sequence the accessibility data is about
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).
accConstraintif not NULL, accessibility constraint that enforces some regions to be unstructured both in sequence and interaction
inStreamthe input stream to read the accessibility data from
inStreamTypeinStream data type to be expected
RTthe RT constant to be used to transform the probabilities to ED values

◆ ~AccessibilityFromStream()

virtual IntaRNA::AccessibilityFromStream::~AccessibilityFromStream ( )
virtual

destruction

Member Function Documentation

◆ getED()

E_type IntaRNA::AccessibilityFromStream::getED ( const size_t  from,
const size_t  to 
) const
inlinevirtual

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

Implements IntaRNA::Accessibility.

◆ getMaxLength()

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

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

Here, it returns the minimum of the originally targeted interaction range and the from the data parsed maximal window size.

Returns
the maximal length of accessible regions considered

Reimplemented from IntaRNA::Accessibility.

◆ parseBinary()

void IntaRNA::AccessibilityFromStream::parseBinary ( std::istream &  inStream)
protected

Load and validate a decompressed IntaRNA binary accessibility archive.

◆ parseED_RNAplfold_text()

void IntaRNA::AccessibilityFromStream::parseED_RNAplfold_text ( std::istream &  inStream)
inlineprotected

Parses ED values from a VRNA unpaired probability file styled stream

Parameters
inStreamthe stream to read the ED values from

◆ parsePu_RNAplfold_text()

void IntaRNA::AccessibilityFromStream::parsePu_RNAplfold_text ( std::istream &  inStream,
const Z_type  RT 
)
inlineprotected

Parses a VRNA unpaired probability file and fills the ED data

Parameters
inStreamthe stream to read the probabilities from
RTthe RT constant to be used to transform the probabilities to ED values

◆ parseRNAplfold_text()

void IntaRNA::AccessibilityFromStream::parseRNAplfold_text ( std::istream &  inStream,
const Z_type  RT,
const bool  parseProbs 
)
protected

Parses ED values from a VRNA unpaired probability file styled stream

Parameters
inStreamthe stream to read the ED values from
RTthe RT constant to be used to transform the probabilities to ED values
parseProbswhether or not to expect unpaired probabilities (true) or ED values within the file

◆ writeBinary()

void IntaRNA::AccessibilityFromStream::writeBinary ( std::ostream &  out) const
inlineoverridevirtual

Write the stored ED matrix directly, without copying rows or calling getED() for unconstrained data. Constraints retain the generic getED() path. Subclasses changing getED() semantics must also override this method.

Parameters
outbinary output stream; compression is supplied by the stream

Reimplemented from IntaRNA::Accessibility.

Member Data Documentation

◆ availMaxLength

size_t IntaRNA::AccessibilityFromStream::availMaxLength
protected

maximal available window size

◆ edValues

EdMatrix IntaRNA::AccessibilityFromStream::edValues
protected

the ED values for the given sequence


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