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

Represents the raw structure ensemble data for an RNA. More...

#include <rna_ensemble.hh>

List of all members.

Public Member Functions

 RnaEnsemble (const MultipleAlignment &ma, const PFoldParams &params, bool inLoopProbs, bool use_alifold=true)
 folding constructor (from sequence or multiple alignment)
 RnaEnsemble (const RnaEnsemble &rna_ensemble)
 copy constructor
RnaEnsembleoperator= (const RnaEnsemble &rna_ensemble)
 assignment operator
virtual ~RnaEnsemble ()
 Clean up.
bool has_base_pair_probs () const
 Availability of pair probabilities.
bool has_stacking_probs () const
 Availability of stacking probabilities.
bool has_in_loop_probs () const
 Availability of "in loop" probabilities.
const MultipleAlignmentmultiple_alignment () const
 Get the sequence.
size_type length () const
 get length of sequence
double min_free_energy () const
 get minimum free energy
std::string min_free_energy_structure () const
 get minimum free energy structure
double arc_prob (size_type i, size_type j) const
 Get arc probability.
double arc_2_prob (size_type i, size_type j) const
 Get joint probability of stacked arcs.
double arc_stack_prob (size_type i, size_type j) const
 Get conditional propability that a base pair is stacked.
double paired_upstream_prob (size_type i) const
 Probability that a position is paired upstream.
double paired_downstream_prob (size_type i) const
 Probability that a position is paired downstream.
double unpaired_prob (size_type i) const
 Unpaired probability.
double unpaired_in_loop_prob (size_type k, size_type i, size_type j) const
 Unpaired probabilty of base in a specified loop.
double unpaired_external_prob (size_type k) const
 Unpaired probabilty of base in external 'loop'.
double arc_in_loop_prob (size_type ip, size_type jp, size_type i, size_type j) const
 Probabilty of base pair in a specified loop.
double arc_external_prob (size_type i, size_type j) const
 Probability of base pair in the external 'loop'.

Detailed Description

Represents the raw structure ensemble data for an RNA.

Can partition fold RNAs, stores dynamic programming matrices of the McCaskill algorithm. Computes special "in loop" probabilities.

Interprets structure annotation of the multiple alignment as structure constraint string; if existant, the string has to be valid! Fixed structure annotation is ignored.

Todo:
support constraints for in loop probabilities
Todo:
split up RnaEnsemble into two classes; one with and one without in-loop probabilities (like RnaData and ExtRnaData)
Note:
the class guarantees that sequences are normalized (uppercase, T->U) even when read in unnormalized form, e.g. from file or stream or received from other objects

Constructor & Destructor Documentation

LocARNA::RnaEnsemble::RnaEnsemble ( const MultipleAlignment ma,
const PFoldParams params,
bool  inLoopProbs,
bool  use_alifold = true 
)

folding constructor (from sequence or multiple alignment)

Computes ensemble partition functions and probabilities using McCaskill's algorithm. Optionally computes additional matrices required for in-loop probabilities.

Parameters:
mathe RNA sequence or alignment as MultipleAlignment object
paramspfolding parameters
inLoopProbswhether in loop probabilities should be made available
use_alifoldwhether alifold should be used
Precondition:
unless use_alifold, sequence row number has to be 1

copy constructor

Parameters:
rna_ensembleobject to be copied Copies implementation object (not only pointer)

Clean up.

In most cases does nothing. If McCaskill matrices are kept, they are freed.


Member Function Documentation

double LocARNA::RnaEnsemble::arc_2_prob ( size_type  i,
size_type  j 
) const

Get joint probability of stacked arcs.

Parameters:
ileft sequence position
jright sequence position
Returns:
probability of basepairs (i,j) and (i+1,j-1) occuring simultaneously
double LocARNA::RnaEnsemble::arc_external_prob ( size_type  i,
size_type  j 
) const

Probability of base pair in the external 'loop'.

Parameters:
ileft end of inner base pair
jright end of inner base pair
Returns:
probability that i and j form a basepair and the base pair is external
Note:
This method is designed for use in ExpaRNA-P
For computing these unpaired probabilities we need access to the dynamic programming matrices of the McCaskill algorithm
Precondition:
McCaskill matrices are computed and generated.
See also:
compute_McCaskill_matrices(), RnaEnsemble(const MultipleAlignment &sequence_, bool keepMcC)
Note:
if in loop probs are unavailable, return probability 1.0
double LocARNA::RnaEnsemble::arc_in_loop_prob ( size_type  ip,
size_type  jp,
size_type  i,
size_type  j 
) const

Probabilty of base pair in a specified loop.

Parameters:
ipleft end of inner base pair
jpright end of inner base pair
ileft end of loop enclosing base pair
jright end of loop enclosing base pair
Returns:
probability that (ip,jp) is inner base pair in the loop closed by i and j

Computes the joint probability that there is a base pair (i,j) and a base pair (k,l) (i<k<l<j) that is inner base pair of the loop closed by (i,j).

Note:
This method is designed for use in ExpaRNA-P
For computing these unpaired probabilities we need access to the dynamic programming matrices of the McCaskill algorithm
Precondition:
McCaskill matrices are computed and generated.
See also:
compute_McCaskill_matrices(), RnaEnsemble(const MultipleAlignment &sequence_, bool keepMcC)
Note:
if in loop probs are unavailable, return probability 1.0
double LocARNA::RnaEnsemble::arc_prob ( size_type  i,
size_type  j 
) const

Get arc probability.

Parameters:
ileft sequence position
jright sequence position
Returns:
probability of basepair (i,j)
double LocARNA::RnaEnsemble::arc_stack_prob ( size_type  i,
size_type  j 
) const

Get conditional propability that a base pair is stacked.

Parameters:
ileft sequence position
jright sequence position
Returns:
probability of basepairs (i,j) stacked, i.e. the conditional probability Pr[(i,j)|(i+1,j-1)].
Precondition:
base pair (i+1,j-1) has probability > 0

Availability of pair probabilities.

Returns:
whether probabilities are available

Availability of "in loop" probabilities.

Returns:
whether probabilities are available

Availability of stacking probabilities.

Returns:
whether probabilities are available
size_type LocARNA::RnaEnsemble::length ( ) const

get length of sequence

Returns:
sequence length

get minimum free energy

Note:
this returns the mfe only if the sequence was folded by the object, e.g. in compute_ensemble_probs(); otherwise returns infinity
Returns:
mfe (if available)

get minimum free energy structure

Note:
this returns the mfe structure only if the sequence was folded by the object, e.g. in compute_ensemble_probs(); otherwise returns empty string
Returns:
mfes structure (if available)

Get the sequence.

Returns:
sequence of RNA
RnaEnsemble& LocARNA::RnaEnsemble::operator= ( const RnaEnsemble rna_ensemble)

assignment operator

Parameters:
rna_ensembleobject to be assigned Assigns implementation object (not only pointer)
double LocARNA::RnaEnsemble::paired_downstream_prob ( size_type  i) const

Probability that a position is paired downstream.

Parameters:
isequence position
Returns:
probability that a position i is paired with a position j<i (downstream)
Note:
O(sequence.length()) implementation
See also:
prob_paired_upstream
double LocARNA::RnaEnsemble::paired_upstream_prob ( size_type  i) const

Probability that a position is paired upstream.

Parameters:
isequence position
Returns:
probability that a position i is paired with a position j>i (upstream)
Note:
O(sequence.length()) implementation
See also:
prob_paired_downstream
double LocARNA::RnaEnsemble::unpaired_external_prob ( size_type  k) const

Unpaired probabilty of base in external 'loop'.

Parameters:
kunpaired sequence position
Returns:
probability that k is unpaired and external
Note:
This method is designed for use in ExpaRNA-P
For computing these unpaired probabilities we need access to the dynamic programming matrices of the McCaskill algorithm
Precondition:
McCaskill matrices are computed and generated.
See also:
compute_McCaskill_matrices(), RnaEnsemble(const MultipleAlignment &sequence_, bool keepMcC)
Note:
if in loop probs are unavailable, return probability 1.0
double LocARNA::RnaEnsemble::unpaired_in_loop_prob ( size_type  k,
size_type  i,
size_type  j 
) const

Unpaired probabilty of base in a specified loop.

Parameters:
kunpaired sequence position
ileft end of loop enclosing base pair
jright end of loop enclosing base pair
Returns:
probability that k is unpaired in the loop closed by i and j

Computes the joint probability that there is a base pair (i,j) and a base k (i<k<j) is unpaired such that there is no base pair i<i'<k<j'<j.

Note:
This method is designed for use in ExpaRNA-P
For computing these unpaired probabilities we need access to the dynamic programming matrices of the McCaskill algorithm
Precondition:
McCaskill matrices are computed and generated.
See also:
compute_McCaskill_matrices(), RnaEnsemble(const MultipleAlignment &sequence_, bool keepMcC)
Note:
if in loop probs are unavailable, return probability 1.0
double LocARNA::RnaEnsemble::unpaired_prob ( size_type  i) const

Unpaired probability.

Parameters:
isequence position
Returns:
probability that a position i is unpaired
Note:
O(sequence.length()) implementation

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