From c82c789d8538fe52e90d33af852a92d23b2368c4 Mon Sep 17 00:00:00 2001 From: lcolladotor Date: Fri, 26 Jul 2024 19:11:59 -0400 Subject: [PATCH] Fix bug on the "clusters (interactive)" tab of run_app() for stitched data. I used this code to debug things: ```R library("HDF5Array") spe <- loadHDF5SummarizedExperiment('/Users/leocollado/Dropbox/Code/_libdcode/visiumStitched_brain/code/05_shiny/spe') vars <- colnames(colData(spe)) run_app( spe, sce_layer = NULL, modeling_results = NULL, sig_genes = NULL, title = "visiumStitched_brain", spe_discrete_vars = c( "ManualAnnotation", vars[grep("^precast_k[248]$", vars)], "scran_quick_cluster" ), spe_continuous_vars = c( "sum_umi", "sum_gene", "expr_chrM", "expr_chrM_ratio" ), default_cluster = "precast_k2", docs_path = "/Users/leocollado/Dropbox/Code/_libdcode/visiumStitched_brain/code/05_shiny/www", is_stitched = TRUE ) ``` --- R/app_server.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/app_server.R b/R/app_server.R index ca416d98..c40c1506 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -682,8 +682,7 @@ app_server <- function(input, output, session) { ## Add the reduced dims if (reduced_name != "") { - red_dims <- - reducedDim(spe, reduced_name)[spe$sample_id == sampleid, ] + red_dims <- reducedDim(spe_sub, reduced_name) colnames(red_dims) <- paste(reduced_name, "dim", seq_len(ncol(red_dims))) d <- cbind(d, red_dims)