forked from OSU-BMBL/metaqubic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
71 lines (61 loc) · 1.57 KB
/
main.c
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
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "step.h"
int isDirExist(const char * DirectoryPath);
int main(const int argc, const char ** argv)
{
strcat(install_path, "/tool/");
// insert tool path to the argv[1]
if (isDirExist(install_path) == 0)
{
printf("ERROR - Tool path is invalid: %s\n", install_path);
exit(0);
}
if(strcmp(argv[1], "--mapping") == 0)
{
printf("step 1 (Gene mapping and pairing) is processing.\n");
step1(argc, &argv[2]);
}
else if(strcmp(argv[1], "--CatToMat") == 0)
{
printf("step 2 (merge catalog to the matrix) is processing.\n");
step2(argc, &argv[2]);
}
else if(strcmp(argv[1], "--filtering") == 0)
{
printf("step 3 (TPM normalizationa dn filtering) is processing.\n");
step3(argc, &argv[2]);
}
else if(strcmp(argv[2], "--biclustering") == 0)
{
printf("step 4 (biclustering) is processing.\n");
step4(argc, &argv[2]);
}
else if(strcmp(argv[1], "--enrichment") == 0)
{
printf("step 5 (enrichment analysis) is processing.\n");
step5(argc, &argv[2]);
}
else
{
printf("wrong arguments\n");
}
}
int isDirExist(const char * DirectoryPath)
{
DIR *dir;
struct dirent *ent;
if ((dir = opendir (DirectoryPath)) != NULL)
{
/* print all the files and directories within directory */
closedir (dir);
return 1;
}
else
{
/* could not open directory */
return 0;
}
}