annotate src/sickle.c @ 13:b105c7163a5b draft default tip

Deleted selected files
author nikhil-joshi
date Sat, 14 Mar 2015 18:29:47 -0400
parents c70137414dcd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
1 #include <assert.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
2 #include <ctype.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
3 #include <stdlib.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
4 #include <limits.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
5 #include <zlib.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
6 #include <stdio.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
7 #include <getopt.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
8 #include <string.h>
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
9 #include "sickle.h"
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
10
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
11 void main_usage (int status) {
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
12
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
13 fprintf (stdout, "\nUsage: %s <command> [options]\n\
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
14 \n\
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
15 Command:\n\
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
16 pe\tpaired-end sequence trimming\n\
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
17 se\tsingle-end sequence trimming\n\
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
18 \n\
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
19 --help, display this help and exit\n\
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
20 --version, output version information and exit\n\n", PROGRAM_NAME);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
21
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
22 exit (status);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
23 }
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
24
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
25 int main (int argc, char *argv[]) {
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
26 int retval=0;
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
27
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
28 if (argc < 2 || (strcmp (argv[1],"pe") != 0 && strcmp (argv[1],"se") != 0 && strcmp (argv[1],"--version") != 0 && strcmp (argv[1],"--help") != 0)) {
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
29 main_usage (EXIT_FAILURE);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
30 }
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
31
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
32 if (strcmp (argv[1],"--version") == 0) {
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
33 fprintf(stdout, "%s version %0.2f\nCopyright (c) 2011 The Regents of University of California, Davis Campus.\n%s is free software and comes with ABSOLUTELY NO WARRANTY.\nDistributed under the MIT License.\n\nWritten by %s\n", PROGRAM_NAME, VERSION, PROGRAM_NAME, AUTHORS);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
34
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
35 exit (EXIT_SUCCESS);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
36
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
37 }
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
38
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
39 else if (strcmp (argv[1],"--help") == 0) {
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
40 main_usage (EXIT_SUCCESS);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
41 }
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
42
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
43 else if (strcmp (argv[1],"pe") == 0) {
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
44 retval = paired_main (argc, argv);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
45 return (retval);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
46 }
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
47
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
48 else if (strcmp (argv[1],"se") == 0) {
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
49 retval = single_main (argc, argv);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
50 return (retval);
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
51 }
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
52
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
53 return 0;
c70137414dcd sickle v1.33
nikhil-joshi
parents:
diff changeset
54 }