Represents the mapping for sparsification. More...
#include <sparsification_mapper.hh>
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< ArcIdx > | ArcIdxVec |
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_pos > | InfoForPosVec |
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 InfoForPosVec & | valid_seq_positions (index_t idx) const |
const ArcIdxVec & | valid_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 ArcIdxVec & | valid_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 |
Represents the mapping for sparsification.
The datastructures are either indexed by the ArcIdx (in Exparna_P) or by the common left end (Locarna_ng).
typedef std::vector<info_for_pos> LocARNA::SparsificationMapper::InfoForPosVec |
vector of struct info_for_pos that is assigned to the index (either common left end or arc index)
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
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_ends | specifies whether the datastructures are indexed by the common left end (true) or by the arc index (false) |
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
index | index |
pos | sequence position |
left_end | the index left end;if not set, it is set to the index (for example when indexing by the left end is used) |
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
index | index |
pos | sequence position |
left_end | the index left end; if not set, it is set to the index (for example when indexing by the left end is used) |
size_type LocARNA::SparsificationMapper::get_max_info_vec_size | ( | ) | const [inline] |
returns the maximal size of the info vectors
seq_pos_t LocARNA::SparsificationMapper::get_pos_in_seq_new | ( | index_t | idx, |
matidx_t | pos | ||
) | const [inline] |
maps a matrix position to the corresponding sequence position
idx | index |
pos | matrix position |
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
index | index |
max_col | the maximal column in the non-sparsified matrix |
left_end | the index left end; if not set, it is set to the index (for example when indexing by the left end is used) |
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
index | index |
min_col | the minimal column in the non-sparsified matrix |
left_end | the index left end; if not set, it is set to the index (for example when indexing by the left end is used) |
bool LocARNA::SparsificationMapper::is_valid_pos | ( | const Arc & | arc, |
seq_pos_t | pos | ||
) | const [inline] |
Is position pos valid?
arc | Arc |
pos | sequence position |
bool LocARNA::SparsificationMapper::is_valid_pos_external | ( | seq_pos_t | pos | ) | const [inline] |
Is position pos a valid external position?
pos | sequence position |
bool LocARNA::SparsificationMapper::matching_without_gap_possible | ( | const Arc & | arc, |
seq_pos_t | pos | ||
) | const [inline] |
Is a matrix position unpaired?
arc | arc that is used as an index |
pos | sequence position |
size_type LocARNA::SparsificationMapper::number_of_valid_mat_pos | ( | index_t | idx | ) | const [inline] |
gives the number of valid matrix positions for the index
idx | index |
bool LocARNA::SparsificationMapper::pos_unpaired | ( | index_t | idx, |
matidx_t | pos | ||
) | const [inline] |
Is a matrix position unpaired?
idx | index |
pos | matrix position |
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
arc | arc that is used as an index |
pos | sequence position |
const ArcIdxVec& LocARNA::SparsificationMapper::valid_arcs_right_adj | ( | index_t | idx, |
matidx_t | pos | ||
) | const [inline] |
gives all valid arcs that end at a matrix position
idx | index |
pos | matrix position |
const InfoForPosVec& LocARNA::SparsificationMapper::valid_seq_positions | ( | index_t | idx | ) | const [inline] |
gives all valid positions with additional information for an index
idx | index |