File: range.h

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 (50 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download | duplicates (4)
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
45
46
47
48
49
50
/**
 * range.h
 */

#ifndef RANGE_H_
#define RANGE_H_

#include <vector>
#include <stdint.h>

/**
 * A range along with the alignment it represents.
 */
struct Range {
	Range() :
		top(OFF_MASK), bot(0), cost(0), stratum(0), numMms(0),
		fw(true), mate1(true), ebwt(NULL)
	{
		mms.clear();
		refcs.clear();
	}

	bool valid() const {
		return top < OFF_MASK;
	}

	void invalidate() {
		top = OFF_MASK;
	}

	TIndexOffU top;     // top of range
	TIndexOffU bot;     // bottom of range
	uint16_t cost;    // cost
	uint32_t stratum; // stratum
	uint32_t numMms;  // # mismatches
	bool fw;          // the forward orientation of read aligned?
	bool mate1;       // read aligned is #1 mate/single?
	std::vector<TIndexOffU> mms;   // list of positions with mismatches
	std::vector<uint8_t>  refcs; // reference characters at mismatch positions
	const Ebwt<seqan::String<seqan::Dna> > *ebwt;

	bool repOk() const {
		assert_eq(refcs.size(), mms.size());
		assert_eq(numMms, mms.size());
		assert_leq(stratum, numMms);
		return true;
	}
};

#endif /* RANGE_H_ */