represent sparsified data of RNA ensemble More...
#include <rna_data.hh>
Public Types | |
typedef SparseMatrix< double > | arc_prob_matrix_t |
arc probability matrix | |
typedef size_t | size_type |
usual size type | |
Public Member Functions | |
RnaData (const RnaEnsemble &rna_ensemble, double p_bpcut, double max_bps_length_ratio, const PFoldParams &pfoldparams) | |
Construct from RnaEnsemble with cutoff probability. | |
RnaData (const std::string &filename, double p_bpcut, double max_bps_length_ratio, const PFoldParams &pfoldparams) | |
Construct from file. | |
RnaData (const RnaData &rna_dataA, const RnaData &rna_dataB, const Alignment &alignment, double p_expA, double p_expB, bool only_local=false) | |
Construct as consensus of two aligned RNAs. | |
virtual | ~RnaData () |
destructor | |
const Sequence & | sequence () const |
Get the multiple alignment as sequence. | |
const MultipleAlignment & | multiple_alignment () const |
Get the multiple alignment. | |
size_type | length () const |
Get the sequence length. | |
double | arc_cutoff_prob () const |
Get base pair cutoff probability. | |
double | arc_prob (pos_type i, pos_type j) const |
Get arc probability. | |
std::string | mea_structure (double gamma=1.) const |
maximum expected accuracy structure | |
vrna_plist_t * | plist () const |
Construct plist (pair list of Vienna RNA) | |
double | joint_arc_prob (pos_type i, pos_type j) const |
Get arc probability. | |
double | stacked_arc_prob (pos_type i, pos_type j) const |
Get arc probability. | |
double | prob_paired_upstream (pos_type i) const |
Probability that a position is paired upstream. | |
double | prob_paired_downstream (pos_type i) const |
Probability that a position is paired downstream. | |
double | prob_unpaired (pos_type i) const |
Unpaired probability. | |
std::ostream & | write_pp (std::ostream &out, double p_outbpcut=0) const |
std::ostream & | write_size_info (std::ostream &out) const |
Write object size information. | |
bool | has_stacking () const |
Availability of stacking terms. | |
void | set_anchors (const SequenceAnnotation &anchors) |
Write access to alignment anchors. | |
Protected Types | |
typedef arc_prob_matrix_t::const_iterator | arc_probs_const_iterator |
type of constant iterator over arcs with probability above cutoff | |
Protected Member Functions | |
RnaData (double p_bpcut, size_t max_bp_span) | |
Almost empty constructor. | |
arc_probs_const_iterator | arc_probs_begin () const |
begin of arcs with probability above cutoff Supports iteration over arcs | |
arc_probs_const_iterator | arc_probs_end () const |
begin of arcs with probability above cutoff Supports iteration over arcs | |
virtual void | init_from_fixed_structure (const RnaStructure &structure, const PFoldParams &pfoldparams) |
initialize from fixed structure | |
virtual void | init_from_rna_ensemble (const RnaEnsemble &rna_ensemble, const PFoldParams &pfoldparams) |
initialize from rna ensemble | |
bool | read_autodetect (const std::string &filename, const PFoldParams &pfoldparams) |
read and initialize from file, autodetect format | |
virtual bool | inloopprobs_ok () const |
check in loop probabilities | |
virtual void | read_pp (const std::string &filename) |
virtual std::istream & | read_pp (std::istream &in) |
void | read_old_pp (const std::string &filename) |
void | read_ps (const std::string &filename) |
Protected Attributes | |
RnaDataImpl * | pimpl_ |
Friends | |
class | RnaDataImpl |
class | ExtRnaDataImpl |
represent sparsified data of RNA ensemble
knows sequence, cutoff probability and base pair probabilities greater than the cutoff probability; potentially knows stacking probabilities
LocARNA::RnaData::RnaData | ( | const RnaEnsemble & | rna_ensemble, |
double | p_bpcut, | ||
double | max_bps_length_ratio, | ||
const PFoldParams & | pfoldparams | ||
) |
Construct from RnaEnsemble with cutoff probability.
rna_ensemble | RNA ensemble data |
p_bpcut | cutoff probability |
max_bps_length_ratio | max ratio of bps to length (0=no effect) |
pfoldparams | folding parameters (controls stacking) |
LocARNA::RnaData::RnaData | ( | const std::string & | filename, |
double | p_bpcut, | ||
double | max_bps_length_ratio, | ||
const PFoldParams & | pfoldparams | ||
) |
Construct from file.
filename | input file name |
p_bpcut | cutoff probability |
pfoldparams | folding parameters |
max_bps_length_ratio | maximal ratio of number of base pairs divided by sequence length. This serves as a second filter on the "significant" base pairs. Value 0 turns this filter off. |
LocARNA::RnaData::RnaData | ( | const RnaData & | rna_dataA, |
const RnaData & | rna_dataB, | ||
const Alignment & | alignment, | ||
double | p_expA, | ||
double | p_expB, | ||
bool | only_local = false |
||
) |
Construct as consensus of two aligned RNAs.
rna_dataA | RNA ensemble data A |
rna_dataB | RNA ensemble data B |
alignment | Alignment of A and B |
p_expA | background probability for A |
p_expB | background probability for B |
only_local | if true, construct only local alignment |
The object uses mean cutoff probability of the given objects; The background probability is used in computing consensus probabilities. If both input rna data objects have stacking probabilities, stacking consensus probabilities are computed as well. If the object contain sequence anchors, we construct the new object with a consensus anchor string. (The latter is done as part of the consensus sequence computation.)
LocARNA::RnaData::RnaData | ( | double | p_bpcut, |
size_t | max_bp_span | ||
) | [explicit, protected] |
Almost empty constructor.
p_bpcut | cutoff probability |
max_bp_span | maximum base pair span |
double LocARNA::RnaData::arc_cutoff_prob | ( | ) | const |
Get base pair cutoff probability.
double LocARNA::RnaData::arc_prob | ( | pos_type | i, |
pos_type | j | ||
) | const |
Get arc probability.
i | left sequence position |
j | right sequence position |
RnaData::arc_probs_const_iterator LocARNA::RnaData::arc_probs_begin | ( | ) | const [protected] |
begin of arcs with probability above cutoff Supports iteration over arcs
RnaData::arc_probs_const_iterator LocARNA::RnaData::arc_probs_end | ( | ) | const [protected] |
begin of arcs with probability above cutoff Supports iteration over arcs
bool LocARNA::RnaData::has_stacking | ( | ) | const |
Availability of stacking terms.
void LocARNA::RnaData::init_from_fixed_structure | ( | const RnaStructure & | structure, |
const PFoldParams & | pfoldparams | ||
) | [protected, virtual] |
initialize from fixed structure
structure | fixed structure |
pfoldparams | folding parameters
|
Reimplemented in LocARNA::ExtRnaData.
void LocARNA::RnaData::init_from_rna_ensemble | ( | const RnaEnsemble & | rna_ensemble, |
const PFoldParams & | pfoldparams | ||
) | [protected, virtual] |
initialize from rna ensemble
rna_ensemble | rna ensemble |
pfoldparams | folding parameters
|
Reimplemented in LocARNA::ExtRnaData.
virtual bool LocARNA::RnaData::inloopprobs_ok | ( | ) | const [inline, protected, virtual] |
check in loop probabilities
Reimplemented in LocARNA::ExtRnaData.
double LocARNA::RnaData::joint_arc_prob | ( | pos_type | i, |
pos_type | j | ||
) | const |
Get arc probability.
i | left sequence position |
j | right sequence position |
size_type LocARNA::RnaData::length | ( | ) | const |
Get the sequence length.
std::string LocARNA::RnaData::mea_structure | ( | double | gamma = 1. | ) | const |
maximum expected accuracy structure
gamma |
Works as interface to the RNAlib function MEA. From the ViennaRNA docu: Each base pair (i,j) gets a score 2*gamma*p_ij and the score of an unpaired base is given by the probability of not forming a pair (compare RNAfold)
const MultipleAlignment & LocARNA::RnaData::multiple_alignment | ( | ) | const |
Get the multiple alignment.
vrna_plist_t * LocARNA::RnaData::plist | ( | ) | const |
Construct plist (pair list of Vienna RNA)
double LocARNA::RnaData::prob_paired_downstream | ( | pos_type | i | ) | const |
Probability that a position is paired downstream.
i | sequence position |
double LocARNA::RnaData::prob_paired_upstream | ( | pos_type | i | ) | const |
Probability that a position is paired upstream.
i | sequence position |
double LocARNA::RnaData::prob_unpaired | ( | pos_type | i | ) | const |
Unpaired probability.
i | sequence position |
bool LocARNA::RnaData::read_autodetect | ( | const std::string & | filename, |
const PFoldParams & | pfoldparams | ||
) | [protected] |
read and initialize from file, autodetect format
filename | name of input file |
pfoldparams | folding parameters
|
void LocARNA::RnaData::read_old_pp | ( | const std::string & | filename | ) | [protected] |
Read data in the old pp format
filename | name of input file |
Reads only base pairs with probabilities greater than p_bpcut_; reads stacking probabilities only if has_stacking_ is true
void LocARNA::RnaData::read_pp | ( | const std::string & | filename | ) | [protected, virtual] |
Read data in pp format 2.0
filename | name of input file |
Reads only base pairs with probabilities greater than p_bpcut_; reads stacking probabilities only if has_stacking_ is true
std::istream & LocARNA::RnaData::read_pp | ( | std::istream & | in | ) | [protected, virtual] |
Read data in pp format 2.0
in | input stream |
Reimplemented in LocARNA::ExtRnaData.
void LocARNA::RnaData::read_ps | ( | const std::string & | filename | ) | [protected] |
Read data in Vienna's dot plot ps format
filename | name of input file |
Reads only base pairs with probabilities greater than p_bpcut_; reads stacking probabilities only if has_stacking_ is true
sequence characters should be upper case, and Ts translated to Us
const Sequence & LocARNA::RnaData::sequence | ( | ) | const |
Get the multiple alignment as sequence.
void LocARNA::RnaData::set_anchors | ( | const SequenceAnnotation & | anchors | ) |
Write access to alignment anchors.
anchors | alignment anchors |
double LocARNA::RnaData::stacked_arc_prob | ( | pos_type | i, |
pos_type | j | ||
) | const |
Get arc probability.
i | left sequence position |
j | right sequence position |
std::ostream & LocARNA::RnaData::write_pp | ( | std::ostream & | out, |
double | p_outbpcut = 0 |
||
) | const |
Write data in pp format
out | output stream |
p_outbpcut | cutoff probability |
Writes only base pairs with probabilities greater than p_outbpcut
std::ostream & LocARNA::RnaData::write_size_info | ( | std::ostream & | out | ) | const |
Write object size information.
out | output stream |
Writes numbers of stored probabilities to stream
Reimplemented in LocARNA::ExtRnaData.
RnaDataImpl* LocARNA::RnaData::pimpl_ [protected] |