Fix tests for samtools 1.x support

See #625
This commit is contained in:
Saket Choudhary
2015-10-06 16:53:13 -07:00
committed by peterjc
parent ab5915977b
commit 427872dd68
4 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,7 @@
"""Command line wrapper for samtools"""
# Last Checked with samtools [0.1.18 (r982:295)]
# Last Checked with samtools [0.1.20 and 1.2]
# TODO samtools 1.x has additional options over 0.x which
# are missing from this wrapper
from __future__ import print_function
__docformat__ = "restructuredtext en"

Binary file not shown.

Binary file not shown.

View File

@ -98,6 +98,12 @@ class SamtoolsTestCase(unittest.TestCase):
self.bamindexfile1 = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"SamBam",
"bam1.bam.bai")
self.sortedbamfile1 = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"SamBam",
"bam1_sorted.bam")
self.sortedbamfile2 = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"SamBam",
"bam2_sorted.bam")
self.files_to_clean = [self.referenceindexfile, self.bamindexfile1, self.outbamfile]
def tearDown(self):
@ -118,7 +124,7 @@ class SamtoolsTestCase(unittest.TestCase):
cmdline.set_parameter("S", True)
stdout_sam, stderr_sam = cmdline()
self.assertTrue(
stderr_sam.startswith("[samopen] SAM header is present:"),
stdout_sam.startswith("HWI-1KL120:88:D0LRBACXX:1:1101:1780:2146"),
"SAM file viewing failed:\n%s\nStderr:%s"
% (cmdline, stderr_sam))
@ -216,7 +222,7 @@ class SamtoolsTestCase(unittest.TestCase):
def test_mpileup_list(self):
cmdline = SamtoolsMpileupCommandline(samtools_exe)
cmdline.set_parameter("input_file", [self.bamfile1, self.bamfile2])
cmdline.set_parameter("input_file", [self.sortedbamfile1, self.sortedbamfile2])
stdout, stderr = cmdline()
self.assertFalse("[bam_pileup_core]" in stdout)