-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmarker.h
65 lines (44 loc) · 1.68 KB
/
marker.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
55
56
57
58
59
60
61
62
63
64
65
#ifndef MARKER_H
#define MARKER_H
#include <vector>
#define LAST_CHROM 23
using namespace std;
class Marker {
public:
//////////////////////////////////////////////////////////////////
// public static methods
//////////////////////////////////////////////////////////////////
static void readMarkerFile(char *markerFile);
static int getNumMarkers() { return _allMarkers.size(); }
static int getFirstMarkerNum(int chrom) { return _firstMarkerNum[chrom]; }
static int getNumChromMarkers(int chrom)
{ return _firstMarkerNum[chrom] - _firstMarkerNum[chrom - 1]; }
static const Marker * getMarker(int num) { return _allMarkers[num]; }
//////////////////////////////////////////////////////////////////
// public methods
//////////////////////////////////////////////////////////////////
int getChrom() const { return _chrom; }
double getMapPos() const { return _mapPos; }
private:
Marker(char *markerName, int chrom, double mapPos, int physPos,
char alleles[2]);
// marker name (usually SNP rs id)
char *_name;
// chromosome
int _chrom;
// genetic position (map distance):
double _mapPos;
// physical position:
int _physPos;
// Major and minor alleles (respectively)
char _alleles[2];
//////////////////////////////////////////////////////////////////
// private static variables
//////////////////////////////////////////////////////////////////
// List of all the markers read in:
static vector<Marker *> _allMarkers;
// Stores the number of marker loci on the corresponding chromosome number
// 1..23
static int _firstMarkerNum[LAST_CHROM + 1];
};
#endif // MARKER_H