forked from sgusev/GERMLINE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSNPPositionMap.cpp
More file actions
44 lines (33 loc) · 829 Bytes
/
SNPPositionMap.cpp
File metadata and controls
44 lines (33 loc) · 829 Bytes
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
// SNPPositionMap.cpp: Map from SNP IDs to positions in Info file
#include "SNPPositionMap.h"
#include <iostream>
using namespace std;
// SNPPositionMap(): default constructor
SNPPositionMap::SNPPositionMap()
{
}
// retrievePosition(): retrieves position for a SNP ID
int SNPPositionMap::retrievePosition(string SNPID)
{
if (snpPosMap.find(SNPID)!=snpPosMap.end())
return snpPosMap[SNPID];
else
return -1;
}
// sizeOfMap(): returns size of map
int SNPPositionMap::sizeOfMap()
{
return (int)snpPosMap.size();
}
// storeMapping(): stores mapping from SNP ID to position
void SNPPositionMap::storeMapping(string SNPID, int position)
{
if (position >= 0)
snpPosMap[SNPID] = position;
else
{
cerr << "WARNING:SNPPositionMap::storeMapping():position is not positive"
<< endl;
}
}
// end SNPPositionMap.cpp