Skip to content

Commit

Permalink
Check if outfile
Browse files Browse the repository at this point in the history
  • Loading branch information
nriddiford committed Feb 14, 2018
1 parent 13df0d1 commit f3a28b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions svSupport/merge_bams.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def merge_bams(out_file, bams):

for bam_file in bams:
pysam.index(bam_file)

in_files = ', '.join(bams)
print("Merging bam files %s into '%s'") % (in_files, out_file)
merge_parameters = ['-f', out_file] + bams
Expand All @@ -15,4 +15,5 @@ def merge_bams(out_file, bams):
os.remove(bp_file)
os.remove(bp_file + ".bai")

pysam.index(out_file)
if out_file:
pysam.index(out_file)

0 comments on commit f3a28b7

Please sign in to comment.