gosling.js
gosling.js copied to clipboard
Support for Tabixed BED
Given that BED files are very common, we need to support Tabixed BED as well.
Reference
- https://github.com/GMOD/jbrowse-components/tree/4a35910bd2759ae5aa6174a15498953ff3e17f16/plugins/bed/src/BedTabixAdapter
Closely related issues
- https://github.com/gosling-lang/gosling.js/issues/764
- https://github.com/gosling-lang/gosling.js/issues/583
One thing to note is that TABIX supports separate types of indicies: traditional FAI and CSI. Since we make the index path explicit, for these file types, I think that we can determine which index is used from the index URL (i.e., .tbi vs .csi), but we will probably want to support both.
Another thing we could learn from jbrowse folks is coming up with a shared abstraction for retrieving "rows" (or features) or these abstract data formats:
- https://github.com/GMOD/jbrowse-components/blob/4a35910bd2759ae5aa6174a15498953ff3e17f16/plugins/bed/src/BedTabixAdapter/BedTabixAdapter.ts#L27
- https://github.com/GMOD/jbrowse-components/blob/4a35910bd2759ae5aa6174a15498953ff3e17f16/plugins/bed/src/BedTabixAdapter/BedTabixAdapter.ts#L90
That way rather than implementing N data-fetchers which wrap tabix, we can perhaps have a shared underlying object which performs fetching & parsing given a TabixIndexFile and some parser. So the adapters just need to initialize the TabixIndexedFile and parser.