Skip to content

Commit

Permalink
More information if b2w fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ozagordi committed Dec 6, 2012
1 parent a473a0a commit 5157d22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions b2w_src/b2w.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int main(int argc, char *argv[])
tmp.in = samopen(argv[optind], "rb", 0); //open bam file
if (tmp.in == 0) {
fprintf(stderr, "Failed to open BAM file %s\n", argv[optind]);
return 1;
return 2;
}

fai_build(argv[optind + 1]); //generate reference index
Expand All @@ -213,7 +213,7 @@ int main(int argc, char *argv[])
idx = bam_index_load(argv[optind]); //load bam index
if (idx == 0) {
fprintf(stderr, "BAM indexing file is not available.\n");
return 1;
return 3;
}

int32_t n;
Expand Down Expand Up @@ -267,7 +267,7 @@ int main(int argc, char *argv[])
bam_parse_region(tmp.in->header, argv[optind + 2], &ref, &tmp.b, &tmp.e);
if (ref < 0) {
fprintf(stderr, "Invalid region %s\n", argv[optind +2]);
return 1;
return 4;
}
tmp.b-=3*tmp.inc; //make sure start and end of region are covered by 3 windows
tmp.e+=3*tmp.inc;
Expand Down
2 changes: 1 addition & 1 deletion dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def windows(run_settings):

try:
retcode = subprocess.call(my_prog + my_arg, shell=True)
if retcode < 0:
if retcode > 0:
declog.error('%s %s' % (my_prog, my_arg))
declog.error('b2w returned %i' % retcode)
else:
Expand Down

0 comments on commit 5157d22

Please sign in to comment.