Closed cyntsc closed 6 days ago
Looks like we could use https://github.com/daattali/shinyalert to provide more informative error messages.
To follow up, there are really two separate issues going on here. The first was that the Z-score-based method for plotting 2 genes was throwing an error when one of the genes had expression variation across the tissue, which should not happen. I fixed that in the above commit. Now, the open issue is configuring the Shiny app to display warnings, as there actually already is code (see here) that describes which features are dropped if that must be done for plotting. I'll continue looking into that piece.
The multi-gene function fails if the genes requested report no expression variation in some slides (samples).
I have encountered an exception when certain genes are not present in some slides. The multigene function only fails if the gene search reports no expression variation when more than 2 genes are requested. Note. This feature does not fail when plotting one gene at a time, even if the gene has no variation on 1 or more slides.
Example using https://libd.shinyapps.io/Habenula_Visium/
You may notice that gene variations are not reported on the top slides, but are reported on the bottom slides. The spotplot can be displayed with no issues.
You may notice, spotplot visualization fails when using both gene.
Note that running gen by gen does not generate an error. Therefore, I think this simply occurs when more than one gene is mapped at a time.
Expected behavior
I would like to obtain spot plots that display variations in genes, even if the data is partial. It also would be very useful to have an informative message indicating which genes are missing (at least in general). This notification would allow users to take appropriate steps to explore and address the incomplete data.
Implementing this feature would greatly improve the user experience by providing crucial information about the dataset's completeness and enabling more informed analysis.
R Session Information
[1] "Reproducibility information:"
This is the RScript used, you can run the script and uncommented the line below to reproduce the bug
https://github.com/LieberInstitute/Habenula_Visium/blob/facfbbf6c03286d95469395ccdd99e206100aa38/code/04_harmony_BayesSpace/05-multi_gene_selection.R#L208
lst_Habenula <- lst_Habenula[1:2]
Cynthia SC