diff --git a/.codeocean/app-panel.json b/.codeocean/app-panel.json index 4d81488..42d5a3d 100644 --- a/.codeocean/app-panel.json +++ b/.codeocean/app-panel.json @@ -16,18 +16,18 @@ "id": "7Rr6IxOMDucKMImp", "name": "Input Data Parameters", "description": "Options for defining input data", - "icon": "\ud83d\udcc1" + "icon": "📁" }, { "id": "EzTg1ivlFDHEy9PI", "name": "Basic", - "icon": "\ud83d\udcc2" + "icon": "📂" }, { "id": "FvI4Z2eb9sjL47Jt", "name": "Advanced", "description": "Advanced parameters", - "icon": "\ud83d\udcc2" + "icon": "📂" } ], "parameters": [ @@ -36,7 +36,7 @@ "category": "EzTg1ivlFDHEy9PI", "name": "Count type", "param_name": "count_type", - "description": "Counts slot name to use for differential expression (e.g., filt)", + "description": "The type of counts to use. This must be a name in the counts slot, moo@counts.", "type": "list", "value_type": "string", "default_value": "filt", @@ -51,7 +51,7 @@ "category": "EzTg1ivlFDHEy9PI", "name": "Contrasts column name", "param_name": "contrast_colname", - "description": "Metadata column containing group variables for differential expression (up to 2 columns for 2-factor analysis)", + "description": "The column in the metadata that contains the group variables you wish to find differential expression between. Up to 2 columns can be used for 2-factor analysis.", "type": "text", "value_type": "string", "default_value": "Group", @@ -62,30 +62,29 @@ "category": "EzTg1ivlFDHEy9PI", "name": "Contrasts for comparison", "param_name": "contrasts", - "description": "Specify contrasts in the format group1-group2,group1-group3 (comma-separated)", + "description": "Specify each contrast in the format group1-group2, for example treated-control.", "help_text": "These values must be in the contrasts column", "type": "text", "value_type": "string", - "default_value": "B-A,B-C,C-A", + "default_value": "B-A, B-C, C-A", "required": true }, { "id": "7pRIPMdfEf1dq2CS", "category": "EzTg1ivlFDHEy9PI", "name": "Covariates column names", - "param_name": "covariates_colname", - "description": "Comma-separated list of columns to be used as covariates in linear modeling; must include the contrast column", + "param_name": "covariates_colnames", + "description": "The column name or names from the sample metadata containing variables of interest, such as phenotype. Most commonly this will be the same column selected for your groups column. Some experimental designs may require that you add additional covariate columns here.", "type": "text", "value_type": "string", - "default_value": "Group,Batch", - "required": true + "default_value": "Batch" }, { "id": "WoZUI91NYysibcVj", "category": "FvI4Z2eb9sjL47Jt", "name": "sub count type", "param_name": "sub_count_type", - "description": "If count_type is a list, specify the sub count type within the list", + "description": "If count_type is a list, specify the sub count type within the list.", "type": "text", "value_type": "string" }, @@ -94,7 +93,7 @@ "category": "FvI4Z2eb9sjL47Jt", "name": "Sample ID Column Name", "param_name": "sample_id_colname", - "description": "Column name in sample metadata for sample IDs", + "description": "The column from the sample metadata containing the sample names. The names in this column must exactly match the names used as sample column names in the input counts matrix.", "type": "text", "value_type": "string" }, @@ -103,7 +102,7 @@ "category": "FvI4Z2eb9sjL47Jt", "name": "Feature ID column name", "param_name": "feature_id_colname", - "description": "Column name in counts table for feature IDs (e.g., gene)", + "description": "The column from the counts data containing the Feature IDs, usually Gene or Protein ID. This is usually the first column of the input counts matrix. Only columns of text type from the input counts matrix are available to select for this parameter.", "type": "text", "value_type": "string" }, @@ -112,7 +111,7 @@ "category": "FvI4Z2eb9sjL47Jt", "name": "Samples to Include", "param_name": "samples_to_include", - "description": "Comma-separated list of samples to include", + "description": "Which samples would you like to include? Usually, you will choose all sample columns, or you could choose to remove certain samples. Samples excluded here will be removed in this step and from downstream analysis.", "type": "text", "value_type": "string" }, @@ -121,7 +120,7 @@ "category": "FvI4Z2eb9sjL47Jt", "name": "Input in log counts", "param_name": "input_in_log_counts", - "description": "Set TRUE if counts are already log2-transformed", + "description": "Set this to TRUE if counts are already log2-transformed.", "type": "list", "value_type": "string", "default_value": "FALSE", @@ -135,7 +134,7 @@ "category": "FvI4Z2eb9sjL47Jt", "name": "Return mean and sd", "param_name": "return_mean_and_sd", - "description": "Return group means and standard deviations in addition to DE estimates", + "description": "Return mean and standard deviation of groups in addition to DEG estimates for contrasts.", "type": "list", "value_type": "string", "default_value": "FALSE", @@ -149,7 +148,7 @@ "category": "FvI4Z2eb9sjL47Jt", "name": "voom normalization method", "param_name": "voom_normalization_method", - "description": "Normalization method for differential expression. edgeR methods are applied with calcNormFactors before voom; limma methods are passed to voom normalize. limma options: quantile, scale, cyclicloess, none. edgeR options: TMM, TMMwzp, RLE, upperquartile.", + "description": "Normalization method to be applied to the logCPM values when using limma::voom.", "type": "list", "value_type": "string", "default_value": "quantile", @@ -170,4 +169,4 @@ "file_name": "figures/diff/mean-variance.png" } ] -} +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fd9185b..3f488cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Development version +- 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) diff --git a/tests/testthat/test-main.R b/tests/testthat/test-main.R index 668a6e9..2a96975 100644 --- a/tests/testthat/test-main.R +++ b/tests/testthat/test-main.R @@ -1,3 +1,35 @@ +test_that("every app panel parameter is accepted and used by main.R", { + repo_root <- normalizePath( + file.path(testthat::test_path(), "..", ".."), + mustWork = TRUE + ) + panel <- jsonlite::fromJSON( + file.path(repo_root, ".codeocean", "app-panel.json") + ) + main_text <- paste( + readLines(file.path(repo_root, "code", "main.R"), warn = FALSE), + collapse = "\n" + ) + + param_names <- panel$parameters$param_name + expect_true(length(param_names) > 0) + + for (param_name in param_names) { + expect_match( + main_text, + sprintf('"--%s"', param_name), + fixed = TRUE, + info = sprintf("main.R should define a --%s CLI argument", param_name) + ) + expect_match( + main_text, + sprintf("args$%s", param_name), + fixed = TRUE, + info = sprintf("main.R should read args$%s", param_name) + ) + } +}) + test_that("main.R CLI creates differential analysis output", { setup <- setup_cli_workspace("mosuite_diff_counts_test_") on.exit(unlink(setup$workspace, recursive = TRUE), add = TRUE)