lixin6135 / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

Samfile does not write header to SAM output when template or header kwargs supplied #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. sam_f = Samfile("out.sam","w",template=another_sam_f) or
   sam_f = Samfile("out.sam","w",header=header_dict)
2. sam_f.write(record)

What is the expected output? What do you see instead?
When template or header is supplied, a header should be printed to the SAM 
file.  No header is written when using mode="w", but is when mode="wh".  
Intuitively, header should be printed transparently when passed as an argument 
to the constructor or made required (as it is required for parsing SAM files).

What version of the product are you using? On what operating system?
pysam-0.5
Python 2.6.5
Distributor ID: Ubuntu
Description:    Ubuntu 8.04.4 LTS

Please provide any additional information below.
The SAM specifies that header rows are optional but pysam requires them for 
parsing SAM formatted files.  That's how I discovered this issue.

Original issue reported on code.google.com by alabad...@gmail.com on 8 Jun 2011 at 1:37

GoogleCodeExporter commented 8 years ago
Thanks. However, the flags mirror the C-API and I am reluctant to change this.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 19 Oct 2011 at 8:58