forked from aduong/Paradigm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpathwaytab2daifg.cpp
43 lines (34 loc) · 1.24 KB
/
pathwaytab2daifg.cpp
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
/********************************************************************************/
/* Copyright 2009-2011 -- The Regents of the University of California */
/* This code is provided for research purposes to scientists at non-profit */
/* organizations. All other use is strictly prohibited. For further */
/* details please contact University of California, Santa Cruz or */
/* Five3 Genomics, LLC (http://five3genomics.com). */
/********************************************************************************/
#include <fstream>
#include "pathwaytab.h"
void usage(int exit_code) {
cout << "pathwaytab2daifg"
#ifdef VERSION
<< " -- " << VERSION
#endif
<< endl
<< "Usage: " << endl
<< " pathwaytab2daifg pathway_file [config_file]"<< endl;
exit(exit_code);
}
int main(int argc, char** argv) {
if (argc != 2 && argc != 3) {
usage(2);
}
ifstream path_stream(argv[1]);
RunConfiguration c(argc == 3 ? argv[2] : "/dev/null");
PathwayTab path = PathwayTab::create(path_stream, c.pathwayProps());
vector< Factor > factors;
vector< MaximizationStep > msteps;
path.constructFactors(c.emSteps(), factors, msteps);
FactorGraph fg(factors);
path.printNodeMap();
cout << fg;
return 0;
}