From cc077f167504c2e158605c76624bfac221176d95 Mon Sep 17 00:00:00 2001 From: TylerSagendorf Date: Thu, 7 Mar 2024 17:34:25 -0600 Subject: [PATCH] Update enrichmat Fix adjusted p-value legend to reflect choice of padj_cutoff. --- DESCRIPTION | 6 +++--- R/enrichmat.R | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8fab024..4d00d89 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: MotrpacRatTraining6moWAT Type: Package Title: Helper Functions for the MotrpacRatTraining6moWATData R Package -Version: 1.0.0 -Date: 2024-02-01 +Version: 1.0.1 +Date: 2024-03-07 Authors@R: c( person(given = "Tyler", family = "Sagendorf", @@ -56,7 +56,7 @@ Imports: tools, utils, WGCNA -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE) URL: https://motrpac.github.io/MotrpacRatTraining6moWAT/, diff --git a/R/enrichmat.R b/R/enrichmat.R index 8bd2440..e8d1393 100644 --- a/R/enrichmat.R +++ b/R/enrichmat.R @@ -195,7 +195,8 @@ enrichmat <- function(x, lt_args <- list( title = padj_legend_title, at = 1:2, - labels = latex2exp::TeX(c("$< 0.05$", "$\\geq 0.05$")), + labels = latex2exp::TeX(sprintf(c("$< %g$", + "$\\geq %g$"), padj_cutoff)), legend_gp = gpar(fill = c(padj_fill, "white")), grid_height = heatmap_args$heatmap_legend_param$grid_width, grid_width = heatmap_args$heatmap_legend_param$grid_width, @@ -258,7 +259,7 @@ layer_fun <- function(j, i, x, y, w, h, f) r = pindex(rmat, i, j) / 2 * cell_size, gp = gpar(col = ifelse(pindex(padj_mat, i, j) < padj_cutoff, "black", NA), - fill = col_fun(pindex(NES_mat, i, j)) + fill = col_fun(pindex(NES_mat, i, j)) )) }