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

Fetch alignments from BAM files using a BAI index #66

Merged
merged 9 commits into from
Apr 3, 2015
Merged

Conversation

danvk
Copy link
Collaborator

@danvk danvk commented Apr 3, 2015

Highlights:

  • A few jBinary helpers (uint64native, lazyArray) which aren't being extensively used now, but might be in the future.
  • A parser for BAI files
  • JavaScript to compute index chunks from a BAI file. This will make supporting side sources of index chunks (i.e. .bam.bai.json files) a cinch in the future.
  • A VirtualOffset class to represent "virtual offsets" into BAM files. These pack offsets into the compressed BAM file & the inflated block into uint64s. But those are hard to work with in JS, hence a wrapper.
  • Methods to map contig index ↔ contig name for BAM files
  • Methods to fetch & parse subsets of a BAM file

And, of course, an implementation of the indexed lookup algorithm. I wound up basing my tests & implementation on htsjdk, which is significantly easier to follow & play with than the canonical C version.

Review on Reviewable

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.01%) to 92.35% when pulling da0fe83 on bai-parser into ddbaf5d on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.31%) to 93.05% when pulling 8237e92 on bai-parser into ddbaf5d on master.

danvk added a commit that referenced this pull request Apr 3, 2015
Fetch alignments from BAM files using a BAI index
@danvk danvk merged commit 5c0a352 into master Apr 3, 2015
@danvk danvk mentioned this pull request Apr 14, 2015
@danvk danvk deleted the bai-parser branch June 22, 2015 16:19
Georgehe4 pushed a commit to Georgehe4/pileup.js that referenced this pull request Apr 28, 2017
[MANGO-16] Uses bam indexing support from adam #732
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.

None yet

2 participants