forked from BenLangmead/bowtie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ebwt_search_util.cpp
44 lines (42 loc) · 1.09 KB
/
ebwt_search_util.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "ebwt_search_util.h"
#include "seqan/file.h"
using namespace std;
using namespace seqan;
/**
* Print a hit along with information about the backtracking
* regions constraining the hit.
*/
void printHit(const vector<String<Dna5> >& os,
const Hit& h,
const String<Dna5>& qry,
size_t qlen,
uint32_t unrevOff,
uint32_t oneRevOff,
uint32_t twoRevOff,
uint32_t threeRevOff,
bool ebwtFw)
{
// Print pattern sequence
cout << " Pat: " << qry << endl;
// Print text sequence
cout << " Tseg: ";
if(ebwtFw) {
for(size_t i = 0; i < qlen; i++) {
cout << os[h.h.first][h.h.second + i];
}
} else {
for(int i = (int)qlen-1; i >= 0; i--) {
cout << os[h.h.first][h.h.second + i];
}
}
cout << endl;
cout << " Bt: ";
for(int i = (int)qlen-1; i >= 0; i--) {
if (i < (int)unrevOff) cout << "0";
else if(i < (int)oneRevOff) cout << "1";
else if(i < (int)twoRevOff) cout << "2";
else if(i < (int)threeRevOff) cout << "3";
else cout << "X";
}
cout << endl;
}