pileup.js
pileup.js copied to clipboard
Create a class for mapping ranges to objects
It seems like this will be an incredibly common need for any tool that works with genomic data.
Examples:
- Mapping a range of loci to their nucleotides in the reference genome.
- A cache containing subsets of a remote file.
A class for this could do intelligent things like coalescing adjacent ranges, extracting subranges, etc.
This is known as an interval tree. There's a JavaScript implementation on NPM which I could either use directly or adapt for use with my Interval
class.