Skip to content

Commit

Permalink
samtools sort 1.3 require to specify output file using '-o' option
Browse files Browse the repository at this point in the history
  • Loading branch information
iromeo committed Feb 1, 2016
1 parent c45210d commit 0a1703b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bwameth.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ def as_bam(pfile, fa, prefix, calmd=False, set_as_failed=None):
set_as_failed: None, 'f', or 'r'. If 'f'. Reads mapping to that strand
are given the sam flag of a failed QC alignment (0x200).
"""
view = "samtools view -bS - | samtools sort -m 2415919104 - -T "
view = "samtools view -bS - | samtools sort -m 2415919104 - -T {bam} -o "
if calmd:
cmds = [
view + "{bam}.tmp",
"samtools calmd -AbEr {bam}.tmp.bam {fa} > {bam}.bam 2>/dev/null",
"rm {bam}.tmp.bam"]
else:
cmds = [view + "{bam}"]
cmds = [view + "{bam}.bam"]

cmds.append("samtools index {bam}.bam")
cmds = [c.format(bam=prefix, fa=fa) for c in cmds]
Expand Down

0 comments on commit 0a1703b

Please sign in to comment.