-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSegment.hpp
40 lines (32 loc) · 872 Bytes
/
Segment.hpp
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
#ifndef genomic_Segment_h
#define genomic_Segment_h
#include "typedefs.h"
template <typename V>
class Segment
{
public:
// chromosome number (1-index)
chromid chromosome;
position start;
position end;
position count;
V value;
bool flag;
bool aberrant;
bool valid;
position length() {
return end - start + 1;
}
Segment() : flag(false), aberrant(false), valid(true) {}
Segment(chromid chromosomeNumber)
: flag(false), aberrant(false), valid(true),
chromosome(chromosomeNumber) {}
Segment(chromid chromosomeNumber, position startPos, position endPos, unsigned long numElements, V segValue)
: flag(false), aberrant(false), valid(true),
chromosome(chromosomeNumber),
start(startPos), end(endPos), count(numElements), value(segValue) {}
static bool compare(const Segment& a, const Segment& b) {
return a.start < b.start;
}
};
#endif