File: ebwt_search_util.cpp

package info (click to toggle)
bowtie 1.3.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,792 kB
  • sloc: cpp: 37,066; perl: 5,806; ansic: 1,465; sh: 1,194; python: 463; makefile: 430
file content (42 lines) | stat: -rw-r--r-- 1,062 bytes parent folder | download | duplicates (3)
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
#include "ebwt_search_util.h"

using namespace std;

/**
 * Print a hit along with information about the backtracking
 * regions constraining the hit.
 */
void printHit(const EList<BTRefString >& os,
              const Hit& h,
              const BTDnaString& 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;
}