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.
In continuos variables checkbox, I only selected CHAT gene ["CHAT; ENSG00000070748"]
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.
Next, I selected TAC gene (now I am using multi-gene selection with 2 genes) ["TAC1; ENSG00000006128" "CHAT; ENSG00000070748"]
You may notice, spotplot visualization fails when using both gene.
The same request selection by code ["TAC1; ENSG00000006128" "CHAT; ENSG00000070748"], reports next error:
Error in `map2()`:
ℹ In index: 1.
Caused by error:
! After dropping features with no expression variation, less than 2 features were left. This error can occur when using data from only 1 spot.
Run `rlang::last_trace()` to see where the error occurred.
> lst_Habenula
[1] "TAC1; ENSG00000006128" "CHAT; ENSG00000070748"
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.
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