forked from qtrinh/qpipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
73 lines (60 loc) · 1.63 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
//
// written by Quang M Trinh <[email protected]>
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
void txt_main (int argc, char *argv[]);
void fasta_main (int argc, char *argv[]);
void fastq_main (int argc, char *argv[]);
void tabix_main (int argc, char *argv[]);
void vcf_main (int argc, char *argv[]);
void bedtools_main (int argc, char *argv[]);
void ucsc_main (int argc, char *argv[]);
void math_main (int argc, char *argv[]);
/**
main usage
**/
void usage(int argc, char *argv[]) {
printf("\n\n");
printf("%s", AUTHORS );
printf("\nqpipeline is an annotation and a collection of utils for Next Gen Sequencing (NGS) data.");
printf("\n\nUsage:");
printf("\n\t%s txt\t", argv[0]);
printf("\n\t%s fasta\t", argv[0]);
printf("\n\t%s fastq\t", argv[0]);
printf("\n\t%s tabix\t", argv[0]);
printf("\n\t%s vcf\t", argv[0]);
printf("\n\t%s bedtools\t", argv[0]);
printf("\n\t%s ucsc \t", argv[0]);
printf("\n\t%s math\t", argv[0]);
printf("\n\n");
exit(0);
}
/**
main line
**/
int main(int argc, char *argv[]) {
if (argc == 1) {
usage(argc, argv);
}
if (strstr(argv[1], "txt") ) {
txt_main(argc, argv);
} else if (strstr(argv[1], "fasta") ) {
fasta_main(argc, argv);
} else if (strstr(argv[1], "fastq") ) {
fastq_main(argc, argv);
} else if (strstr(argv[1], "vcf") ) {
vcf_main(argc, argv);
} else if (strstr(argv[1], "tabix") ) {
tabix_main(argc, argv);
} else if (strstr(argv[1], "bedtools") ) {
bedtools_main(argc, argv);
} else if (strstr(argv[1], "ucsc") ) {
ucsc_main(argc, argv);
} else if (strstr(argv[1], "math") ) {
math_main(argc, argv);
}
return 0;
}