Open dcopetti opened 4 years ago
Thanks for bringing this up. I also had a similar problem recently, which I found strange because I did have counterr
working previously.
The source of the error is the query_alignment_qualities
attribute of the pysam.AlignedSegment
object, which is part of pysam. query_alignment_qualities
is None
when there are no alignment qualities. However, I don't believe this is correct on the part of pysam
. When I look at the SAM file for my alignments, I can find the mapping qualities column just fine, but when I use
import pysam
f = pysam.AlignmentFile('ont-1.bam')
reads = f.fetch()
not_none = 0
for aln in reads:
if aln.query_alignment_qualities is not None:
not_none += 1
not_none
is 0. Not sure why that's happening.
Regardless, this should be fixed so the program doesn't altogether crash. I've created PR #7 to fix this issue, and it was just merged into master.
Keep in mind that this means that anything computed having to do with qualities won't be accurate if it's the case for you (as it is with me) that pysam
continues with this errant behavior. Sorry if what you were looking for was information on quality scores, but you should now be able to see all of the other plots that counterr
produces.
Hello,
I am running counterr to check the accuracy of ONT error-corrected reads as follows:
$ counterr -bam NecatEC_to_ref.bam -genome ../reference.fa -output_dir CMS281_Necat_to_p3 -lim 1000 -mapq_thres 10
and I get this error:This is how the output folder looks like:
The pdf file is corrupted and two of the three figures have all failed reads
The bam file was generated with minimap2, then filtered to remove unmapped, multimapped, and reads with supplementary alignments (
samtools view -F 2052 -F 256
).I wonder if it is an issue with the tool/installation or the dataset. Thanks,
Dario