Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
105 lines (94 loc) · 4.16 KB
/
Copy pathmain.cpp
File metadata and controls
105 lines (94 loc) · 4.16 KB
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
97
98
99
100
101
102
103
104
105
// $Id: main.cpp 29 2012-01-04 17:06:55Z jbao $
//#include <cstdlib>
//#include "logging/logging.h"
//using namespace ::logging;
#include <sstream>
#include <iostream>
#include "getopt_pp.h"
#include "GnwSettings.h"
#include "GeneNetwork.h"
#include "BenchmarkGenerator.h"
using namespace GetOpt;
int main(int argc, char **argv) {
GetOpt_pp ops(argc, argv);
std::string outdir, indir, type;
int nid, size, perturb;
double lower, upper;
ops >> Option('o', "out-dir", outdir);
ops >> Option('i', "in-dir", indir);
ops >> Option('t', "type", type);
ops >> Option('n', "network-id", nid);
ops >> Option('s', "size", size);
ops >> Option('p', "perturbation", perturb);
//int i = 0;
//char *task = getenv("SGE_TASK_ID");
//if (task != NULL)
// i = atoi(task) - 1;
//lower = i / 10.0;
//upper = (i + 1) / 10.0;
int i = perturb - 1;
//std::string type = "ecoli";
//std::string wd = "/Users/bao/work/DREAM/DREAM3_in_silico_challenge/Size100/gnw/prune/";
//std::string wd = "/export/work/jbao/data/DREAM/gnw/" + type +
// "/gnw/full/";
//std::string wd = "/home/jbao/data/DREAM/gnw/scalefree/gnw/Size1000/";
GnwSettings::Instance()->setPerturbationNumber(i + 1);
GnwSettings::Instance()->setRandomSeed(42);
GnwSettings::Instance()->setOutputDirectory(outdir);
GnwSettings::Instance()->setModelTranslation(false);
GnwSettings::Instance()->generateTsMultifactorial(true);
GnwSettings::Instance()->generateTsConstantInput(false);
GnwSettings::Instance()->setAddMicroarrayNoise(false);
GnwSettings::Instance()->setNumTimeSeries(1);
GnwSettings::Instance()->setMaxtTimeSeries(200);
GnwSettings::Instance()->setDt(10);
GnwSettings::Instance()->setMaxtSteadyStateODE(500);
//GnwSettings::Instance()->setRelativePrecision(0);
GnwSettings::Instance()->setPerturbationFraction(0.8, 1);
GeneNetwork *net = new GeneNetwork();
//net->load("/Users/bao/work/DREAM/DREAM3_in_silico_challenge/Size100/Networks/InSilicoSize100-Ecoli1.tsv", GeneNetwork::TSV);
//net->load("/home/jbao/data/DREAM/DREAM3/prune/Size1000/InSilicoSize1000-Ecoli1.tsv", GeneNetwork::TSV);
//net->load("/home/jbao/data/DREAM/gnw/ecoli/gnw/Size1000/default/ecoli-1_goldstandard_signed.tsv", GeneNetwork::TSV);
std::stringstream ss, ssn, sssize;
ss << i + 1;
ssn << nid;
sssize << size;
std::string filename = indir + type + "-" + ssn.str() + "_" + sssize.str() +
".tsv";
//std::string filename = indir + "ecoli_transcriptional_network_regulonDB_6_2.tsv";
//std::string filename = indir + "yeast_transcriptional_network_Balaji2006.tsv";
//std::string filename = indir + "ecoli-full.xml";
//std::string filename = indir + type + "-" + ss.str() + "_" + sssize.str() +
// "_" + ssn.str() + ".xml";
net->load(filename.c_str(), GeneNetwork::TSV);
net->randomInitialization();
net->sanityCheck();
//net->load("/Users/bao/work/DREAM/gnw/ecoli/gnw/Size1000/default/rewiring/ecoli-1_1000_0.xml", GeneNetwork::SBML);
//net->load("/Users/bao/work/DREAM/DREAM3_in_silico_challenge/Size100/gnw/prune/full.xml", GeneNetwork::SBML);
//net->setRank("/Users/bao/work/DREAM/DREAM3_in_silico_challenge/Size100/gnw/mds/ranked_ecoli1_100");
//net->setRank("/home/jbao/data/DREAM/DREAM3/prune/ranked_ecoli1_100");
//std::vector<HillGene> all_nodes = net->getNodes();
//for (int i = 0; i < res.size(); ++i) {
// GeneNetwork n = GeneNetwork(*net);
//std::vector<HillGene> toPrune;
//toPrune.push_back(all_nodes.at(i));
//net->prune(toPrune);
//std::stringstream ss;
//ss << i + 1;
//net->setId(type + "-" + ss.str() + "_" + ssn.str());
net->setId(type + "-" + ssn.str());
//net->setId(type + "-full");
//for (std::vector< std::pair<std::string,int> >::iterator it = net->outDegreesVec.begin();
// it != net->outDegreesVec.end(); ++it)
// std::cerr << it->first << " " << it->second << std::endl;
GnwSettings::Instance()->setRandomSeed(i);
//for (int ii = 0; ii < i; ++ii)
// int tmp = GnwSettings::Instance()->getNormalDistributionNumber(0, 1);
BenchmarkGenerator *bg = new BenchmarkGenerator(*net);
bg->generateGoldStandard();
delete bg;
//}
delete net;
//delete bg;
return 0;
}