LocARNA-1.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
Classes | Public Types | Public Member Functions
LocARNA::MatchProbs Class Reference

Provides probabilities for each match. More...

#include <match_probs.hh>

List of all members.

Classes

class  ProbConsParameter
 Maintains parameter for computing match probabilities.

Public Types

typedef size_t size_type
 size

Public Member Functions

 MatchProbs ()
 construct as empty object
 MatchProbs (const std::string &filename)
 construct from file
void pairHMM_probs (const Sequence &seqA, const Sequence &seqB, const std::string &file)
void pf_probs (const RnaData &rnaA, const RnaData &rnaB, const Matrix< double > &sim_mat, const Alphabet< char > &alphabet, double gap_opening, double gap_extension, double pf_struct_weight, double temp, bool flag_local)
std::istream & read (std::istream &in)
void read (const std::string &filename)
 read the probabilities from a file
std::istream & read_sparse (std::istream &in, size_type lenA, size_type lenB)
void read_sparse (const std::string &filename, size_type lenA, size_type lenB)
std::ostream & write (std::ostream &out) const
void write (const std::string &filename) const
 write the probabilities to a file
std::ostream & write_sparse (std::ostream &out, double threshold) const
void write_sparse (const std::string &filename, double threshold) const
size_type get_lenA () const
 get the length of the first sequence
size_type get_lenB () const
 get the length of the second sequence
double prob (size_t i, size_t j) const
 return the match probability for the two bases

Detailed Description

Provides probabilities for each match.

The probabilities are either computed or read in from file

for computing probabilities, we offer two methods:

1) For computing the probabilities the class uses a pairHMM analogously to PROBCONS. Also, the class reads transition probabilities from a file in the format of Probcons, which allows to use their parameter files

2) similar to proba/probalign, use statistical-mechanics-like model. Assume alignments are Boltzman distributed, calc match probs via partition function

the second approach supports Stral-like scoring (using pf_struct_weight as "alpha")


Member Function Documentation

void LocARNA::MatchProbs::pairHMM_probs ( const Sequence seqA,
const Sequence seqB,
const std::string &  file 
)

read probcons parameter file and compute match probabilities for the two given sequences

Exceptions:
failure
void LocARNA::MatchProbs::pf_probs ( const RnaData rnaA,
const RnaData rnaB,
const Matrix< double > &  sim_mat,
const Alphabet< char > &  alphabet,
double  gap_opening,
double  gap_extension,
double  pf_struct_weight,
double  temp,
bool  flag_local 
)

calculate edge probabilities via statistical mechanics model (partition function) get match scores via matrix sim_mat. The method accepts the matrix sim_mat together with an alphabet. The alphabet object is necessary to translate sequence symbols to the indices in this matrix.

std::istream& LocARNA::MatchProbs::read ( std::istream &  in)

read the probabilities from a stream assumes matrix starting 0,0 whereas sequences start 1,1

std::istream & LocARNA::MatchProbs::read_sparse ( std::istream &  in,
size_type  lenA,
size_type  lenB 
)

read the probabilities from a stream read 'sparse' format "i j p"

void LocARNA::MatchProbs::read_sparse ( const std::string &  filename,
size_type  lenA,
size_type  lenB 
)

read the probabilities from a file read 'sparse' format "i j p"

std::ostream& LocARNA::MatchProbs::write ( std::ostream &  out) const

write the probabilities to a stream writes matrix starting 0,0 whereas sequences start 1,1

std::ostream & LocARNA::MatchProbs::write_sparse ( std::ostream &  out,
double  threshold 
) const

write the probabilities to a stream, only probs >= threshold use format "i j p"

void LocARNA::MatchProbs::write_sparse ( const std::string &  filename,
double  threshold 
) const

write the probabilities to a file, only probs >= threshold use format "i j p"


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