Represents ribosum similarity matrices. More...
#include <ribosum.hh>
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_t & | get_basematch_scores () const |
Get base match scores. | |
const matrix_t & | get_arcmatch_scores () const |
const alphabet_type & | string_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. | |
double | arcmatch_score (char i, char j, char k, char l) const |
Get arc match score. | |
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 | |
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) |
Represents ribosum similarity matrices.
Reads ribosum data from file and provides access.
LocARNA::Ribosum::Ribosum | ( | const std::string & | filename | ) | [explicit] |
Construct from file
filename | name of the input file |
const Alphabet<char>& LocARNA::Ribosum::alphabet | ( | ) | const [inline] |
Get the basename alphabet as alphabet over characters
double LocARNA::Ribosum::arcmatch_score | ( | char | i, |
char | j, | ||
char | k, | ||
char | l | ||
) | const [inline] |
Get arc match score.
i | left character of first arc |
j | right character of first arc |
k | left character of second arc |
l | right character of second arc |
double LocARNA::Ribosum::basematch_score | ( | char | i, |
char | j | ||
) | const [inline] |
Get base match score.
i | character of first nucleotide |
j | character of second nucleotide |
const matrix_t& LocARNA::Ribosum::get_arcmatch_scores | ( | ) | const [inline] |
Get arc match scores
const matrix_t& LocARNA::Ribosum::get_basematch_scores | ( | ) | const [inline] |
Get base match scores.
const std::string& LocARNA::Ribosum::get_name | ( | ) | const [inline] |
Get 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
in | input stream | |
[out] | mat | matrix to be read |
names | alphabet names provided as Alphabet (of strings) |
void LocARNA::Ribosum::read_ribosum | ( | std::istream & | in | ) | [protected] |
reads the standard ribosum file format
in | input stream |
void LocARNA::Ribosum::set_arcname_alphabet | ( | const std::string | a[] | ) | [inline, protected] |
Set alphabet of base names
a | array of strings of the arc names |
void LocARNA::Ribosum::set_basename_alphabet | ( | const std::string | a[] | ) | [inline, protected] |
Set alphabet of base names
a | array of strings of the base names |
const alphabet_type& LocARNA::Ribosum::string_alphabet | ( | ) | const [inline] |
Get the basename alphabet as alphabet over 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
out | output stream |
mat | matrix to be written |
alph | alphabet names provided as Alphabet (of strings) |
std::ostream& operator<< | ( | std::ostream & | out, |
const Ribosum & | ribosum | ||
) | [friend] |
Output operator
out | output stream |
ribosum | Ribosum to be written to stream |
matrix_t LocARNA::Ribosum::am [protected] |
16x16 matrix
scores for basepair/arc matches,