refgenie / refgenieserver

Serves a web interface and RESTful API for reference genome assets.
http://refgenie.databio.org
BSD 2-Clause "Simplified" License
13 stars 3 forks source link

traverse asset directories to provide direct file links #114

Closed stolarczyk closed 3 years ago

stolarczyk commented 3 years ago

Unless there is a way to serve a directory, we will need to traverse the asset directory and save their contents in a nested data structure, rather than a flat array of strings before saving as JSON.

For assets like mm10/bismark_bt2_index:default, which contain directories within assets directory the direct links to asset files don't work.

here's an example of an asset dir structure:

[mjs5kd@udc-ba36-36 bismark_bt2_index__default]: ls -R
.:
0f10d83b1050c08dd53189986f60970b92a315aa7a16a6f1.fa  Bisulfite_Genome

./Bisulfite_Genome:
CT_conversion  GA_conversion

./Bisulfite_Genome/CT_conversion:
BS_CT.1.bt2  BS_CT.2.bt2  BS_CT.3.bt2  BS_CT.4.bt2  BS_CT.rev.1.bt2  BS_CT.rev.2.bt2  genome_mfa.CT_conversion.fa

./Bisulfite_Genome/GA_conversion:
BS_GA.1.bt2  BS_GA.2.bt2  BS_GA.3.bt2  BS_GA.4.bt2  BS_GA.rev.1.bt2  BS_GA.rev.2.bt2  genome_mfa.GA_conversion.fa
nsheff commented 3 years ago

why can't you just save it as a flat array with strings like "path/file.xyz" ?

stolarczyk commented 3 years ago

yeah, that's another possibility. I was thinking to make files in subdirectories indented a level and listed just by the file name (like the level 1 files) and that's why the nested idea came to my mind. This would be cleaner from the UI perspective, but your suggestion is definitely easier to implement and that's what I'll do, I think.

stolarczyk commented 3 years ago

solved: http://rg.databio.org/v3/assets/splash/94e0d21feb576e6af61cd2a798ad30682ef2428bb7eabbb4/bismark_bt2_index?tag=default