1 /**
2  * range.h
3  */
4 
5 #ifndef RANGE_H_
6 #define RANGE_H_
7 
8 #include <stdint.h>
9 
10 #include "assert_helpers.h"
11 #include "btypes.h"
12 #include "ds.h"
13 
14 /**
15  * A range along with the alignment it represents.
16  */
17 struct Range {
RangeRange18 	Range() :
19 		top(OFF_MASK), bot(0), cost(0), stratum(0), numMms(0),
20 		fw(true), mate1(true), ebwt(NULL)
21 	{
22 		mms.clear();
23 		refcs.clear();
24 	}
25 
validRange26 	bool valid() const {
27 		return top < OFF_MASK;
28 	}
29 
invalidateRange30 	void invalidate() {
31 		top = OFF_MASK;
32 	}
33 
34 	TIndexOffU top;     // top of range
35 	TIndexOffU bot;     // bottom of range
36 	uint16_t cost;    // cost
37 	uint32_t stratum; // stratum
38 	uint32_t numMms;  // # mismatches
39 	bool fw;          // the forward orientation of read aligned?
40 	bool mate1;       // read aligned is #1 mate/single?
41 	EList<TIndexOffU> mms;   // list of positions with mismatches
42 	EList<uint8_t>  refcs; // reference characters at mismatch positions
43 	// const Ebwt<seqan::String<seqan::Dna> > *ebwt;
44         const Ebwt *ebwt;
45 
repOkRange46 	bool repOk() const {
47 		assert_eq(refcs.size(), mms.size());
48 		assert_eq(numMms, mms.size());
49 		assert_leq(stratum, numMms);
50 		return true;
51 	}
52 };
53 
54 #endif /* RANGE_H_ */
55