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