brittneybrinsfield / pysam

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

Creating a BAM from referencenames and referencelengths does not add a text header with SQ #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a bam file with reference names and lengths (as opposed to passing a 
raw text header or a template).
2. Notice that no text get's stored in the BAM's header (l_text is 0)
3 (optional). Have cufflinks crash because it expected to read the reference 
information from the @SQ lines in the header.

Now the BAM fileformat doesn't state whether the SAM compatible header is 
optional or not, or which takes precedence if there's a discrepancy in the 
redunancy, but I feel it's more sensible to add a correct SAM-header instead of 
changing cufflinks.
(samtools view -H does output a text header with @SQ lines - I guess it 
regenerates it from the reference names & lengths).

The good news is it's an easy fix - see attached patch :).

Best regards,
Florian

Original issue reported on code.google.com by finkerna...@mathematik.uni-marburg.de on 11 Nov 2011 at 2:18

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, fixed. The new behaviour can be turned off with add_sq_text = False

Original comment by andreas....@gmail.com on 6 Dec 2011 at 7:48

GoogleCodeExporter commented 9 years ago
[quote]The new behaviour can be turned off with add_sq_text = False[/quote]

If I read the diff correctly the docstring claims it is off by default though?
(Actual def is correct)

Original comment by finkerna...@mathematik.uni-marburg.de on 6 Dec 2011 at 9:44