LocARNA-1.8.11
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
LocARNA::Ribosum Class Reference

Represents ribosum similarity matrices. More...

#include <ribosum.hh>

Inheritance diagram for LocARNA::Ribosum:
Inheritance graph
[legend]
Collaboration diagram for LocARNA::Ribosum:
Collaboration graph
[legend]

Public Types

typedef Matrix< double > matrix_t
 type of a matrix
 

Public Member Functions

 Ribosum (const std::string &filename)
 
virtual ~Ribosum ()
 virtual destructor
 
const matrix_tget_basematch_scores () const
 Get base match scores. More...
 
const matrix_tget_arcmatch_scores () const
 
const alphabet_typestring_alphabet () const
 
const Alphabet< char > & alphabet () const
 
const std::string & get_name () const
 
double basematch_score (char i, char j) const
 Get base match score. More...
 
double arcmatch_score (char i, char j, char k, char l) const
 Get arc match score. More...
 

Protected Types

typedef Alphabet< std::string > alphabet_type
 type of alphabet
 

Protected Member Functions

std::istream & read_matrix (std::istream &in, matrix_t &mat, const alphabet_type &names) const
 
std::ostream & write_matrix (std::ostream &out, const matrix_t &mat, const alphabet_type &alph) const
 
 Ribosum ()
 Construct empty.
 
void read_ribosum (std::istream &in)
 
Alphabet< char > make_char_alphabet () const
 transform the basename alphabet to alphabet over characters
 
void set_basename_alphabet (const std::string a[])
 
void set_arcname_alphabet (const std::string a[])
 

Protected Attributes

std::string name
 name of ribosum
 
matrix_t bm
 scores for base matches, 4x4 matrix
 
matrix_t am
 16x16 matrix More...
 
alphabet_type basename_alphabet
 alphabet of base names
 
alphabet_type arcname_alphabet
 alphabet of arc names
 
Alphabet< char > char_basename_alphabet
 alphabet of base names as characters
 

Friends

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

Detailed Description

Represents ribosum similarity matrices.

Reads ribosum data from file and provides access.

Constructor & Destructor Documentation

LocARNA::Ribosum::Ribosum ( const std::string &  filename)
explicit

Construct from file

Parameters
filenamename of the input file

Member Function Documentation

const Alphabet<char>& LocARNA::Ribosum::alphabet ( ) const
inline

Get the basename alphabet as alphabet over characters

Returns
basename alphabet
double LocARNA::Ribosum::arcmatch_score ( char  i,
char  j,
char  k,
char  l 
) const
inline

Get arc match score.

Parameters
ileft character of first arc
jright character of first arc
kleft character of second arc
lright character of second arc
Returns
ribosum score for matching an arc of nucleotides i and j with an arc of nucleotides k and l.
double LocARNA::Ribosum::basematch_score ( char  i,
char  j 
) const
inline

Get base match score.

Parameters
icharacter of first nucleotide
jcharacter of second nucleotide
Returns
ribosum score for matching nucleotides i and j.
const matrix_t& LocARNA::Ribosum::get_arcmatch_scores ( ) const
inline

Get arc match scores

Returns
the matrix of arc match scores
const matrix_t& LocARNA::Ribosum::get_basematch_scores ( ) const
inline

Get base match scores.

Returns
the matrix of base match scores
const std::string& LocARNA::Ribosum::get_name ( ) const
inline

Get name of ribosum

Returns
name of ribosum
std::istream & LocARNA::Ribosum::read_matrix ( std::istream &  in,
matrix_t mat,
const alphabet_type names 
) const
protected

Read matrix from input stream

Parameters
ininput stream
[out]matmatrix to be read
namesalphabet names provided as Alphabet (of strings)
Returns
input stream after reading
void LocARNA::Ribosum::read_ribosum ( std::istream &  in)
protected

reads the standard ribosum file format

Parameters
ininput stream
void LocARNA::Ribosum::set_arcname_alphabet ( const std::string  a[])
inlineprotected

Set alphabet of base names

Parameters
aarray of strings of the arc names
Postcondition
arcname_alphabet is initialized
void LocARNA::Ribosum::set_basename_alphabet ( const std::string  a[])
inlineprotected

Set alphabet of base names

Parameters
aarray of strings of the base names
Postcondition
basename_alphabet and char_basename_alphabet are initialized
const alphabet_type& LocARNA::Ribosum::string_alphabet ( ) const
inline

Get the basename alphabet as alphabet over strings

Returns
alphabet of strings
std::ostream & LocARNA::Ribosum::write_matrix ( std::ostream &  out,
const matrix_t mat,
const alphabet_type alph 
) const
protected

Write matrix to output stream

Parameters
outoutput stream
matmatrix to be written
alphalphabet names provided as Alphabet (of strings)
Returns
output stream after writing

Friends And Related Function Documentation

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

Output operator

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

Member Data Documentation

matrix_t LocARNA::Ribosum::am
protected

16x16 matrix

scores for basepair/arc matches,


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