GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
205 stars 61 forks source link

Allow csi index in @jbrowse/img jb2export #4477

Closed jd3234 closed 2 months ago

jd3234 commented 2 months ago

Is your feature request related to a problem? Please describe.

I am using jb2export which works as long as the chromosomes are small enough that they are working with a tbi index. However, we have crop genomes that require the use of csi indices but jb2export seems to only search for tbi index of a given bed or gff3 file.

Describe the solution you'd like

Allow the use of *.csi indices to use jb2export with large genomes.

Describe alternatives you've considered If there is a way to do this already that I have overlooked please point me into the right direction :)

Additional context

Thanks!

cmdcolin commented 2 months ago

thanks for requesting this. it is nice to see usage of the jb2export tool also!

I think you're right that the jb2export actually doesn't have a easy way to specify csi yet, so we could look into this

the code is indeed quite simplistic and always just is filename +'.tbi' on the end https://github.com/GMOD/jbrowse-components/blob/5d7b1938108a4a7df408a3701f668e961032b36b/products/jbrowse-img/src/renderRegion.tsx#L328

cmdcolin commented 2 months ago

tried to propose a new PR here to take care of it https://github.com/GMOD/jbrowse-components/pull/4478

it would take a new release or a dev environment to test out, but feel free to preview the basic idea (it is basically adding like "--gff yourfile.gff.gz index:yourfile.gff.gz.csi". it's not equipped to autodetect the index yet but hopefully helps to allow it to be manually specified like that

jd3234 commented 2 months ago

Thanks for your quick reply! I think your idea is a good first work around. I will wait for a new release and then test it again. :)

cmdcolin commented 2 months ago

should be added in v2.13.0

can try

sample with our test data like this

jb2export --fasta volvox.fa --bam volvox-sorted.bam index:volvox-sorted.bam.csi --loc ctgA:1-5000

cmdcolin commented 2 months ago

thanks for reporting this again, let us know if there are any issues!

jd3234 commented 2 months ago

Hi @cmdcolin ,

just a quick feedback: tested with the new release and worked just fine. Thanks!