def test_index(self): cmdline = SamtoolsIndexCommandline(samtools_exe) cmdline.set_parameter("input_bam", self.bamfile1) stdout, stderr = cmdline() self.assertFalse( stderr, f"Samtools index failed:\n{cmdline}\nStderr:{stderr}") self.assertTrue(os.path.exists(self.bamindexfile1))
def test_index_bam(variables): targetpath = os.path.join(variables.targetpath, 'bait') bam_index = SamtoolsIndexCommandline( input=os.path.join(targetpath, 'genesippr_sorted.bam')) bam_index() size = os.stat(os.path.join(targetpath, 'genesippr_sorted.bam.bai')) assert size.st_size > 0
def create_bam_index(self, input_bam): """Create index of an input bam file.""" cmdline = SamtoolsIndexCommandline(samtools_exe) cmdline.set_parameter("input_bam", input_bam) stdout, stderr = cmdline()