24 #ifndef _NOGAP_ALIGNMENT_VECTOR_H_ 25 #define _NOGAP_ALIGNMENT_VECTOR_H_ 28 #include "alignment_vector_base.h" 29 #include "multimatrixchain.h" 54 void addAlignment(seg_index_t
id, seq_len_t p_start, seq_len_t t_start, seq_len_t size) {
56 _data.push_back(p_start);
57 _data.push_back(t_start);
58 _data.push_back(size);
62 void addAlignment(seg_index_t
id, seq_len_t p_start, seq_len_t t_start,
const events_storage_t &vec) {
63 _data.push_back(p_start);
64 _data.push_back(t_start);
65 _data.push_back(vec.size());
67 _starts.push_back(
_events.size());
76 bool isMismatch(seq_len_t i, seq_len_t j)
const {
78 check_and_throw(
_events.size() == 0,
"Alignment vector: no errors stored in the vector.");
80 if (_starts[i] + j - 1 >=
_events.size()) {
81 std::cout << (int) _starts.size() << std::endl;
82 std::cout << (int) i << std::endl;
83 std::cout << (int) _starts[i] << std::endl;
84 std::cout << (int) j << std::endl;
85 std::cout << (int)
_events.size() << std::endl;
86 throw(std::runtime_error(
"Alignment vector: mismatch index is out of bounds."));
89 return _events[_starts[i] + j - 1];
93 error_num_t numMismatches(seq_len_t i, seq_len_t start, seq_len_t end)
const {
95 check_and_throw(
_events.size() == 0,
"Alignment vector: no errors stored in the vector.");
97 if (_starts[i] + start - 1 >=
_events.size()) {
98 throw(std::runtime_error(
"Alignment vector: start index is out of bounds."));
100 if (_starts[i] + end - 1 >=
_events.size()) {
101 throw(std::runtime_error(
"Alignment vector: end index is out of bounds."));
105 for (
size_t j = start; j <= end; ++j) {
106 res +=
static_cast<error_num_t
>(
_events[_starts[i] + j - 1]);
events_storage_t _events
Vector of 4-tpuples - pattern start, text start, alignment length and a text ID.
Definition: alignment_vector_base.h:141
Definition: nogap_alignment_vector.h:37
void addAlignment(seg_index_t id, seq_len_t p_start, seq_len_t t_start, seq_len_t size)
Add a new alignment to the vector.
Definition: nogap_alignment_vector.h:55
Definition: alignment_vector_base.h:41