Unverified Commit ae3c49a0 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

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

[21.01] Fix pysam.view call
parents 572584cb 01eba8ee
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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>