-
Notifications
You must be signed in to change notification settings - Fork 9
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
Optimize the seqFetch for sparse CRAM file #79
Comments
Xref issue with sample data igvteam/igv.js#1212 |
could we address this by changing how we call the sequence-fetching callback? perhaps fetching only up to a maximum size, and tiling somehow from there, so the whole sequence is not kept in memory? |
@rbuels You are surely among the handful of people who know the details of CRAM, but I imagine that would be very complex. Perhaps it would solve the out-of-memory error, but would be so slow as to cause the user think the browser has frozen. I did see this option in samtools (to store the reference sequence in the CRAM), it could be recommended to users with sparse CRAM files, since they are likely to be small anyway, but I don't know if cram.js supports such files
|
Ran into this with office hours today They had Sparse CRAM files and the chain of events was:
|
there is a thing in http-range-fetcher the chunkSize being some maximum https://github.com/rbuels/http-range-fetcher/blob/master/src/httpRangeFetcher.ts but i wonder if it is still merging beyond that...not sure. the thing they observed was very large chromosome-wide byte range requests for their sequences their JBrowse |
@cmdcolin This seems to still be happening after trying bam files instead of crams:
From the server:
I'm not sure why it's still fetching the large reference interval even with bams? |
@cedarwarman i can verify that there is a reason unrelated to this issue where the entire sequence gets requested. it was added actually somewhat recently in jbrowse, basically to help with showing the 'reference sequence base' on snpcoverage mouseover I will ponder whether there is a way to help with this |
Thanks for the update! |
@cedarwarman if you want to try out a beta branch of JBrowse with a proposed fix (i'll probably just get it merged here and released) you can try out the branch with e.g.
I am gonna get this out in the next release pretty shortly as well |
(linked PR GMOD/jbrowse-components#4708) |
I found another code path in the pileup (second loading bar) doing the same thing and applied a patch that hopefully can help there! |
Amazing, thanks for your help on this! |
both fixes now released in v2.18.0 if you want to try that out. thanks for reporting this! |
Looks like it's working! |
@jrobinso Reported that a CRAM file with very few reads could take longer than expected because it ended up fetching the entire chromosome
The text was updated successfully, but these errors were encountered: