Commit 1cf34d74 authored by Matthias Bernt's avatar Matthias Bernt
Browse files

psyam should not add a `@PG` headerline

i.e. leave the sam content of the bam file untouched
parent ecbce136
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', temp_local.name, local_name, catch_stdout=False)
            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', temp.name, temp_name, catch_stdout=False)
            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)