Merge pull request #12061 from bernt-matthias/topic/pysam-fix

[21.01] Fix pysam.view call
This commit is contained in:
Marius van den Beek
2021-05-28 21:47:55 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -184,12 +184,12 @@ def _bam_to_sam(local_name, temp_name):
temp_local = tempfile.NamedTemporaryFile(suffix='.sam', prefix='local_bam_converted_to_sam_')
with tempfile.NamedTemporaryFile(suffix='.sam', prefix='history_bam_converted_to_sam_', delete=False) as temp:
try:
pysam.view('-h', '-o%s' % temp_local.name, local_name)
pysam.view('-h', '--no-PG', '-o', temp_local.name, local_name, catch_stdout=False)
except Exception as e:
msg = "Converting local (test-data) BAM to SAM failed: %s" % unicodify(e)
raise Exception(msg)
try:
pysam.view('-h', '-o%s' % temp.name, temp_name)
pysam.view('-h', '--no-PG', '-o', temp.name, temp_name, catch_stdout=False)
except Exception as e:
msg = "Converting history BAM to SAM failed: %s" % unicodify(e)
raise Exception(msg)
+1 -1
View File
@@ -11,7 +11,7 @@ cat '$input1' > '$out_file1'
<tests>
<test>
<param name="input1" value="sam_with_header.sam" ftype="sam"/>
<output name="out_file1" file="bam_from_sam.bam"/>
<output name="out_file1" file="bam_from_sam.bam" ftype="bam"/>
</test>
</tests>
<help>