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