forked from StephanePeyregne/ELS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modelprob.h
82 lines (67 loc) · 2.49 KB
/
modelprob.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
#ifndef MODELPROB_H
#define MODELPROB_H
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class probSegregDInternal
{
public:
probSegregDInternal();
void load(istream &in);
int getSize(void)
{
return probs.size();
};
void resize(int value)
{
probs.resize(value);
};
double getProb(int num_derived);
void setProbsAt(int index, double value);
string printAll(void);
private:
vector<double> probs; // probabilities: 0 is not used, $1 .. coverage-1$ is for derived alleles 1 to coverage-1.
size_t fixed_coverage; // used to check whether input-lines are wrong
};
class modelProb
{
public:
modelProb();
char loadProb(const char *fileName);
// clang-format off
void setStayInternal(double value) {mStayInternal = value;};
void setStayExternal(double value) {mStayExternal = value;};
void setStayLongExternal(double value) {mStayLongExternal = value;};
void setLErate(double value) {mLErate = value;};
void setProbFixDInternal(double value) {mProbFixDInternal = value;};
void setProbFixDExternal(double value) {mProbFixDExternal = value;};
void setProbSegregDExternal(double value) {mProbSegregDExternal = value;};
void setProbSegregDInternalAt(int i, double value) {obs.setProbsAt(i, value);};
void resizeProbSegregDInternal(int size) {obs.resize(size);};
int getSizeProbSegregDInternal(void) {return obs.getSize();};
probSegregDInternal getProbSegregDInternal(void) {return obs;};//read only access
double getStayInternal(void) {return mStayInternal;};
double getStayExternal(void) {return mStayExternal;};
double getStayLongExternal(void) {return mStayLongExternal;};
double getLErate(void) {return mLErate;};
double getProbFixDInternal(void) {return mProbFixDInternal;};
double getProbFixDExternal(void) {return mProbFixDExternal;};
double getProbSegregDExternal(void) {return mProbSegregDExternal;};
// clang-format on
protected:
probSegregDInternal obs;
// probSegregDInternal backup; //used only in the optimization step to get back to old values if the new ones are not better
double mStayInternal;
double mStayExternal;
double mStayLongExternal;
double mLErate;
double mProbFixDInternal;
double mProbFixDExternal;
double mProbSegregDExternal;
};
#endif // MODELPROB_H