vgteam / sequenceTubeMap

displays multiple genomic sequences in the form of a tube map
MIT License
178 stars 24 forks source link

GAM file not found by `vg chunk` #368

Closed subwaystation closed 9 months ago

subwaystation commented 9 months ago

Hi there, I am using the most recent master from today and ran into the following:

I supplied a XG and a GAM file. However, STM complained:

http POST getChunkedData received
region = lodEloB2#0#chrC:576733-650297#0:68202-68300
tracks = {"1":{"trackType":"graph","trackColorSettings":{"mainPalette":"#000000","auxPalette":"greys","colorReadsByMappingQuality":false},"trackFile":"/home/heumos/git/sequenceTubeMap/exampleData/tangle.gfa.xg"},"2":{"trackType":"read","trackColorSettings":{"mainPalette":"blues","auxPalette":"reds","colorReadsByMappingQuality":false},"trackFile":"uploads/1700833813102.sorted.gam"}}
graphFile  /home/heumos/git/sequenceTubeMap/exampleData/tangle.gfa.xg
gbwtFile  undefined
bedFile  none
gamFiles  [ 'uploads/1700833813102.sorted.gam' ]
no gbwt file provided.
no BED file provided.
pushing gam file uploads/1700833813102.sorted.gam
vg chunk -x /home/heumos/git/sequenceTubeMap/exampleData/tangle.gfa.xg -a uploads/1700833813102.sorted.gam -g -c 20 -p lodEloB2#0#chrC:576733-650297#0:68202-68300 -T -b tmp/tmp-50fb79c0-8ad1-11ee-9cb1-c97a0d7d4a5b/chunk -E tmp/tmp-50fb79c0-8ad1-11ee-9cb1-c97a0d7d4a5b/regions.tsv
vg chunk err data: error:[get_input_file] could not open file "uploads/1700833813102.sorted.gam.gai"

Any ideas what could be the issue here? Thanks!

subwaystation commented 9 months ago

Should STM or VG automatically have create the GAM.GAI and forgot?

subwaystation commented 9 months ago

Generating the files manually worked. I still think there is a problem in the STM code to handle such a case.

adamnovak commented 9 months ago

We are indeed supposed to automatically sort and index GAM files when they are uploaded: https://github.com/vgteam/sequenceTubeMap/blob/26266cc685f6492799d0426653df3d5e1bb5ff98/src/server.mjs#L262

@ducku Do you have any idea why that wouldn't be happening?

@subwaystation Does this happen every single time you upload a GAM file? Or is there something special you have to do? Do you have the server log from the GAM file being uploaded?

ducku commented 9 months ago

I can't seem to be able to reproduce the issue. I'm not too sure what could be causing the problem. The .gai file is being automatically generated upon uploading a sorted gam file for me.

subwaystation commented 9 months ago

I may have been not precise enough. I didn't upload a GAM, but put it into exampleData.

adamnovak commented 9 months ago

If you want to hand the files to the server and not upload through the browser, right now you need to use the included scripts such as prepare_gam.sh to make the required index. We don't have logic to see that a GAM file was put in the directory and automatically produce the indexes for it. Perhaps we should?

subwaystation commented 9 months ago

Aah, got it. Thanks!