]> git.donarmstrong.com Git - samtools.git/commitdiff
Adding a usage function to 'samtools depad' following 'samtools view' style
authorpeterjc <p.j.a.cock@googlemail.com>
Tue, 3 Apr 2012 10:51:41 +0000 (11:51 +0100)
committerpeterjc <p.j.a.cock@googlemail.com>
Tue, 19 Jun 2012 14:54:50 +0000 (15:54 +0100)
padding.c

index 6d97b1882a6f70ac6bca1d35f7b8217b0a02c926..a4066122833620e8a68abec0368458e096048d8b 100644 (file)
--- a/padding.c
+++ b/padding.c
@@ -175,14 +175,15 @@ int bam_pad2unpad(bamFile in, bamFile out)
        return 0;
 }
 
+static int usage(int is_long_help);
+
 int main_pad2unpad(int argc, char *argv[])
 {
        bamFile in, out;
+       int is_long_help = 1;
         int result=0;
        if (argc == 1) {
-               fprintf(stderr, "Usage: samtools depad <in.bam>\n");
-               fprintf(stderr, "\nRequires embedded reference sequences (before the reads for that reference).\n");
-               return 1;
+               return usage(is_long_help);
        }
        in = strcmp(argv[1], "-")? bam_open(argv[1], "r") : bam_dopen(fileno(stdin), "r");
        out = bam_dopen(fileno(stdout), "w");
@@ -190,3 +191,29 @@ int main_pad2unpad(int argc, char *argv[])
        bam_close(in); bam_close(out);
        return result;
 }
+
+static int usage(int is_long_help)
+{
+       fprintf(stderr, "\n");
+       fprintf(stderr, "Usage:   samtools depad <in.bam>\n\n");
+       fprintf(stderr, "Currently there are no optional arguments.\n");
+       //TODO - These are the arguments I think make sense to support:
+       //fprintf(stderr, "Usage:   samtools depad [options] <in.bam>|<in.sam>\n\n");
+       //fprintf(stderr, "Options: -b       output BAM\n");
+       //fprintf(stderr, "         -S       input is SAM\n");
+       //fprintf(stderr, "         -u       uncompressed BAM output (force -b)\n");
+       //fprintf(stderr, "         -1       fast compression (force -b)\n");
+       //fprintf(stderr, "         -@ INT   number of BAM compression threads [0]\n");
+       //fprintf(stderr, "         -T FILE  reference sequence file (force -S) [null]\n");
+       //fprintf(stderr, "         -o FILE  output file name [stdout]\n");
+       //fprintf(stderr, "         -?       longer help\n");
+       fprintf(stderr, "\n");
+       if (is_long_help)
+               fprintf(stderr, "Notes:\n\
+\n\
+  1. Requires embedded reference sequences (before the reads for that reference).\n\
+\n\
+  2. The input padded alignment read's CIGAR strings must not use P or I operators.\n\
+\n");
+        return 1;
+}