Implementation of RnaData.
More...
#include <rna_data_impl.hh>
|
| RnaDataImpl (RnaData *self, const RnaData &rna_dataA, const RnaData &rna_dataB, const Alignment::edges_t &alignment, double p_expA, double p_expB) |
| Construct as consensus of two aligned RNAs. More...
|
|
| RnaDataImpl (RnaData *self, double p_bpcut, size_t max_bp_span) |
| Almost empty constructor. More...
|
|
void | init_from_fixed_structure (const RnaStructure &structure, const PFoldParams &pfoldparams) |
| initialize from fixed structure More...
|
|
void | init_from_rna_ensemble (const RnaEnsemble &rna_ensemble, const PFoldParams &pfoldparams) |
| initialize from rna ensemble More...
|
|
std::istream & | read_pp_sequence (std::istream &in) |
| read sequence section of pp-format More...
|
|
std::istream & | read_pp_arc_probabilities (std::istream &in) |
| read section of base pair probabilities of pp-format More...
|
|
std::ostream & | write_pp_sequence (std::ostream &out) const |
| write section of base pair probabilities of pp-format More...
|
|
std::ostream & | write_pp_arc_probabilities (std::ostream &out, double p_outbpcut, bool stacking) const |
| write section of base pair probabilities of pp-format More...
|
|
void | init_as_consensus_dot_plot (const Alignment::edges_t &edges, const RnaData &rna_dataA, const RnaData &rna_dataB, double p_expA, double p_expB, double f_penalty, bool stacking) |
| Initialize as consensus of two aligned RNAs. More...
|
|
double | consensus_probability (double pA, double pB, size_t sizeA, size_t sizeB, double p_expA, double p_expB, double p_penalty) const |
| Consensus probability. More...
|
|
void | drop_worst_bps (size_t keep) |
| Drop base pairs with lowest probability. More...
|
|
Implementation of RnaData.
◆ RnaDataImpl() [1/2]
Construct as consensus of two aligned RNAs.
- Parameters
-
self | pointer to corresponding RnaData object |
rna_dataA | data of RNA A |
rna_dataB | data of RNA B |
alignment | pairwise alignment of A and B |
p_expA | background probability A |
p_expB | background probability B |
<
◆ RnaDataImpl() [2/2]
LocARNA::RnaDataImpl::RnaDataImpl |
( |
RnaData * |
self, |
|
|
double |
p_bpcut, |
|
|
size_t |
max_bp_span |
|
) |
| |
Almost empty constructor.
- Parameters
-
self | pointer to corresponding RnaData object |
p_bpcut | cutoff probability |
◆ consensus_probability()
double LocARNA::RnaDataImpl::consensus_probability |
( |
double |
pA, |
|
|
double |
pB, |
|
|
size_t |
sizeA, |
|
|
size_t |
sizeB, |
|
|
double |
p_expA, |
|
|
double |
p_expB, |
|
|
double |
p_penalty |
|
) |
| const |
Consensus probability.
- Parameters
-
pA | probability A |
pB | probability B |
sizeA | number of rows in sequence A |
sizeB | number of rows in sequence B |
p_expA | background probability A |
p_expB | background probability B |
p_penalty | penalty probability for base pairs with probability below cutoff |
- Note
- Essentially the consensus base pair probabilities are geometric means of the combined single base pair probabilties. This is maintained by weighting the pairwise consensus computations with the respective numbers of sequences.
The penalty probability p_penalty has to be chosen carefully: Assuming 0 probability for base pairs below of the threshold geometric mean would result in 0 as consensus probability; thus we assume p_penalty in this case, however too high p_penalty leads to the accumulation of many base pairs with small probabilities.
Reasonably, p_penalty must be a small fraction of p_cutoff_.
- Returns
- consensus probability
◆ drop_worst_bps()
void LocARNA::RnaDataImpl::drop_worst_bps |
( |
size_t |
keep | ) |
|
Drop base pairs with lowest probability.
- Parameters
-
keep | the maximum number of base pairs to keep |
◆ init_as_consensus_dot_plot()
void LocARNA::RnaDataImpl::init_as_consensus_dot_plot |
( |
const Alignment::edges_t & |
edges, |
|
|
const RnaData & |
rna_dataA, |
|
|
const RnaData & |
rna_dataB, |
|
|
double |
p_expA, |
|
|
double |
p_expB, |
|
|
double |
f_penalty, |
|
|
bool |
stacking |
|
) |
| |
Initialize as consensus of two aligned RNAs.
- Parameters
-
edges | alignment edges |
rna_dataA | rna data A |
rna_dataB | rna data B |
p_expA | background probability A |
p_expB | background probability B |
f_penalty | factor for penalty probability: p_penalty = p_bpcut*f_penalty, |
- See also
- consensus_probability()
- Parameters
-
stacking | if true, stacking consensus is computed |
◆ init_from_fixed_structure()
void LocARNA::RnaDataImpl::init_from_fixed_structure |
( |
const RnaStructure & |
structure, |
|
|
const PFoldParams & |
pfoldparams |
|
) |
| |
initialize from fixed structure
- Parameters
-
structure | fixed structure |
pfoldparams | pfold parameters; only stacking is used |
- Note
- this strictly sets the probability of all base pairs in structure to 1.0. It does not care for constraints like noLP or maxBPspan; this has to be handled by the caller!
◆ init_from_rna_ensemble()
void LocARNA::RnaDataImpl::init_from_rna_ensemble |
( |
const RnaEnsemble & |
rna_ensemble, |
|
|
const PFoldParams & |
pfoldparams |
|
) |
| |
initialize from rna ensemble
- Parameters
-
rna_ensemble | rna ensemble |
pfoldparams | folding parameters. if stacking, initialize stacking terms; if noLP, drop lonely pairs |
◆ read_pp_arc_probabilities()
std::istream & LocARNA::RnaDataImpl::read_pp_arc_probabilities |
( |
std::istream & |
in | ) |
|
read section of base pair probabilities of pp-format
- Parameters
-
Reads only base pairs with probabilities greater than p_bpcut_; reads stacking only if has_stacking_
◆ read_pp_sequence()
std::istream & LocARNA::RnaDataImpl::read_pp_sequence |
( |
std::istream & |
in | ) |
|
read sequence section of pp-format
- Parameters
-
- Returns
- stream
this section comprises sequence/multiple alignment (possibly including sequence anchor annotation)
◆ write_pp_arc_probabilities()
std::ostream & LocARNA::RnaDataImpl::write_pp_arc_probabilities |
( |
std::ostream & |
out, |
|
|
double |
p_outbpcut, |
|
|
bool |
stacking |
|
) |
| const |
write section of base pair probabilities of pp-format
Write arc probabilities.
- Parameters
-
out | ouput stream |
p_outbpcut | cutoff probabilitiy |
stacking | whether to write stacking probabilities; if stacking but !has_stacking_, no stacking terms are written but flag STACKS is written to output |
- Returns
- stream
Write only base pairs with probabilities greater than p_outbpcut
Writes arc and stacking probabilities to stream; filters by probability threshold p_outbpcut
◆ write_pp_sequence()
std::ostream & LocARNA::RnaDataImpl::write_pp_sequence |
( |
std::ostream & |
out | ) |
const |
write section of base pair probabilities of pp-format
- Parameters
-
- Returns
- stream
◆ arc_2_probs_
sparse array for all probabilities that a pair (i,j) and its immediately inner pair (i+1,j-1) are formed simultaneously above threshold; analogous to arc_probs_
- Note
- arc_2_probs_ has entry (i,j) implies arc_probs_ has entry (i,j)
◆ arc_probs_
sparse array for all arc probabilities above threshold; the array is used when reading in the probabilities and for merging probs during pp-output
◆ self_
RnaData* LocARNA::RnaDataImpl::self_ |
- pointer to corresponding non-impl object
The documentation for this class was generated from the following files: