-
Notifications
You must be signed in to change notification settings - Fork 40
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
Read alignment off by one after primer trimming #36
Comments
Hey Peter, thank you for bringing this to my attention. This is a bug that occurs if there is a deletion at the final position of the primer sequence. I patched this and I'm writing a few tests to account for it. I will release a version by EOD. |
Awesome! Thanks for fixing it so quickly! |
I just released v1.2.1 that should fix this. Could you please run it and let me know if it works as expected? I can then close this issue. Thanks! |
Hi @gkarthik I get the following error when trying to compile 1.2.1
I am able to compile iVar 1.2 from source with no issues. |
For some reason, I'm unable to reproduce this error with gcc If you could also send me your compiler version that would help. Looks like its compiler dependent but I'm unable to isolate the issue. Thanks! |
Hi @gkarthik I fixed the issue I had compiling with gcc v9.3.0 in #37, however, I am still encountering some cases where the read seems to be shifted. For example, here's the information from Tablet for a read that seems to have been shifted over: Before:
After:
Another example: Before:
After:
Unfortunately, it looks like there are still a number of reads that have been shifted resulting in misalignments. |
@peterk87 This issue turned out to be more complicated. Because the reads are unpaired, the reads were being trimmed only on one end. I just pushed code to trim unpaired reads on both ends (fwd and rev primer). I also fixed the issues with deletions right after primer position. Could you please pull the master branch and see if it works on your dataset? I want to make sure it works on your data before creating a new release. Thank you! |
Thanks @gkarthik It looks like the issue is fixed as of 72b35e6. Primer sequences are trimmed in the read alignments without any visible issues! I have been comparing the results from iVar with those from the ARTIC pipeline trim_align.py script and the results are comparable. I appreciate that iVar doesn't discard a lot of the potentially informative reads in low coverage regions as the trim_align.py script does. It's also very nice that iVar is much faster than the Python script. |
Fantastic! Thank you for raising this issue. Helped me work through a few other things too. I'm adding another feature to create bcf reports for consensus today and will create a release. I think with the ability to trim unpaired reads, |
Thanks @gkarthik! I'm glad you were able to fix it so quickly! I've been setting the quality trimming threshold very low for my data. The Flongle seems to produce lower quality scores than the MinION. Looking forward to the new bcf report feature! |
Describe the bug
Some read alignments are shifted after
ivar trim
(v1.2) compared to untrimmed read alignments from Minimap2 (v2.17-r941) and NGMLR (v0.2.7).To Reproduce
I aligned the Nanopore reads to the reference genome (MN908947.3) with Minimap2 (and NGMLR), trimmed primer sequences and low quality bases
Note: for some reason many of the reads had very low average quality scores for this run and we were mostly interested in trimming the primer sequences.
I viewed and compared alignments in IGV (v2.8.2 installed from BioConda) and noticed some big differences between the untrimmed and trimmed alignments of some reads in certain regions.
Top alignment is untrimmed Minimap2 and bottom is iVar trimmed alignment:
For example, here's the same read at position MN908947.3:29,383 where in the original alignment the base is G (QV=27) and in the trimmed alignment the base is A (QV=11):
Before
ivar trim
read alignment information in IGVAfter
ivar trim
It looks like the iVar trimmed alignment has been shifted when I zoom in on the read in both untrimmed and trimmed alignments:
Note that the position is incremented by 1 in the trimmed read alignment relative to the untrimmed alignment.
Expected behavior
I expected that the alignments should remain the same aside from primer and quality trimming.
Workstation:
Additional context
Conda env YAML (
$ conda env export
) for running iVar, Minimap2, NGMLR and samtools:The text was updated successfully, but these errors were encountered: