LocARNA-1.8.11
Public Member Functions | Protected Member Functions | Friends | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for LocARNA::ExtRnaData:
Collaboration graph
[legend]

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. More...
 
 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. More...
 
 ~ExtRnaData ()
 destructor
 
double arc_in_loop_cutoff_prob () const
 Get base pair in loop cutoff probability. More...
 
double arc_in_loop_prob (pos_type i, pos_type j, pos_type p, pos_type q) const
 Get base pair in loop probability. More...
 
double arc_external_prob (pos_type i, pos_type j) const
 Get base pair in loop probability. More...
 
double unpaired_in_loop_cutoff_prob () const
 Get unpaired base in loop cutoff probability. More...
 
double unpaired_in_loop_prob (pos_type k, pos_type p, pos_type q) const
 Get base pair in loop probability. More...
 
double unpaired_external_prob (pos_type k) const
 Get base pair in loop probability. More...
 
std::ostream & write_size_info (std::ostream &out) const
 Write object size information. More...
 
std::ostream & write_pp (std::ostream &out, double p_outbpcut=0, double p_outbpilcut=0, double p_outuilcut=0) const
 
- Public Member Functions inherited from LocARNA::RnaData
 RnaData (const RnaEnsemble &rna_ensemble, double p_bpcut, double max_bps_length_ratio, const PFoldParams &pfoldparams)
 Construct from RnaEnsemble with cutoff probability. More...
 
 RnaData (const std::string &filename, double p_bpcut, double max_bps_length_ratio, const PFoldParams &pfoldparams)
 Construct from file. More...
 
 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. More...
 
virtual ~RnaData ()
 destructor
 
const Sequencesequence () const
 Get the multiple alignment as sequence. More...
 
const MultipleAlignmentmultiple_alignment () const
 Get the multiple alignment. More...
 
size_type length () const
 Get the sequence length. More...
 
double arc_cutoff_prob () const
 Get base pair cutoff probability. More...
 
double arc_prob (pos_type i, pos_type j) const
 Get arc probability. More...
 
std::string mea_structure (double gamma=1.) const
 maximum expected accuracy structure More...
 
vrna_plist_t * plist () const
 Construct plist (pair list of Vienna RNA) More...
 
double joint_arc_prob (pos_type i, pos_type j) const
 Get arc probability. More...
 
double stacked_arc_prob (pos_type i, pos_type j) const
 Get arc probability. More...
 
double prob_paired_upstream (pos_type i) const
 Probability that a position is paired upstream. More...
 
double prob_paired_downstream (pos_type i) const
 Probability that a position is paired downstream. More...
 
double prob_unpaired (pos_type i) const
 Unpaired probability. More...
 
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. More...
 
bool has_stacking () const
 Availability of stacking terms. More...
 
void set_anchors (const SequenceAnnotation &anchors)
 Write access to alignment anchors. More...
 

Protected Member Functions

virtual std::istream & read_pp (std::istream &in)
 
virtual void init_from_fixed_structure (const SequenceAnnotation &structure, bool stacking)
 initialize from fixed structure More...
 
virtual void init_from_rna_ensemble (const RnaEnsemble &rna_ensemble, const PFoldParams &pfoldparams)
 initialize from rna ensemble More...
 
virtual bool inloopprobs_ok () const
 check in loop probabilities More...
 
- Protected Member Functions inherited from LocARNA::RnaData
 RnaData (double p_bpcut)
 Almost empty constructor. More...
 
arc_probs_const_iterator arc_probs_begin () const
 begin of arcs with probability above cutoff Supports iteration over arcs More...
 
arc_probs_const_iterator arc_probs_end () const
 begin of arcs with probability above cutoff Supports iteration over arcs More...
 
bool read_autodetect (const std::string &filename, bool stacking)
 read and initialize from file, autodetect format More...
 
virtual void read_pp (const std::string &filename)
 
void read_old_pp (const std::string &filename)
 
void read_ps (const std::string &filename)
 

Friends

class ExtRnaDataImpl
 

Additional Inherited Members

- Public Types inherited from LocARNA::RnaData
typedef SparseMatrix< double > arc_prob_matrix_t
 arc probability matrix
 
typedef size_t size_type
 usual size type
 
- Protected Types inherited from LocARNA::RnaData
typedef arc_prob_matrix_t::const_iterator arc_probs_const_iterator
 type of constant iterator over arcs with probability above cutoff
 
- Protected Attributes inherited from LocARNA::RnaData
RnaDataImplpimpl_
 

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
double LocARNA::ExtRnaData::arc_in_loop_cutoff_prob ( ) const

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 SequenceAnnotation structure,
bool  stacking 
)
protectedvirtual

initialize from fixed structure

Parameters
structurefixed structure
stackingwhether to initialize stacking terms
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 
)
protectedvirtual

initialize from rna ensemble

Parameters
rna_ensemblerna ensemble
stackingwhether to initialize stacking terms
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
protectedvirtual

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)
protectedvirtual

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
double LocARNA::ExtRnaData::unpaired_in_loop_cutoff_prob ( ) const

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


The documentation for this class was generated from the following files: