-
Notifications
You must be signed in to change notification settings - Fork 2
/
SNP.h
88 lines (70 loc) · 1.92 KB
/
SNP.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// SNP.h: Stores a SNP's information
#ifndef SNP_H
#define SNP_H
#include "BasicDefinitions.h"
#include <string>
#include <vector>
using namespace std;
class SNP
{
public:
// SNP(): default constructor
// Precondition: None.
// Postcondition: strings have been initialized to empty.
// variants has two members with 0 mapped to A and 1 mapped to C.
SNP();
int mapNucleotide(char);
// getSNPID(): accessor for SNPID
// Precondition: None.
// Postcondition: Returns SNPID.
string getSNPID() const;
// getPhysPos(): accessor for physPos
// Precondition: None.
// Postcondition: Returns physPos.
long getPhysPos() const;
string getChr() const;
// getVariant(): accessor for variants
// Precondition: None.
// Postcondition: If i is 0 or 1, return the
// variant nucleotide that is mapped to i; otherwise
// issue a warning message and returns A.
char getVariant(int i) const;
// setSNPID(): mutator for SNPID
// Precondition: None.
// Postcondition: SNPID is set to sid.
void setSNPID(const string& sid);
// setPhysPos(): mutator for physPos
// Precondition: None.
// Postcondition: physPos is set to pp.
void setPhysPos(long pp);
// setVariant(): mutator for variants
// Precondition: None.
// Postcondition: If i is 0 then variant0 is set to nt;
// else if i is 1 then variant1 is set to nt; otherwise
// a warning is issued.
void setVariant(int i, char nt);
void setChr(const string& c);
void setCentimorgan( float cm );
float getCentimorgan();
void setMarkerNumber( unsigned int );
unsigned int getMarkerNumber();
private:
// SNP ID
string SNPID;
// physical position of SNP
long physPos;
// genetic distance position of SNP
float centimorgan;
// allele variant mapped to 0
char variant[2];
// chromosome number
string chr;
// have variants been set 1 == major, 2 == both
short varSet;
// frequency
unsigned int count[2];
// marker number
unsigned int num;
};
#endif
// end SNP.h