-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: quality and sequence mismatch: 98 != 97 #204
Comments
I am getting a very similar error too, which I think may be related to an issue matching the quality string and sequence string for mate pairs:
When I tried to look into this, I found it interesting that the lengths correspond to each read in a mate pair in a trans way. For example, in my original BAM, I have this read pair:
The first is 90 bases long and the second is 74, and the sequence length and quality length are correct. In the temporary mutation BAM that is being compared to the original BAM, I can see that the sequence strings look correct (i.e. the 5bp deletion I requested is in the correct location), the CIGAR is updated correctly, and the string lengths look correct:
So, I think that part is correct. I dug into
So, I'm wondering if the issue comes from this record being compared to the mate pair and since the lengths of the two mates are different, this is causing the issue. Does that seem possible or am I on the wrong track? Is this something that you've seen before and have a suggestion on how to fix? |
One more thing of note: it seems to be related to newer code in this repo. When I downgraded and pulled bamsurgeon==1.3 just now to test, it seems to work. So, is there a parity check that's either causing an issue here, or detecting an issue with my input BAM? |
Hmm, will try to make a mixed-length .bam for testing and report back. Thanks fot the details and debugging. |
This may have been related to #212, if still trying to use bamsurgeon let me know how you go with the latest updates. |
Hi, I'm have the same issue with both 1.4.1 and latest on the master branch. It does not happen with version 1.3, as mentioned above. |
Bamsurgeon downloaded 20/05/2022. Using pysam 0.19.0 py39h5030a8b_0 from bioconda. Below last log lines before crash. Inputing variants to ultradeep BAM file with mean x500
INFO 2022-05-20 02:16:51,517 secondary reads count:0
INFO 2022-05-20 02:16:51,517 supplementary reads count:0
INFO 2022-05-20 02:16:51,517 loaded 12686 reads, (0 excluded, 0 null or secondary or supplementary--> ignored)
Traceback (most recent call last):
File "/usr/local/source/bamsurgeon/bin/addsnv.py", line 479, in
run()
File "/usr/local/source/bamsurgeon/bin/addsnv.py", line 476, in run
main(args)
File "/usr/local/source/bamsurgeon/bin/addsnv.py", line 422, in main
rr.replace_reads(args.bamFileName, outbam_mutsfile, args.outBamFile, keepqual=True, seed=args.seed)
File "/usr/local/source/bamsurgeon/bin/bamsurgeon/replace_reads.py", line 165, in replace_reads
rdict[extqname].qual = read.qual
File "pysam/libcalignedsegment.pyx", line 2772, in pysam.libcalignedsegment.AlignedSegment.qual.set
File "pysam/libcalignedsegment.pyx", line 1514, in pysam.libcalignedsegment.AlignedSegment.query_qualities.set
ValueError: quality and sequence mismatch: 98 != 97
The text was updated successfully, but these errors were encountered: