-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChromosomeRegion.h
executable file
·54 lines (43 loc) · 1.51 KB
/
ChromosomeRegion.h
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
51
52
53
54
#ifndef CHROMOSOMEREGION_H
#define CHROMOSOMEREGION_H
#include "GenomePosition.h"
#include "Interval.h"
#include <iostream>
class ChromosomeRegion
{
public:
ChromosomeRegion(int referenceId,
const std::string& referenceName,
int startPos,
int endPos);
int GetReferenceId() const { return referenceId; }
std::string GetReferenceName() const { return referenceName; }
GenomePosition GetStart() const { return GenomePosition(referenceId, referenceName, interval.GetStart()); }
GenomePosition GetEnd() const { return GenomePosition(referenceId, referenceName, interval.GetEnd()); }
int GetStartPosition() const { return interval.GetStart(); }
int GetEndPosition() const { return interval.GetEnd(); }
int GetLength() const { return interval.Length(); }
Interval GetInterval() const { return interval; }
ChromosomeRegion *Merge(const ChromosomeRegion &other);
void CutHead(int newPos)
{
if (newPos > interval.GetStart())
{
interval.SetStart(newPos);
}
}
void CutTail(int newPos)
{
if (newPos < interval.GetEnd())
{
interval.SetEnd(newPos);
}
}
friend std::ostream &operator <<(std::ostream& stream, const ChromosomeRegion& cRegion);
friend bool operator == (const ChromosomeRegion& one, const ChromosomeRegion& two);
private:
int referenceId;
std::string referenceName;
Interval interval;
};
#endif // CHROMOSOMEREGION_H