-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathParam.h
84 lines (77 loc) · 2.38 KB
/
Param.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
#ifndef __PARAM__
#define __PARAM__
#include <cstdio>
#include <fstream>
#include <string>
#include "Utility.h"
using namespace std;
struct Param {
string geneInfo;
vector<string> profiles;
string clinical;
string method;
string outpath;
string measure;
int maxPerm;
double alpha;
double distLo, distHi;
int nbins;
Param(int argv, char *argc[]) {
distLo = 0.0;
distHi = 1.0;
nbins = 30;
maxPerm = 30;
outpath = "output\\";
measure = "omi";
for( int i = 1 ; i < argv ; ++i ) {
if( strcmp( argc[i], "-s") == 0 ) {
geneInfo = argc[++i];
}
else if( strcmp( argc[i], "-ip") == 0 ) {
profiles.push_back(argc[++i]);
}
else if( strcmp( argc[i], "-io") == 0 ) {
clinical = argc[++i];
}
else if( strcmp( argc[i], "-o") == 0 ) {
outpath = argc[++i];
}
else if( strcmp(argc[i], "-perm") == 0 ) {
sscanf(argc[++i], "%d", &maxPerm);
}
else if( strcmp(argc[i], "-alpha") == 0 ) {
sscanf(argc[++i], "%lf", &alpha);
}
else if( strcmp(argc[i], "-dlo") == 0 ) {
sscanf(argc[++i], "%lf", &distLo);
}
else if( strcmp(argc[i], "-dhi") == 0 ) {
sscanf(argc[++i], "%lf", &distHi);
}
else if( strcmp(argc[i], "-dbin") == 0 ) {
sscanf(argc[++i], "%d", &nbins);
}
else if( strcmp(argc[i],"dist") == 0 || strcmp(argc[i],"network") == 0 ) {
method = argc[i];
}
else if( strcmp(argc[i], "-m") == 0 ) {
measure = argc[++i];
}
else {
errorMsg( string(argc[i]) + " is not a valid parameter" );
}
}
}
void getParamInfo( ostream &out ) {
out << "Informations" << endl;
out << "Start time : " << currentDateTime() << endl;
out << "method : " << method << endl;
out << "geneInfo : " << geneInfo << endl;
out << "profiles : " << join( profiles, "," ) << endl;
out << "clinical : " << clinical << endl;
out << "maxPerm : " << maxPerm << endl;
out << "alpha :" << alpha << endl;
out << "outpath : " << outpath << endl;
}
};
#endif