iobio / bam.iobio.io

http://bam.iobio.io
MIT License
47 stars 19 forks source link

Handle crai file support #105

Open AlistairNWard opened 6 years ago

AlistairNWard commented 6 years ago

Currently bai files are used to calculate various metrics. Ensure we can do the same for crai.

chmille4 commented 6 years ago

Turns out this is easier then we thought. A CRAI file is a gzipped tab delimited file containing the following columns:

  1. Sequence id
  2. Alignment start
  3. Alignment span
  4. Container start byte offset in the file
  5. Slice start byte offset in the container data (‘blocks’)
  6. Slice bytes

So here is a script that will take a crai file and generate output that is identical to bamReadDepther. craiReadDepther.js.zip

There are two things left to do for bam.iobio to support cram/crai:

1) Turn craiReadDepther into a new deployed service. @yiq can help with this. 2) Update bam.iobio to identify cram/crai files and then use the new craiReadDepther services instead of the bamReadDepther service.

An alternative would be to wrap the bamReadDepther with a simple script that identifies crai and bai files and sends them to the correct parser. This is probably more robust. Yi, any thoughts?

tonydisera commented 6 years ago

Excellent!