LocARNA-1.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Protected Attributes | Friends
LocARNA::RibosumFreq Class Reference

Represents ribosum similarity matrices including raw frequencies. More...

#include <ribosum.hh>

Inheritance diagram for LocARNA::RibosumFreq:
LocARNA::Ribosum

List of all members.

Public Member Functions

 RibosumFreq (const std::string &filename)
double base_prob (char i) const
double base_nonstruct_prob (char i) const
const matrix_tget_base_probs () const
const matrix_tget_base_nonstruct_probs () const
double basepair_prob (char i, char j) const
const matrix_tget_basepair_probs () const
double basematch_prob (char i, char j) const
const matrix_tget_basematch_probs () const
double arcmatch_prob (char i, char j, char k, char l) const
const matrix_tget_arcmatch_probs () const
double base_unpaired_prob (char i) const
 probability that a nucleotide/base occurs unpaired
double basematch_score_corrected (char i, char j) const
 Get corrected score for a base match.
void print_basematch_scores_corrected (std::ostream &out) const
 Print the corrected score of base matches.
void read_matrix (std::istream &in, const std::string &header, matrix_t &mat, size_t xdim, size_t ydim)
void write_ICC_code (std::ostream &out, const std::string &ribname) const
std::ostream & write_matrix (std::ostream &out, const std::string &name, const Matrix< double > &mat) const

Protected Attributes

matrix_t base_probs_
 matrix of base probabilities
matrix_t base_nonstruct_probs_
matrix_t basepair_probs_
 matrix of base pair probabilities
matrix_t basematch_probs_
 matrix of base match probabilties
matrix_t arcmatch_probs_
 matrix of arc match probabilities

Friends

std::ostream & operator<< (std::ostream &out, const RibosumFreq &ribosum)

Detailed Description

Represents ribosum similarity matrices including raw frequencies.

Extension of the ribosum class that maintains additional "raw" information in particular frequencies of bases, basematches, basepairs, and arcmatches


Constructor & Destructor Documentation

LocARNA::RibosumFreq::RibosumFreq ( const std::string &  filename) [explicit]

Construct from file

Parameters:
filenameName of input file
Note:
The file has to be in an extended ribosum file format including frequencies.

Member Function Documentation

double LocARNA::RibosumFreq::arcmatch_prob ( char  i,
char  j,
char  k,
char  l 
) const [inline]

Get the probability of an arcmatch

Parameters:
ileft nucleotide character of first base pair
jright nucleotide character of first base pair
kleft nucleotide character of second base pair
lright nucleotide character of second base pair
Returns:
probability of matching a
probability for matching an arc of nucleotides i and j with an arc of nucleotides k and l.
double LocARNA::RibosumFreq::base_nonstruct_prob ( char  i) const [inline]

Get probability of a base occuring in a non-structural match

Parameters:
inucleotide character
Returns:
probability of nucleotide character in non-structural matches
double LocARNA::RibosumFreq::base_prob ( char  i) const [inline]

Get probability of a base

Parameters:
inucleotide character
Returns:
probability of nucleotide character
double LocARNA::RibosumFreq::base_unpaired_prob ( char  i) const

probability that a nucleotide/base occurs unpaired

Parameters:
inucleotide character
Returns:
probability that nucleotide is unpaired
double LocARNA::RibosumFreq::basematch_prob ( char  i,
char  j 
) const [inline]

Get the probability of a base match

Parameters:
ileft nucleotide character
jright nucleotide character
Returns:
probability of match of nucleotides i and j
double LocARNA::RibosumFreq::basematch_score_corrected ( char  i,
char  j 
) const

Get corrected score for a base match.

Parameters:
ifirst nucleotide character
jsecond nucleotide character
Returns:
corrected score that i and j are matched
Note:
the score is computed as log odd of frequencies for seeing i and j matched without incident structure divided by the background to see i and j without incident structure.
The arguments are characters of the alphabet/nucleotides.
Currently, not tabellized. Thus, we have some computational overhead.
double LocARNA::RibosumFreq::basepair_prob ( char  i,
char  j 
) const [inline]

Get probability of a basepair

Parameters:
ileft nucleotide character
jright nucleotide character
Returns:
probability of base pair of nucleotides i and j

Get arcmatch prob matrix @ return matrix of arc match probabilities

Get base nonstruct prob matrix

Returns:
matrix of probabilities of all bases/nucleotides in nonstructural matches

Get base prob matrix

Returns:
matrix of probabilities of all bases/nucleotides

Get basematch prob matrix

Returns:
matrix of probabilities of base matches

Get base pair prob matrix

Returns:
matrix of probabilities of base pairs
void LocARNA::RibosumFreq::print_basematch_scores_corrected ( std::ostream &  out) const

Print the corrected score of base matches.

See also:
basematch_score_corrected()
void LocARNA::RibosumFreq::read_matrix ( std::istream &  in,
const std::string &  header,
matrix_t mat,
size_t  xdim,
size_t  ydim 
)

Read one matrix in ribosum input

Parameters:
ininput stream
headerheader string
[out]matmatrix object to be read into
xdimfirst dimension of matrix
ydimsecond dimension of matrix
void LocARNA::RibosumFreq::write_ICC_code ( std::ostream &  out,
const std::string &  ribname 
) const

Write the ribosum matrices as C++ code

Parameters:
outoutput stream
ribnameName of ribosum
Note:
this is used to precompile ribosum matrices, such that their parameters can be linked to the code and we do not have to depend on data files.
See also:
write_HH_code()
std::ostream & LocARNA::RibosumFreq::write_matrix ( std::ostream &  out,
const std::string &  name,
const Matrix< double > &  mat 
) const

Write single matrix to output stream

Parameters:
outoutput stream
namename of matrix
matmatrix
Returns:
output stream after writing

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const RibosumFreq ribosum 
) [friend]

Output operator

Parameters:
outoutput stream
ribosumRibosum to be written to stream
Returns:
output stream after writing

Member Data Documentation

matrix of base probabilities in non-structural context


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends