From: Heng Li Date: Sat, 13 Jun 2009 13:06:24 +0000 (+0000) Subject: added more comments X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0b57d1b361fd43fbf21923faf2e62a375a30a1df;hp=f35ebaef9ed8e8e545280df1e92928987135dcca;p=samtools.git added more comments --- diff --git a/examples/calDepth.c b/examples/calDepth.c index 6a4be14..7a3239c 100644 --- a/examples/calDepth.c +++ b/examples/calDepth.c @@ -35,25 +35,25 @@ int main(int argc, char *argv[]) fprintf(stderr, "Fail to open BAM file %s\n", argv[1]); return 1; } - if (argc == 2) { + if (argc == 2) { // if a region is not specified sampileup(tmp.in, -1, pileup_func, &tmp); } else { int ref; bam_index_t *idx; bam_plbuf_t *buf; - idx = bam_index_load(argv[1]); + idx = bam_index_load(argv[1]); // load BAM index if (idx == 0) { fprintf(stderr, "BAM indexing file is not available.\n"); return 1; } - bam_parse_region(tmp.in->header, argv[2], &ref, &tmp.beg, &tmp.end); + bam_parse_region(tmp.in->header, argv[2], &ref, &tmp.beg, &tmp.end); // parse the region if (ref < 0) { fprintf(stderr, "Invalid region %s\n", argv[2]); return 1; } - buf = bam_plbuf_init(pileup_func, &tmp); + buf = bam_plbuf_init(pileup_func, &tmp); // initialize pileup bam_fetch(tmp.in->x.bam, idx, ref, tmp.beg, tmp.end, buf, fetch_func); - bam_plbuf_push(0, buf); + bam_plbuf_push(0, buf); // finalize pileup bam_index_destroy(idx); bam_plbuf_destroy(buf); }