spatialLIBD icon indicating copy to clipboard operation
spatialLIBD copied to clipboard

Miscellaneous error on https://libd.shinyapps.io/spatialLIBD/ when accessing genes (interactive)

Open matt-sd-watson opened this issue 5 months ago • 1 comments

As the title indicates, I received a generic error when attempting to access the interative gene feature for one of the datasets on https://libd.shinyapps.io/spatialLIBD/. The screen capture shows any user selections I made:

Image

matt-sd-watson avatar Jul 29 '25 17:07 matt-sd-watson

Hi,

Thank you for your interest in spatialLIBD!

I couldn't reproduce your exact error and I wonder if you have more information that could help reproduce the problem. I did find a similar issue, which might be what you did. Basically, it seems like you hadn't actually edited an image (through the "Edit image" tab), and were thus trying to load an image that doesn't exist.

Here's a view of the data using the default "lowres" image under the "gene (interactive)" tab.

Image

I see that you are using an edited imaged. So I went to the edit image tab, clicked on "equalize"

Image

and then on "update custom image".

Image

You can see the edited image for 151674 as shown on the "gene (static)" tab with the "show gene and image side by side" checkbox enabled.

Image

And under the "gene (interactive)" tab it all looks ok.

Image

I'll note though, that the app did crash on me once (no error message) under the "gene (interactive)" tab. Note that https://libd.shinyapps.io/spatialLIBD/ is a mirror of http://spatial.libd.org/spatialLIBD/, and http://spatial.libd.org/spatialLIBD/ has more compute resources behind the app (more RAM: 128 GB vs 8 GB right now). Although from the logs at shinyapps.io, it's not evident whether the app https://libd.shinyapps.io/spatialLIBD/ crashed because it reached the max 8 GM of RAM.

Image

https://libd.shinyapps.io/spatialLIBD/ under the "help or feedback" tab shows that it was deployed with spatialLIBD version 1.15.4 while http://spatial.libd.org/spatialLIBD/ was deployed with version 1.11.4. Both are using older versions of spatialLIBD although I don't recall major changes to the "gene (interactive)" tab https://research.libd.org/spatialLIBD/news/index.html. Maybe the vis_gene() changes from 1.15.2 could be playing a role, but since I couldn't reproduce the issue you found, I don't think that this was the source of your error.

Here you can see the output using http://spatial.libd.org/spatialLIBD/.

Image

From downloading the recent logs, I see this:

2025-07-29T17:05:41.113249+00:00 shinyapps[6649850]: 2025-07-29 17:05:40.243777 loading file /srv/connect/apps/spatialLIBD/data-raw/spatialLIBD_files/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata
2025-07-29T17:06:00.234123+00:00 shinyapps[6649850]: 2025-07-29 17:05:59.293457 loading file /srv/connect/apps/spatialLIBD/data-raw/spatialLIBD_files/Human_DLPFC_Visium_processedData_sce_scran_sce_layer_spatialLIBD.Rdata
2025-07-29T17:06:00.238433+00:00 shinyapps[6649850]: 2025-07-29 17:05:59.899141 loading file /srv/connect/apps/spatialLIBD/data-raw/spatialLIBD_files/Human_DLPFC_Visium_modeling_results.Rdata
2025-07-29T17:06:08.113364+00:00 shinyapps[6649850]: 
2025-07-29T17:06:08.117431+00:00 shinyapps[6649850]: Listening on http://127.0.0.1:42515
2025-07-29T17:07:02.121350+00:00 shinyapps[6649850]: Warning: Error in .get_img_idx: No 'imgData' entry(ies) matched the specified 'image_id = “edited_imaged”' and 'sample_id = “151674”'
2025-07-29T17:07:02.125745+00:00 shinyapps[6649850]:   125: stop
2025-07-29T17:07:02.130231+00:00 shinyapps[6649850]:   124: .get_img_idx
2025-07-29T17:07:02.134880+00:00 shinyapps[6649850]:   123: .local
2025-07-29T17:07:02.139349+00:00 shinyapps[6649850]:   122: getImg
2025-07-29T17:07:02.143773+00:00 shinyapps[6649850]:   120: .local
2025-07-29T17:07:02.147837+00:00 shinyapps[6649850]:   119: SpatialExperiment::imgRaster
2025-07-29T17:07:02.152083+00:00 shinyapps[6649850]:   117: vis_gene_p
2025-07-29T17:07:02.156046+00:00 shinyapps[6649850]:   116: vis_gene
2025-07-29T17:07:02.160365+00:00 shinyapps[6649850]:   115: renderPlotly
2025-07-29T17:07:02.165230+00:00 shinyapps[6649850]:   114: func
2025-07-29T17:07:02.169405+00:00 shinyapps[6649850]:   111: shinyRenderWidget
2025-07-29T17:07:02.173581+00:00 shinyapps[6649850]:   110: func
2025-07-29T17:07:02.178563+00:00 shinyapps[6649850]:    97: renderFunc
2025-07-29T17:07:02.183089+00:00 shinyapps[6649850]:    96: output$gene_plotly
2025-07-29T17:07:02.187463+00:00 shinyapps[6649850]:    15: <Anonymous>
2025-07-29T17:07:02.191617+00:00 shinyapps[6649850]:    13: fn
2025-07-29T17:07:02.196903+00:00 shinyapps[6649850]:     8: retry
2025-07-29T17:07:02.200914+00:00 shinyapps[6649850]:     7: connect$retryingStartServer
2025-07-29T17:07:02.204841+00:00 shinyapps[6649850]:     6: eval
2025-07-29T17:07:02.208919+00:00 shinyapps[6649850]:     5: eval
2025-07-29T17:07:02.212974+00:00 shinyapps[6649850]:     4: eval
2025-07-29T17:07:02.216974+00:00 shinyapps[6649850]:     3: eval
2025-07-29T17:07:02.221835+00:00 shinyapps[6649850]:     2: eval.parent
2025-07-29T17:07:02.225753+00:00 shinyapps[6649850]:     1: local

Which seems to indicate that you were using as input an "edited_image" without having created one. Steps for reproducing:

  1. Open app, go to "gene (static)" tab (or "gene (interactive)")
Image
  1. Choose under "Image name" the "edited_image" option (without having gone to the "edit image" tab and having saved one before).
Image

If I do that, I see this on the shinyapps.io logs:

2025-07-29T17:59:25.113055+00:00 shinyapps[6649850]: Warning: Error in .get_img_idx: No 'imgData' entry(ies) matched the specified 'image_id = “edited_imaged”' and 'sample_id = “151507”'
2025-07-29T17:59:25.117179+00:00 shinyapps[6649850]:   209: stop
2025-07-29T17:59:25.120960+00:00 shinyapps[6649850]:   208: .get_img_idx
2025-07-29T17:59:25.124684+00:00 shinyapps[6649850]:   207: .local
2025-07-29T17:59:25.128446+00:00 shinyapps[6649850]:   206: getImg
2025-07-29T17:59:25.132259+00:00 shinyapps[6649850]:   204: .local
2025-07-29T17:59:25.136180+00:00 shinyapps[6649850]:   203: SpatialExperiment::imgRaster
2025-07-29T17:59:25.139824+00:00 shinyapps[6649850]:   201: vis_gene_p
2025-07-29T17:59:25.143404+00:00 shinyapps[6649850]:   200: vis_gene
2025-07-29T17:59:25.146990+00:00 shinyapps[6649850]:   199: <reactive>
2025-07-29T17:59:25.150636+00:00 shinyapps[6649850]:   197: .func
2025-07-29T17:59:25.154272+00:00 shinyapps[6649850]:   194: contextFunc
2025-07-29T17:59:25.157748+00:00 shinyapps[6649850]:   193: env$runWith
2025-07-29T17:59:25.161299+00:00 shinyapps[6649850]:   186: ctx$run
2025-07-29T17:59:25.165256+00:00 shinyapps[6649850]:   185: self$.updateValue
2025-07-29T17:59:25.169015+00:00 shinyapps[6649850]:   183: static_gene
2025-07-29T17:59:25.172447+00:00 shinyapps[6649850]:   182: renderPlot
2025-07-29T17:59:25.176193+00:00 shinyapps[6649850]:   180: func
2025-07-29T17:59:25.179952+00:00 shinyapps[6649850]:   140: drawPlot
2025-07-29T17:59:25.183817+00:00 shinyapps[6649850]:   126: <reactive:plotObj>
2025-07-29T17:59:25.187488+00:00 shinyapps[6649850]:   110: drawReactive
2025-07-29T17:59:25.191020+00:00 shinyapps[6649850]:    97: renderFunc
2025-07-29T17:59:25.194497+00:00 shinyapps[6649850]:    96: output$gene
2025-07-29T17:59:25.198161+00:00 shinyapps[6649850]:    15: <Anonymous>
2025-07-29T17:59:25.201969+00:00 shinyapps[6649850]:    13: fn
2025-07-29T17:59:25.206546+00:00 shinyapps[6649850]:     8: retry
2025-07-29T17:59:25.210435+00:00 shinyapps[6649850]:     7: connect$retryingStartServer
2025-07-29T17:59:25.214043+00:00 shinyapps[6649850]:     6: eval
2025-07-29T17:59:25.217860+00:00 shinyapps[6649850]:     5: eval
2025-07-29T17:59:25.221583+00:00 shinyapps[6649850]:     4: eval
2025-07-29T17:59:25.225459+00:00 shinyapps[6649850]:     3: eval
2025-07-29T17:59:25.229561+00:00 shinyapps[6649850]:     2: eval.parent
2025-07-29T17:59:25.233365+00:00 shinyapps[6649850]:     1: local

Best, Leo

lcolladotor avatar Jul 29 '25 18:07 lcolladotor