-
Notifications
You must be signed in to change notification settings - Fork 1
/
obsData.cc
61 lines (46 loc) · 1.13 KB
/
obsData.cc
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
#include "obsData.h"
obsSite::obsSite( )
{
mChr = "" ;
mLocation = 0;
mCoverage = 0;
mDerived = 0;
mClint = 0;
mUlindi = 0;
mDist = 0.0;
}
//redefine >> operator
std::istream& operator >>(std::istream& Stream, obsSite& Obj)
{
Stream >> Obj.mChr >> Obj.mLocation >> Obj.mClint >> Obj.mCoverage >> Obj.mDerived >> Obj.mUlindi >> Obj.mDist;
return Stream;
}
obsSequence::obsSequence( )
{
}
int obsSequence::size(void)
{
return mSequence.size();
}
obsSite obsSequence::at(int i)
{
return mSequence[i];
}
char obsSequence::loadSequence(const char* fileName)
{
ifstream dataStream( fileName, ifstream::in );
if ( ! dataStream ) {
cerr << "Error: Can't open inputfile `" << fileName << "'" << endl ;
return 1;
}
while ( dataStream )
{
string s ;
getline( dataStream, s ) ;
istringstream ss( s ) ;
obsSite tmp;
ss >> tmp;
if ( tmp.getChr() != "" )
mSequence.push_back( tmp ) ;
}
}