Skip to content

Commit

Permalink
Use exit codes from os package
Browse files Browse the repository at this point in the history
  • Loading branch information
Marghoob Mohiyuddin committed Mar 10, 2015
1 parent 558bc29 commit 7278089
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions breakseq2/breakseq_top.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def breakseq2_workflow(sample=None, bplib=None, bplib_gff=None, bwa=None, samtoo

if not bams:
func_logger.error("No BAMs specified so nothing to do")
return 1
return os.EX_NOINPUT

if not sample:
sample = infer_sample(bams[0])
Expand All @@ -71,7 +71,7 @@ def breakseq2_workflow(sample=None, bplib=None, bplib_gff=None, bwa=None, samtoo

if not bplib and not bplib_gff:
func_logger.error("Atleast one of the breakpoint FASTA or GFF must be specified")
return 1
return os.EX_USAGE

if bplib_gff:
# Generate bplib using the GFF file and use this for the main run
Expand All @@ -92,12 +92,12 @@ def breakseq2_workflow(sample=None, bplib=None, bplib_gff=None, bwa=None, samtoo

if not aligned_bams:
func_logger.warn("Read-extraction and alignment generated nothing")
return 0
return os.EX_OK

breakseq_core.breakseq_core(aligned_bams, "%s/breakseq.out" % work, min_span=min_span)
breakseq_post.generate_final_gff(["%s/breakseq.out" % work], "%s/breakseq.gff" % work)
compute_zygosity.compute_zygosity(bams, window, "%s/breakseq.gff" % work, "%s/breakseq_genotyped.gff" % work,
min_overlap)
gen_vcf.gff_to_vcf(reference, "%s/breakseq_genotyped.gff" % work, sample, "%s/breakseq.vcf" % work)

return 0
return os.EX_OK

0 comments on commit 7278089

Please sign in to comment.