From 04918d98eb2214f79767a07826e203e26d555c7a Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Fri, 29 Jan 2016 21:27:24 +0300 Subject: [PATCH 1/2] prefix arg was deprecated and completely removed in samtools sort 1.3, so let's use '-T' option for it (cherry picked from commit c45210d) --- bwameth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bwameth.py b/bwameth.py index f986007..8aa147b 100755 --- a/bwameth.py +++ b/bwameth.py @@ -271,7 +271,7 @@ 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 - " + view = "samtools view -bS - | samtools sort -m 2415919104 - -T " if calmd: cmds = [ view + "{bam}.tmp", From 1780b5069e20b0665fc666bc16e3929138357022 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Mon, 1 Feb 2016 14:02:48 +0300 Subject: [PATCH 2/2] samtools sort 1.3 require to specify output file using '-o' option (cherry picked from commit 0a1703b) --- bwameth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bwameth.py b/bwameth.py index 8aa147b..824b24e 100755 --- a/bwameth.py +++ b/bwameth.py @@ -271,14 +271,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]