File: ebwt_search_util.cpp

package info (click to toggle)
bowtie 1.2.3+dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 16,888 kB
  • sloc: cpp: 35,784; perl: 5,903; ansic: 1,247; sh: 1,180; python: 487; makefile: 426
file content (44 lines) | stat: -rw-r--r-- 1,112 bytes parent folder | download | duplicates (5)
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;
}