gosling.js icon indicating copy to clipboard operation
gosling.js copied to clipboard

Support for Tabixed BED

Open sehilyi opened this issue 3 years ago • 2 comments
trafficstars

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

sehilyi avatar Jul 27 '22 17:07 sehilyi

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.

manzt avatar Jul 28 '22 15:07 manzt

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.

manzt avatar Jul 28 '22 15:07 manzt