Entering edit mode
3.7 years ago
Good time! I have a bam file with reads from MNase seq. I am trying to write some reads to new empty file with this code:
bam_reader = HTSeq.BAM_Reader("in.bam")
bam_writer = HTSeq.BAM_Writer.from_BAM_Reader("/out.bam", bam_reader)
...
bam_writer.write(read)
But in my out file i receive such message:
" Error! out.bam is not UTF-8 encoded
Saving disabled.
See console for more details."
I'm very upset cause i can't see what's the problem, everything is okay with input data, the code i've find in HTSeq documentation. I'll be very grateful for someone who share an idea why such a mistake can happen.