-
Notifications
You must be signed in to change notification settings - Fork 294
Closed
Description
This is originally from biostars. If you try to set_tags() using a byte array then the following error is produced:
Traceback (most recent call last):
File "./foo.py", line 9, in <module>
read.set_tags(tags)
File "pysam/libcalignedsegment.pyx", line 2113, in pysam.libcalignedsegment.AlignedSegment.set_tags (pysam/libcalignedsegment.c:23066)
File "pysam/libcalignedsegment.pyx", line 295, in pysam.libcalignedsegment.packTags (pysam/libcalignedsegment.c:6217)
ValueError: invalid value type 'B' (<type 'str'>)
I'm attaching a very very small BAM file (it and the index are in the zip file) that can produce this error with the following code:
#!/usr/bin/env python
import pysam
bam = pysam.AlignmentFile("small.bam")
for read in bam.fetch():
tags = read.get_tags(with_value_type=True)
read.set_tags(tags)
I've tried earlier version (back to 0.8.4) and none of these are able to handle this sort of situation.
Metadata
Metadata
Assignees
Labels
No labels