-
Notifications
You must be signed in to change notification settings - Fork 421
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
Strange alignment (and seemingly incorrect score) for ONT cDNA alignment #1257
Comments
If the sequences between two anchors can't be aligned well, the score can be negative. This is expected. |
Thanks Heng, One more related query if it's not too much trouble. I can't seem to get to -19 using the CIGAR string, using the default match, mismatch, and gap penalties listed in the manpage. Is the gap cost gap open + (gap len * gap extend) (which seems to underestimate the score) or gap open + ((gap len - 1) * gap extend) (which seems to overestimate the score)? Thanks, |
It is open+len*ext. Nonetheless, the longest gap length is 86. This will trigger the dual gap penalty. |
Thank you, @lh3! I can confirm that I, in fact, get the appropriate score (-19) when properly accounting for the dual gap penalty. While I realize that you're not in anyway affiliated with Specifically,
Do you have any idea why Edit: Additionally, I observe the same behavior (only 2 mappings) if I map the read using |
The other two alignments are secondary. |
Hi Heng, But is there a reason they would not be reported? Is there a way I can get them (via mappy, or minimap2-lite, or via minimap2 as a library more generally)? I am not interested in supplementary alignments in this case (though I am getting one), but do want secondary alignments. In mappy and minimap2-rs I am requesting up to 100 alignments for each query. |
What is your mappy script? |
Note you added |
Hi Heng, My mappy script is very minimal:
Where, above the |
Hi @lh3, Thanks for your help on this. I debugged it a bit more and I discovered that the differences here are due to the fact that both This accounts for the issue I was observing. In order to allow matching the output of command-line Thanks! |
Closing as #1260 has been merged. |
Hi Heng,
I was trying to track down a number of small differences I encounter between standard alignment using
minimap2
and using theminimap2-rs
crate in ouroarfish
tool. My working assumption is that command-lineminimap2
is the "ground truth", and so any differences are strange (sinceminimap2-rs
just calls tominimap2
as a library).Anyway, I found a minimal reproducible example, and when I investigated, much to my surprise, I can't even really understand the
minimap2
output itself. I'm aligning against a transcriptome reference (which can be obtained here). A file containing the read is here.I map with the following command:
then, if I look at the resulting
bam
file, I get:While there may be several strange things, it's the first alignment that most confuses me (the one marked as primary)
The alignment score is
-19
. Inminimap2-rs
this shows up asu32::MAX - 18
because the score is treated as an unsigned integer when it is returned (which obviously is not right). However, I don't see how the reported score of-19
makes sense here. If I process the CIGAR string itself, I get a much higher score.Any thoughts about why the reported alignment score is what it is, or how to fix this? Seemingly, an alignment with a score of
-19
shouldn't even be reported in this context.Thanks!
Rob
The text was updated successfully, but these errors were encountered: