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

Optimize BAM parsing #74

Merged
merged 5 commits into from
Apr 16, 2015
Merged

Optimize BAM parsing #74

merged 5 commits into from
Apr 16, 2015

Conversation

danvk
Copy link
Collaborator

@danvk danvk commented Apr 16, 2015

This speeds up BamFile.getAlignmentsInRange in a few ways:

  • Filters reads as it parses them to reduce memory overhead & bail out more quickly.
  • Introduces a SamRead class for lazy parsing and type safety (Fixes Create a SAMRead class #71)
  • Reads SamReads directly using ArrayBuffer, bypassing the jBinary overhead.

The latter optimization is particularly effective. Overall the "should fetch from a large, dense BAM file" test case went from taking ~1450ms/run on my machine to taking ~550ms/run.

See #26

Review on Reviewable

danvk added a commit that referenced this pull request Apr 16, 2015
@danvk danvk merged commit cdb2e66 into master Apr 16, 2015
@danvk danvk deleted the optimize-bam branch June 22, 2015 16:20
Georgehe4 pushed a commit to Georgehe4/pileup.js that referenced this pull request Apr 28, 2017
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

Successfully merging this pull request may close these issues.

Create a SAMRead class
1 participant