I'm using pysam 0.7.6 under Python 3.3.2.
I create a Samfile wich a custom header, like this:
refs = ['a','b','c']
s = pysam.Samfile('broken.bam', 'wb', referencenames=refs,
referencelengths=[100]*3)
The resulting header is malformed.
$ samtools view -H broken.bam
@SQ SN:b'a' LN:100
@SQ SN:b'b' LN:100
@SQ SN:b'c' LN:100
It should be:
@SQ SN:a LN:100
@SQ SN:b LN:100
@SQ SN:c LN:100
Those extra b'xxx' are introduced by the (implicit) conversion between bytes
and strings.
The attached patch provides a fix for this.
Original issue reported on code.google.com by gbrsa...@gmail.com on 6 Nov 2013 at 9:17
Original issue reported on code.google.com by
gbrsa...@gmail.com
on 6 Nov 2013 at 9:17Attachments: