Skip to content
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

Mismatches show up as grey boxes in stead of the base that is the mismatch #516

Closed
thondeboer opened this issue Sep 29, 2014 · 3 comments
Closed

Comments

@thondeboer
Copy link

I have a BAM file that was created with BWA, 0.7.10 that contains MD tags, but the JBRowse 1.11.4 we have does not seem to show the bases in most cases. The reads has a MD tag (See second screenshot) and you can also see on the right side of the first screenshot that SOME reads DO show the mismatch...

Why does my read show a grey box?
NOTE: The read that is showing the SNP is in a read that is a supplementary read...Could that be the reason it does not render the read correctly?

image

image

@cmdcolin
Copy link
Contributor

Would you be able to export a small snippet of the BAM data with samtools view for testing? The sample data that's part of jbrowse doesn't appear to have supplementary alignments.

+Thanks for the report

@thondeboer
Copy link
Author

Here's the whole BAM file set...It's only 5 megs, so got you the whole file...
https://www.dropbox.com/s/pkog4087wo2v6s1/JBrowse.zip?dl=0

@cmdcolin
Copy link
Contributor

cmdcolin commented Oct 2, 2014

Thanks for sharing this. From what I can tell, JBrowse is using both the CIGAR and the MD string to call SNPs. To do so, it does some arithmatic on getTemplateCoord, but I think this arithmetic is doing the wrong thing in the case of hard clipping because in the case of hard clipping, the bases are actually removed from the template!

Proposed patch:

diff --git a/src/JBrowse/Store/SeqFeature/_MismatchesMixin.js b/src/JBrowse/Store/SeqFeature/_MismatchesMixin.js
index 72968a0..b59e54e 100644
--- a/src/JBrowse/Store/SeqFeature/_MismatchesMixin.js
+++ b/src/JBrowse/Store/SeqFeature/_MismatchesMixin.js
@@ -126,7 +126,7 @@ return declare( null, {
             for( var i = 0; i < cigarOps.length && refOffset <= refCoord ; i++ ) {
                 var op  = cigarOps[i][0];
                 var len = cigarOps[i][1];
-                if( op == 'H' || op == 'S' || op == 'I' ) {
+                if( op == 'S' || op == 'I' ) {
                     templateOffset += len;
                 }
                 else if( op == 'D' || op == 'N' || op == 'P' ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants