From caf184ee6de26308368e43da555071252b28c7b1 Mon Sep 17 00:00:00 2001 From: Josh Meyer Date: Wed, 19 Aug 2026 17:22:09 -0400 Subject: [PATCH 1/3] feat: emit merged DEG table for OMIX compatibility --- .codeocean/app-panel.json | 3 +++ code/main.R | 14 ++++++++++++-- tests/testthat/helper-cli.R | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.codeocean/app-panel.json b/.codeocean/app-panel.json index 42d5a3d..ecc7308 100644 --- a/.codeocean/app-panel.json +++ b/.codeocean/app-panel.json @@ -167,6 +167,9 @@ "results": [ { "file_name": "figures/diff/mean-variance.png" + }, + { + "file_name": "deg/DEG_Analysis.csv" } ] } \ No newline at end of file diff --git a/code/main.R b/code/main.R index 8cd9399..a327ad8 100644 --- a/code/main.R +++ b/code/main.R @@ -88,7 +88,7 @@ if (identical(args$contrasts, "")) { } # run MOSuite -moo |> +moo_diff <- moo |> diff_counts( count_type = args$count_type, sub_count_type = args$sub_count_type, @@ -104,5 +104,15 @@ moo |> input_in_log_counts = args$input_in_log_counts, return_mean_and_sd = args$return_mean_and_sd, voom_normalization_method = args$voom_normalization_method - ) |> + ) + +moo_diff |> write_rds(file.path(getOption("moo_plots_dir"), "..", "moo", "moo-diff.rds")) + +# emit a merged, contrast-prefixed DEG table for downstream tools (e.g. OMIX) +# that consume a flat table rather than a multiOmicDataSet +deg_dir <- file.path(getOption("moo_plots_dir"), "..", "deg") +dir.create(deg_dir, recursive = TRUE, showWarnings = FALSE) +moo_diff@analyses$diff |> + join_dfs_wide() |> + write_csv(file.path(deg_dir, "DEG_Analysis.csv")) diff --git a/tests/testthat/helper-cli.R b/tests/testthat/helper-cli.R index 8b4ed5a..f5162ba 100644 --- a/tests/testthat/helper-cli.R +++ b/tests/testthat/helper-cli.R @@ -9,6 +9,7 @@ setup_cli_workspace <- function(prefix = "mosuite_diff_counts_test_") { dir.create(data_dir, recursive = TRUE) dir.create(file.path(results_dir, "figures"), recursive = TRUE) dir.create(file.path(results_dir, "moo"), recursive = TRUE) + dir.create(file.path(results_dir, "deg"), recursive = TRUE) repo_root <- normalizePath( file.path(testthat::test_path(), "..", ".."), @@ -69,6 +70,22 @@ expect_outputs_created <- function(results_dir) { "diff" %in% names(moo@analyses), info = "Output should have diff results in moo@analyses" ) + + deg_path <- file.path(results_dir, "deg", "DEG_Analysis.csv") + expect_true( + file.exists(deg_path), + info = "Merged DEG table should be created" + ) + expect_true( + file.info(deg_path)$size > 0, + info = "Merged DEG table should be non-empty" + ) + + deg_dat <- readr::read_csv(deg_path, show_col_types = FALSE) + expect_true( + all(c("B-A_logFC", "B-A_pval", "B-A_adjpval") %in% colnames(deg_dat)), + info = "Merged DEG table should have contrast-prefixed columns for OMIX compatibility" + ) } common_cli_args <- c( From c654cfad61dbfb63f55bb955e705ef1f3d9403bb Mon Sep 17 00:00:00 2001 From: Josh Meyer Date: Wed, 19 Aug 2026 17:27:17 -0400 Subject: [PATCH 2/3] docs(changelog): add entry for merged DEG table output --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f488cf..422cee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Development version +- Emit a merged, contrast-prefixed DEG table (`deg/DEG_Analysis.csv`) alongside the existing MOO output, for compatibility with downstream tools such as OMIX-GSEA-Preranked-Legacy that expect a flat DEG table (#PR_NUMBER, @TJoshMeyer). - Sync Code Ocean app panel parameter descriptions with MOSuite package documentation for MOSuite v0.4.1 (#7, @phoman14). - Improved the Code Ocean parameter UI for the diff counts capsule (#3, @phoman14). - Use MOSuite v0.3.2. (#4, @kelly-sovacool) From 790085035a235c7fa6c8b8fc8a1832bd1c6e6b20 Mon Sep 17 00:00:00 2001 From: Josh Meyer Date: Wed, 19 Aug 2026 17:38:08 -0400 Subject: [PATCH 3/3] docs(changelog): reference PR #9 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 422cee2..c92f0c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Development version -- Emit a merged, contrast-prefixed DEG table (`deg/DEG_Analysis.csv`) alongside the existing MOO output, for compatibility with downstream tools such as OMIX-GSEA-Preranked-Legacy that expect a flat DEG table (#PR_NUMBER, @TJoshMeyer). +- Emit a merged, contrast-prefixed DEG table (`deg/DEG_Analysis.csv`) alongside the existing MOO output, for compatibility with downstream tools such as OMIX-GSEA-Preranked-Legacy that expect a flat DEG table (#9, @TJoshMeyer). - Sync Code Ocean app panel parameter descriptions with MOSuite package documentation for MOSuite v0.4.1 (#7, @phoman14). - Improved the Code Ocean parameter UI for the diff counts capsule (#3, @phoman14). - Use MOSuite v0.3.2. (#4, @kelly-sovacool)