0
|
1 #include <stdio.h>
|
|
2 #include <string.h>
|
|
3 #include "main.h"
|
|
4
|
|
5 #ifndef PACKAGE_VERSION
|
|
6 #define PACKAGE_VERSION "0.5.7 (r1310)"
|
|
7 #endif
|
|
8
|
|
9 static int usage()
|
|
10 {
|
|
11 fprintf(stderr, "\n");
|
|
12 fprintf(stderr, "Program: bwa (alignment via Burrows-Wheeler transformation)\n");
|
|
13 fprintf(stderr, "Version: %s\n", PACKAGE_VERSION);
|
|
14 fprintf(stderr, "Contact: Heng Li <lh3@sanger.ac.uk>\n\n");
|
|
15 fprintf(stderr, "Usage: bwa <command> [options]\n\n");
|
|
16 fprintf(stderr, "Command: index index sequences in the FASTA format\n");
|
|
17 fprintf(stderr, " aln gapped/ungapped alignment\n");
|
|
18 fprintf(stderr, " samse generate alignment (single ended)\n");
|
|
19 fprintf(stderr, " sampe generate alignment (paired ended)\n");
|
|
20 fprintf(stderr, " bwasw BWA-SW for long queries\n");
|
|
21 fprintf(stderr, "\n");
|
|
22 fprintf(stderr, " fa2pac convert FASTA to PAC format\n");
|
|
23 fprintf(stderr, " pac2bwt generate BWT from PAC\n");
|
|
24 fprintf(stderr, " pac2bwtgen alternative algorithm for generating BWT\n");
|
|
25 fprintf(stderr, " bwtupdate update .bwt to the new format\n");
|
|
26 fprintf(stderr, " pac_rev generate reverse PAC\n");
|
|
27 fprintf(stderr, " bwt2sa generate SA from BWT and Occ\n");
|
|
28 fprintf(stderr, " pac2cspac convert PAC to color-space PAC\n");
|
|
29 fprintf(stderr, " stdsw standard SW/NW alignment\n");
|
|
30 fprintf(stderr, "\n");
|
|
31 return 1;
|
|
32 }
|
|
33
|
|
34 int main(int argc, char *argv[])
|
|
35 {
|
|
36 if (argc < 2) return usage();
|
|
37 if (strcmp(argv[1], "fa2pac") == 0) return bwa_fa2pac(argc-1, argv+1);
|
|
38 else if (strcmp(argv[1], "pac2bwt") == 0) return bwa_pac2bwt(argc-1, argv+1);
|
|
39 else if (strcmp(argv[1], "pac2bwtgen") == 0) return bwt_bwtgen_main(argc-1, argv+1);
|
|
40 else if (strcmp(argv[1], "bwtupdate") == 0) return bwa_bwtupdate(argc-1, argv+1);
|
|
41 else if (strcmp(argv[1], "pac_rev") == 0) return bwa_pac_rev(argc-1, argv+1);
|
|
42 else if (strcmp(argv[1], "bwt2sa") == 0) return bwa_bwt2sa(argc-1, argv+1);
|
|
43 else if (strcmp(argv[1], "index") == 0) return bwa_index(argc-1, argv+1);
|
|
44 else if (strcmp(argv[1], "aln") == 0) return bwa_aln(argc-1, argv+1);
|
|
45 else if (strcmp(argv[1], "sw") == 0) return bwa_stdsw(argc-1, argv+1);
|
|
46 else if (strcmp(argv[1], "samse") == 0) return bwa_sai2sam_se(argc-1, argv+1);
|
|
47 else if (strcmp(argv[1], "sampe") == 0) return bwa_sai2sam_pe(argc-1, argv+1);
|
|
48 else if (strcmp(argv[1], "pac2cspac") == 0) return bwa_pac2cspac(argc-1, argv+1);
|
|
49 else if (strcmp(argv[1], "stdsw") == 0) return bwa_stdsw(argc-1, argv+1);
|
|
50 else if (strcmp(argv[1], "bwtsw2") == 0) return bwa_bwtsw2(argc-1, argv+1);
|
|
51 else if (strcmp(argv[1], "dbwtsw") == 0) return bwa_bwtsw2(argc-1, argv+1);
|
|
52 else if (strcmp(argv[1], "bwasw") == 0) return bwa_bwtsw2(argc-1, argv+1);
|
|
53 else {
|
|
54 fprintf(stderr, "[main] unrecognized command '%s'\n", argv[1]);
|
|
55 return 1;
|
|
56 }
|
|
57 return 0;
|
|
58 }
|