Skip to content

Commit

Permalink
Tweak app_server() to support new features from gene_set_enrichment_p…
Browse files Browse the repository at this point in the history
…lot() implemented by @lahuuki on #93.
  • Loading branch information
lcolladotor committed Dec 13, 2024
1 parent 1086e96 commit 0b623cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,15 @@ app_server <- function(input, output, session) {
})

static_layer_gene_set_enrichment_plot <- reactive({
gene_set_enrichment_plot(static_layer_gene_set_enrichment())
enriched <- static_layer_gene_set_enrichment()
gene_set_enrichment_plot(
enriched,
plot_SetSize_bar = TRUE,
model_colors = get_colors(
spatialLIBD::libd_layer_colors,
clusters = unique(enriched$test)
)
)
})


Expand Down Expand Up @@ -1632,7 +1640,8 @@ app_server <- function(input, output, session) {
height = 8,
width = 8
)
gene_set_enrichment_plot(static_layer_gene_set_enrichment())
p <- static_layer_gene_set_enrichment_plot()
print(p)
dev.off()
}
)
Expand Down
4 changes: 2 additions & 2 deletions R/gene_set_enrichment_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
#' @param plot_SetSize_bar A `logical(1)` indicating whether to plot SetSize
#' from `enrichment` as an `anno_barplot` at the top of the heatmap.
#' @param gene_list_length Optional named `numeric` vector indicating the length
#' of the `gene_list` used to calculate `enrichment`, if inclided and
#' of the `gene_list` used to calculate `enrichment`, if included and
#' `plot_setSize_bar = TRUE` then the top `anno_barplot` will show the `SetSize`
#' and the difference from the length of the input gene_list.
#' #' @param model_sig_length Optional named `numeric` vector indicating the
#' number of significant genes in `modeling_results` used to calculate
#' `enrichment`. If included `anno_barplot` will be added to rows.
#' #' @param model_colors named `character` vector of colors, Adds colors to
#' #' @param model_colors named `character` vector of colors. It adds colors to
#' row annotations.
#' #' @param ... Additional parameters passed to
#' [ComplexHeatmap::Heatmap()][ComplexHeatmap::Heatmap()].
Expand Down

0 comments on commit 0b623cd

Please sign in to comment.