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

Represents the mapping for sparsification. More...

#include <sparsification_mapper.hh>

List of all members.

Classes

struct  info_for_pos

Public Types

typedef BasePairs__Arc Arc
 type of arc
typedef size_t ArcIdx
 type of arc index
typedef std::vector< ArcIdxArcIdxVec
 vector of arc indices
typedef pos_type matidx_t
 type for a matrix position
typedef pos_type seq_pos_t
 type for a sequence position
typedef size_t index_t
 type for an index
typedef std::vector< info_for_posInfoForPosVec

Public Member Functions

 SparsificationMapper (const BasePairs &bps_, const ExtRnaData &rnadata_, double prob_unpaired_in_loop_threshold_, double prob_basepair_in_loop_threshold_, bool index_left_ends)
size_type get_max_info_vec_size () const
const InfoForPosVecvalid_seq_positions (index_t idx) const
const ArcIdxVecvalid_arcs_right_adj (index_t idx, matidx_t pos) const
matidx_t first_valid_mat_pos_before_eq (index_t index, seq_pos_t pos, index_t left_end=std::numeric_limits< index_t >::max()) const
matidx_t first_valid_mat_pos_before (index_t index, seq_pos_t pos, index_t left_end=std::numeric_limits< index_t >::max()) const
seq_pos_t get_pos_in_seq_new (index_t idx, matidx_t pos) const
size_type number_of_valid_mat_pos (index_t idx) const
bool pos_unpaired (index_t idx, matidx_t pos) const
bool matching_without_gap_possible (const Arc &arc, seq_pos_t pos) const
const ArcIdxVecvalid_arcs_left_adj (const Arc &arc, seq_pos_t pos) const
virtual ~SparsificationMapper ()
 class destructor
matidx_t idx_geq (index_t index, seq_pos_t min_col, index_t left_end=std::numeric_limits< index_t >::max()) const
matidx_t idx_after_leq (index_t index, seq_pos_t max_col, index_t left_end=std::numeric_limits< index_t >::max()) const
bool is_valid_pos (const Arc &arc, seq_pos_t pos) const
bool is_valid_pos_external (seq_pos_t pos) const

Detailed Description

Represents the mapping for sparsification.

The datastructures are either indexed by the ArcIdx (in Exparna_P) or by the common left end (Locarna_ng).


Member Typedef Documentation

vector of struct info_for_pos that is assigned to the index (either common left end or arc index)


Constructor & Destructor Documentation

LocARNA::SparsificationMapper::SparsificationMapper ( const BasePairs bps_,
const ExtRnaData rnadata_,
double  prob_unpaired_in_loop_threshold_,
double  prob_basepair_in_loop_threshold_,
bool  index_left_ends 
) [inline]

Constructor

Parameters:
bps_BasePairs
rnadata_RnaData
prob_unpaired_in_loop_threshold_probability threshold for unpaired position under a loop
prob_basepair_in_loop_threshold_probability threshold for basepair under a loop
index_left_endsspecifies whether the datastructures are indexed by the common left end (true) or by the arc index (false)

Member Function Documentation

matidx_t LocARNA::SparsificationMapper::first_valid_mat_pos_before ( index_t  index,
seq_pos_t  pos,
index_t  left_end = std::numeric_limits<index_t>::max() 
) const [inline]

gives the first valid matrix position before a sequence position

Parameters:
indexindex
possequence position
left_endthe index left end;if not set, it is set to the index (for example when indexing by the left end is used)
Returns:
the first valid matrix position before the position pos at the index left_end
matidx_t LocARNA::SparsificationMapper::first_valid_mat_pos_before_eq ( index_t  index,
seq_pos_t  pos,
index_t  left_end = std::numeric_limits<index_t>::max() 
) const [inline]

gives the first valid matrix position before or equal to a sequence position

Parameters:
indexindex
possequence position
left_endthe index left end; if not set, it is set to the index (for example when indexing by the left end is used)
Returns:
the first valid matrix position before or equal to the position pos at the index left_end

returns the maximal size of the info vectors

maps a matrix position to the corresponding sequence position

Parameters:
idxindex
posmatrix position
Returns:
the sequence position that corresponds to the matrix position at the index idx
matidx_t LocARNA::SparsificationMapper::idx_after_leq ( index_t  index,
seq_pos_t  max_col,
index_t  left_end = std::numeric_limits<index_t>::max() 
) const [inline]

gives the index position after the index position that stores the first sequence position that is less than or equal to max_col if it does not exist return 0

Parameters:
indexindex
max_colthe maximal column in the non-sparsified matrix
left_endthe index left end; if not set, it is set to the index (for example when indexing by the left end is used)
Returns:
matrix position that stores the first sequence position that is less than or equal to max_col
matidx_t LocARNA::SparsificationMapper::idx_geq ( index_t  index,
seq_pos_t  min_col,
index_t  left_end = std::numeric_limits<index_t>::max() 
) const [inline]

gives the index that stores the first sequence position that is greater than or equal to min_col if it does not exist, return the number of valid matrix positions num_pos

Parameters:
indexindex
min_colthe minimal column in the non-sparsified matrix
left_endthe index left end; if not set, it is set to the index (for example when indexing by the left end is used)
Returns:
matrix position that stores the first sequence position that is greater than or equal to min_col
bool LocARNA::SparsificationMapper::is_valid_pos ( const Arc arc,
seq_pos_t  pos 
) const [inline]

Is position pos valid?

Parameters:
arcArc
possequence position
Returns:
true, if the probability that the inner_arc occurs in the loop closed by the arc is greater or equal to the threshold for a basepair under a loop
false, otherwise

Is position pos a valid external position?

Parameters:
possequence position
Returns:
true, if the sequence position pos has a probability to be external greater than or equal to prob_unpaired_in_loop_threshold
bool LocARNA::SparsificationMapper::matching_without_gap_possible ( const Arc arc,
seq_pos_t  pos 
) const [inline]

Is a matrix position unpaired?

Parameters:
arcarc that is used as an index
possequence position
Returns:
true, if matching without a gap is possible from pos for the arc index
false, otherwise
matching without a gap is possible from pos if the sequence position that corresponds to the first valid matrix position before pos is directly adjacent to pos

gives the number of valid matrix positions for the index

Parameters:
idxindex
Returns:
the number of valid matrix positions for idx
bool LocARNA::SparsificationMapper::pos_unpaired ( index_t  idx,
matidx_t  pos 
) const [inline]

Is a matrix position unpaired?

Parameters:
idxindex
posmatrix position
Returns:
true, if pos can occur unpaired
false, otherwise
const ArcIdxVec& LocARNA::SparsificationMapper::valid_arcs_left_adj ( const Arc arc,
seq_pos_t  pos 
) const [inline]

gives all valid arcs with common left end from a sequence position

Parameters:
arcarc that is used as an index
possequence position
Returns:
vector of all valid arcs with common left end pos for the arc index

gives all valid arcs that end at a matrix position

Parameters:
idxindex
posmatrix position
Returns:
vector of all valid arcs with the common right end pos

gives all valid positions with additional information for an index

Parameters:
idxindex
Returns:
vector of all valid positions with additional information at index

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