-
Notifications
You must be signed in to change notification settings - Fork 2
/
DistResult.h
96 lines (80 loc) · 2.2 KB
/
DistResult.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
89
90
91
92
93
94
95
96
/*
* DistResult
* Date: Jan-24-2013
* Author : Gabriel Renaud gabriel.reno [at sign here] gmail.com
*
*/
#ifndef DistResult_h
#define DistResult_h
using namespace std;
#include <sstream>
#include <vector>
#include <list>
#include "DistAlleleCounter.h"
#include "libgab.h"
class DistResult{
private:
public:
//This is everything
DistAlleleCounter all;
//This is without the ones marked as CpG
DistAlleleCounter noCpg;
//This is only with the ones marked as CpG
DistAlleleCounter onlyCpg;
//This excludes the following cases:
// S = C, R or A = T
// S = T, R or A = C
// S = A, R or A = G
// S = G, R or A = A
DistAlleleCounter transversions;
DistAlleleCounter transitions;
//This excludes the following cases:
// S = T, R or A = C
// S = A, R or A = G
DistAlleleCounter noDamage;
DistResult();
~DistResult();
string getHeader();
void addIfNotInfinity( vector<double> * target , double val );
string printWithBootstrap(list< vector< vector< DistResult > > > & boostraps,unsigned int i,unsigned int j,unsigned int numberOfBootstraps);
string printWithJacknife(const vector< const DistResult * > * jacknife,const string & dnaDistMode);
string printAll() const;
DistResult & operator+= (const DistResult & other){
all += other.all;
noCpg += other.noCpg;
onlyCpg += other.onlyCpg;
transitions += other.transitions;
transversions += other.transversions;
return *this;
}
DistResult & operator-= (const DistResult & other){
all -= other.all;
noCpg -= other.noCpg;
onlyCpg -= other.onlyCpg;
transitions -= other.transitions;
transversions -= other.transversions;
return *this;
}
friend ostream& operator<<(ostream& os, const DistResult & ct){
os<<ct.all<<"\t"
<<ct.onlyCpg<<"\t"
<<ct.noCpg<<"\t"
<<ct.transitions<<"\t"
<<ct.transversions<<"\t"
<<ct.noDamage;
return os;
}
friend istream &operator>>(istream &is , DistResult &dr){
//cerr<<" op TEST"<<endl;
is
>>dr.all
>>dr.onlyCpg
>>dr.noCpg
>>dr.transitions
>>dr.transversions
>>dr.noDamage;
return is;
//return dsr.read(s);
}
};
#endif