Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codeocean/app-panel.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@
"results": [
{
"file_name": "figures/diff/mean-variance.png"
},
{
"file_name": "deg/DEG_Analysis.csv"
}
]
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (#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)
Expand Down
14 changes: 12 additions & 2 deletions code/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"))
17 changes: 17 additions & 0 deletions tests/testthat/helper-cli.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(), "..", ".."),
Expand Down Expand Up @@ -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(
Expand Down
Loading