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

represent sparsified data of RNA ensemble extended by in loop probabilities More...

#include <ext_rna_data.hh>

Inheritance diagram for LocARNA::ExtRnaData:
LocARNA::RnaData

List of all members.

Public Member Functions

 ExtRnaData (const RnaEnsemble &rna_ensemble, double p_bpcut, double p_bpilcut, double p_uilcut, double max_bps_length_ratio, double max_uil_length_ratio, double max_bpil_length_ratio, const PFoldParams &pfoldparams)
 Construct from RnaEnsemble with cutoff probability.
 ExtRnaData (const std::string &filename, double p_bpcut, double p_bpilcut, double p_uilcut, double max_bps_length_ratio, double max_uil_length_ratio, double max_bpil_length_ratio, const PFoldParams &pfoldparams)
 Construct from input file.
 ~ExtRnaData ()
 destructor
double arc_in_loop_cutoff_prob () const
 Get base pair in loop cutoff probability.
double arc_in_loop_prob (pos_type i, pos_type j, pos_type p, pos_type q) const
 Get base pair in loop probability.
double arc_external_prob (pos_type i, pos_type j) const
 Get base pair in loop probability.
double unpaired_in_loop_cutoff_prob () const
 Get unpaired base in loop cutoff probability.
double unpaired_in_loop_prob (pos_type k, pos_type p, pos_type q) const
 Get base pair in loop probability.
double unpaired_external_prob (pos_type k) const
 Get base pair in loop probability.
std::ostream & write_size_info (std::ostream &out) const
 Write object size information.
std::ostream & write_pp (std::ostream &out, double p_outbpcut=0, double p_outbpilcut=0, double p_outuilcut=0) const

Protected Member Functions

virtual std::istream & read_pp (std::istream &in)
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
virtual bool inloopprobs_ok () const
 check in loop probabilities

Friends

class ExtRnaDataImpl

Detailed Description

represent sparsified data of RNA ensemble extended by in loop probabilities

knows sequence, cutoff probability and base pair probabilities greater than the cutoff probability

Note:
This class knows the cutoff probabilities of its data. These cutoffs can be different from the cutoffs in classes like BasePairs which define the structure elements that are considered by algorithms.
put the extension of extended pp format as additional record after the regular pp-data, such that extended pp files can be read as non-extended ones

Constructor & Destructor Documentation

LocARNA::ExtRnaData::ExtRnaData ( const RnaEnsemble rna_ensemble,
double  p_bpcut,
double  p_bpilcut,
double  p_uilcut,
double  max_bps_length_ratio,
double  max_uil_length_ratio,
double  max_bpil_length_ratio,
const PFoldParams pfoldparams 
)

Construct from RnaEnsemble with cutoff probability.

Parameters:
rna_ensembleRNA ensemble data
p_bpcutcutoff probability for base pairs
p_bpilcutcutoff probability for base pairs in loops
p_uilcutcutoff probability for unpaired bases in loops
pfoldparamsparameters for partition folding
Note:
requires that rnaensemble has in loop probabilities
LocARNA::ExtRnaData::ExtRnaData ( const std::string &  filename,
double  p_bpcut,
double  p_bpilcut,
double  p_uilcut,
double  max_bps_length_ratio,
double  max_uil_length_ratio,
double  max_bpil_length_ratio,
const PFoldParams pfoldparams 
)

Construct from input file.

Parameters:
filenameinput file name
p_bpcutcutoff probability for base pairs
p_bpilcutcutoff probability for base pairs in loops
p_uilcutcutoff probability for unpaired bases in loops
pfoldparamsparameters for partition folding
Note:
autodetect format of input; for fa or aln input formats, predict base pair probabilities

Member Function Documentation

double LocARNA::ExtRnaData::arc_external_prob ( pos_type  i,
pos_type  j 
) const

Get base pair in loop probability.

Parameters:
ileft sequence position
jright sequence position
Returns:
probability of basepair (i,j) in external loop if above threshold; otherwise, 0

Get base pair in loop cutoff probability.

Returns:
cutoff probability p_bpcut
double LocARNA::ExtRnaData::arc_in_loop_prob ( pos_type  i,
pos_type  j,
pos_type  p,
pos_type  q 
) const

Get base pair in loop probability.

Parameters:
ileft sequence position of inner base pair
jright sequence position of inner base pair
pleft sequence position of closing base pair
qright sequence position of closing base pair
Returns:
joint probability of basepair (i,j) in loop of (p,q) if above threshold; otherwise, 0
void LocARNA::ExtRnaData::init_from_fixed_structure ( const RnaStructure structure,
const PFoldParams pfoldparams 
) [protected, virtual]

initialize from fixed structure

Parameters:
structurefixed structure
pfoldparamsfolding parameters
Note:
overloaded to initialize with additional information (in loop probabilities)

Reimplemented from LocARNA::RnaData.

void LocARNA::ExtRnaData::init_from_rna_ensemble ( const RnaEnsemble rna_ensemble,
const PFoldParams pfoldparams 
) [protected, virtual]

initialize from rna ensemble

Parameters:
rna_ensemblerna ensemble
pfoldparamsfolding parameters
Note:
overloaded to initialize with additional information (in loop probabilities)
Precondition:
bp cutoff prob is initialized

Reimplemented from LocARNA::RnaData.

bool LocARNA::ExtRnaData::inloopprobs_ok ( ) const [protected, virtual]

check in loop probabilities

Returns:
true iff loop probabilities are available or not required
Note:
use to indicate the need for recomputation in read_autodetect(); always true in RnaData

Reimplemented from LocARNA::RnaData.

std::istream & LocARNA::ExtRnaData::read_pp ( std::istream &  in) [protected, virtual]

Read data in pp format 2.0 with in-loop probabilities

Parameters:
ininput stream
See also:
RnaData::read_pp()

Reimplemented from LocARNA::RnaData.

double LocARNA::ExtRnaData::unpaired_external_prob ( pos_type  k) const

Get base pair in loop probability.

Parameters:
ksequence position (unpaired base)
Returns:
probability of base k unpaired in external loop if above threshold; otherwise, 0

Get unpaired base in loop cutoff probability.

Returns:
cutoff probability p_bpcut
double LocARNA::ExtRnaData::unpaired_in_loop_prob ( pos_type  k,
pos_type  p,
pos_type  q 
) const

Get base pair in loop probability.

Parameters:
ksequence position (unpaired base)
pleft sequence position of closing base pair
qright sequence position of closing base pair
Returns:
joint probability of unpaired base k in loop of (p,q) if above threshold; otherwise, 0
std::ostream & LocARNA::ExtRnaData::write_pp ( std::ostream &  out,
double  p_outbpcut = 0,
double  p_outbpilcut = 0,
double  p_outuilcut = 0 
) const

Write data in extended pp format

Parameters:
outoutput stream
p_outbpcutcutoff probability
p_outbpilcutcutoff probability base pairs in loop
p_outuilcutcutoff probability unpaired in loop
Returns:
stream

Writes only base pairs with probabilities greater than p_outbpcut; base pairs in loops, p_outbpilcut; unpaired bases in loops, p_outuilcut

std::ostream & LocARNA::ExtRnaData::write_size_info ( std::ostream &  out) const

Write object size information.

Parameters:
outoutput stream

Writes numbers of stored probabilities to stream

Reimplemented from LocARNA::RnaData.


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