From a284fc65c15f4572b50be9fb34a4d9f8017e6898 Mon Sep 17 00:00:00 2001 From: stemangiola Date: Sat, 25 Jun 2022 10:25:05 +1000 Subject: [PATCH] deprecate .contrasts and update tests --- DESCRIPTION | 2 +- R/methods.R | 71 +++++++++++-------- R/methods_SE.R | 34 +++++++-- man/test_differential_abundance-methods.Rd | 38 ++++++---- man/test_gene_enrichment-methods.Rd | 34 +++++---- tests/testthat/test-bulk_methods.R | 14 ++-- .../test-bulk_methods_SummarizedExperiment.R | 2 +- 7 files changed, 122 insertions(+), 73 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c71d1b30..6e6539b3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -82,7 +82,7 @@ Biarch: true biocViews: AssayDomain, Infrastructure, RNASeq, DifferentialExpression, GeneExpression, Normalization, Clustering, QualityControl, Sequencing, Transcription, Transcriptomics Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.0 LazyDataCompression: xz URL: https://github.com/stemangiola/tidybulk BugReports: https://github.com/stemangiola/tidybulk/issues diff --git a/R/methods.R b/R/methods.R index 52a4a2fb..950a712f 100755 --- a/R/methods.R +++ b/R/methods.R @@ -2114,7 +2114,7 @@ setMethod("ensembl_to_symbol", "tidybulk", .ensembl_to_symbol) #' @param .sample The name of the sample column #' @param .transcript The name of the transcript/gene column #' @param .abundance The name of the transcript/gene abundance column -#' @param .contrasts This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest) +#' @param contrasts This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest) #' @param method A string character. Either "edgeR_quasi_likelihood" (i.e., QLF), "edgeR_likelihood_ratio" (i.e., LRT), "edger_robust_likelihood_ratio", "DESeq2", "limma_voom", "limma_voom_sample_weights" #' @param test_above_log2_fold_change A positive real value. This works for edgeR and limma_voom methods. It uses the `treat` function, which tests that the difference in abundance is bigger than this threshold rather than zero \url{https://pubmed.ncbi.nlm.nih.gov/19176553}. #' @param scaling_method A character string. The scaling method passed to the back-end functions: edgeR and limma-voom (i.e., edgeR::calcNormFactors; "TMM","TMMwsp","RLE","upperquartile"). Setting the parameter to \"none\" will skip the compensation for sequencing-depth for the method edgeR or limma-voom. @@ -2123,6 +2123,7 @@ setMethod("ensembl_to_symbol", "tidybulk", .ensembl_to_symbol) #' @param action A character string. Whether to join the new information to the input tbl (add), or just get the non-redundant tbl with the new information (get). #' @param significance_threshold DEPRECATED - A real between 0 and 1 (usually 0.05). #' @param fill_missing_values DEPRECATED - A boolean. Whether to fill missing sample/transcript values with the median of the transcript. This is rarely needed. +#' @param .contrasts DEPRECATED - This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest) #' @param ... Further arguments passed to some of the internal functions. Currently, it is needed just for internal debug. #' #' @@ -2185,7 +2186,7 @@ setMethod("ensembl_to_symbol", "tidybulk", .ensembl_to_symbol) #' identify_abundant() |> #' test_differential_abundance( #' ~ 0 + condition, -#' .contrasts = c( "conditionTRUE - conditionFALSE") +#' contrasts = c( "conditionTRUE - conditionFALSE") #' ) #' #' # DESeq2 - equivalent for limma-voom @@ -2203,7 +2204,7 @@ setMethod("ensembl_to_symbol", "tidybulk", .ensembl_to_symbol) #' identify_abundant() |> #' test_differential_abundance( #' ~ 0 + condition, -#' .contrasts = list(c("condition", "TRUE", "FALSE")), +#' contrasts = list(c("condition", "TRUE", "FALSE")), #' method="deseq2" #' ) #' @@ -2216,7 +2217,7 @@ setGeneric("test_differential_abundance", function(.data, .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -2227,7 +2228,8 @@ setGeneric("test_differential_abundance", function(.data, # DEPRECATED significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) standardGeneric("test_differential_abundance")) @@ -2238,7 +2240,7 @@ setGeneric("test_differential_abundance", function(.data, .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -2250,7 +2252,8 @@ setGeneric("test_differential_abundance", function(.data, # DEPRECATED significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) { # Get column names @@ -2278,6 +2281,15 @@ setGeneric("test_differential_abundance", function(.data, } + # DEPRECATION OF .constrasts + if (is_present(.contrasts) & !is.null(.contrasts)) { + + # Signal the deprecation to the user + deprecate_warn("1.7.4", "tidybulk::test_differential_abundance(.contrasts = )", details = "The argument .contrasts is now deprecated please use contrasts (without the dot).") + + contrasts = .contrasts + } + # Clearly state what counts are used rlang::inform("===================================== tidybulk says: All testing methods use raw counts, irrespective of if scale_abundance @@ -2318,7 +2330,7 @@ such as batch effects (if applicable) in the formula. .sample = !!.sample, .transcript = !!.transcript, .abundance = !!.abundance, - .contrasts = .contrasts, + .contrasts = contrasts, method = method, test_above_log2_fold_change = test_above_log2_fold_change, scaling_method = scaling_method, @@ -2334,7 +2346,7 @@ such as batch effects (if applicable) in the formula. .sample = !!.sample, .transcript = !!.transcript, .abundance = !!.abundance, - .contrasts = .contrasts, + .contrasts = contrasts, method = method, test_above_log2_fold_change = test_above_log2_fold_change, scaling_method = scaling_method, @@ -2350,7 +2362,7 @@ such as batch effects (if applicable) in the formula. .sample = !!.sample, .transcript = !!.transcript, .abundance = !!.abundance, - .contrasts = .contrasts, + .contrasts = contrasts, method = method, scaling_method = scaling_method, omit_contrast_in_colnames = omit_contrast_in_colnames, @@ -2368,10 +2380,6 @@ such as batch effects (if applicable) in the formula. .data %>% dplyr::left_join(.data_processed, by = quo_name(.transcript)) %>% - # # Arrange - # ifelse_pipe(.contrasts %>% is.null, - # ~ .x %>% arrange(FDR)) %>% - # Attach attributes reattach_internals(.data_processed) @@ -2382,18 +2390,9 @@ such as batch effects (if applicable) in the formula. # Selecting the right columns pivot_transcript(!!.transcript) %>% - # select( - # !!.transcript, - # get_x_y_annotation_columns(.data, !!.sample,!!.transcript, !!.abundance, NULL)$vertical_cols - # ) %>% - # distinct() %>% dplyr::left_join(.data_processed, by = quo_name(.transcript)) %>% - # # Arrange - # ifelse_pipe(.contrasts %>% is.null, - # ~ .x %>% arrange(FDR)) %>% - # Attach attributes reattach_internals(.data_processed) @@ -2833,13 +2832,14 @@ setMethod("keep_abundant", "tidybulk", .keep_abundant) #' @param .sample The name of the sample column #' @param .entrez The ENTREZ ID of the transcripts/genes #' @param .abundance The name of the transcript/gene abundance column -#' @param .contrasts = NULL, +#' @param contrasts This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest) #' @param methods A character vector. One or 3 or more methods to use in the testing (currently EGSEA errors if 2 are used). Type EGSEA::egsea.base() to see the supported GSE methods. #' @param gene_sets A character vector or a list. It can take one or more of the following built-in collections as a character vector: c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), to be used with EGSEA buildIdx. c1 is human specific. Alternatively, a list of user-supplied gene sets can be provided, to be used with EGSEA buildCustomIdx. In that case, each gene set is a character vector of Entrez IDs and the names of the list are the gene set names. #' @param species A character. It can be human, mouse or rat. #' @param cores An integer. The number of cores available #' #' @param method DEPRECATED. Please use methods. +#' @param .contrasts DEPRECATED - This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest) #' #' @details This wrapper executes ensemble gene enrichment analyses of the dataset using EGSEA (DOI:0.12688/f1000research.12544.1) #' @@ -2911,13 +2911,15 @@ setGeneric("test_gene_enrichment", function(.data, .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera" , "roast" , "safe", "gage" , "padog" , "globaltest", "ora" ), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL # DEPRECATED + # DEPRECATED + method = NULL, + .contrasts = NULL ) standardGeneric("test_gene_enrichment")) @@ -2928,13 +2930,15 @@ setGeneric("test_gene_enrichment", function(.data, .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera" , "roast" , "safe", "gage" , "padog" , "globaltest", "ora" ), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL # DEPRECATED + # DEPRECATED + method = NULL, + .contrasts = NULL ) { # DEPRECATION OF reference function @@ -2945,6 +2949,15 @@ setGeneric("test_gene_enrichment", function(.data, methods = method } + # DEPRECATION OF .constrasts + if (is_present(.contrasts) & !is.null(.contrasts)) { + + # Signal the deprecation to the user + deprecate_warn("1.7.4", "tidybulk::test_differential_abundance(.contrasts = )", details = "The argument .contrasts is now deprecated please use contrasts (without the dot).") + + contrasts = .contrasts + } + # Make col names .sample = enquo(.sample) .abundance = enquo(.abundance) @@ -2987,7 +3000,7 @@ setGeneric("test_gene_enrichment", function(.data, .sample = !!.sample, .entrez = !!.entrez, .abundance = !!.abundance, - .contrasts = .contrasts, + .contrasts = contrasts, methods = methods, gene_sets = gene_sets, species = species, diff --git a/R/methods_SE.R b/R/methods_SE.R index dd65d816..f1044e8e 100755 --- a/R/methods_SE.R +++ b/R/methods_SE.R @@ -1061,7 +1061,7 @@ setMethod( #' @importFrom rlang inform .test_differential_abundance_se = function(.data, .formula, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -1070,6 +1070,15 @@ setMethod( ...) { + # DEPRECATION OF .constrasts + if (is_present(.contrasts) & !is.null(.contrasts)) { + + # Signal the deprecation to the user + deprecate_warn("1.7.4", "tidybulk::test_differential_abundance(.contrasts = )", details = "The argument .contrasts is now deprecated please use contrasts (without the dot).") + + contrasts = .contrasts + } + # Clearly state what counts are used # Clearly state what counts are used rlang::inform("===================================== @@ -1098,7 +1107,7 @@ such as batch effects (if applicable) in the formula. get_differential_transcript_abundance_bulk_SE( ., .formula, - .contrasts = .contrasts, + .contrasts = contrasts, colData(.data), method = method, test_above_log2_fold_change = test_above_log2_fold_change, @@ -1112,7 +1121,7 @@ such as batch effects (if applicable) in the formula. grepl("voom", method) ~ get_differential_transcript_abundance_bulk_voom_SE( ., .formula, - .contrasts = .contrasts, + .contrasts = contrasts, colData(.data), method = method, test_above_log2_fold_change = test_above_log2_fold_change, @@ -1125,7 +1134,7 @@ such as batch effects (if applicable) in the formula. tolower(method)=="deseq2" ~ get_differential_transcript_abundance_deseq2_SE( ., .formula, - .contrasts = .contrasts, + .contrasts = contrasts, method = method, scaling_method = scaling_method, omit_contrast_in_colnames = omit_contrast_in_colnames, @@ -1431,13 +1440,15 @@ setMethod("keep_abundant", .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera" , "roast" , "safe", "gage" , "padog" , "globaltest", "ora" ), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL # DEPRECATED + # DEPRECATED + method = NULL, + .contrasts = NULL ) { # DEPRECATION OF reference function @@ -1448,6 +1459,15 @@ setMethod("keep_abundant", methods = method } + # DEPRECATION OF .constrasts + if (is_present(.contrasts) & !is.null(.contrasts)) { + + # Signal the deprecation to the user + deprecate_warn("1.7.4", "tidybulk::test_differential_abundance(.contrasts = )", details = "The argument .contrasts is now deprecated please use contrasts (without the dot).") + + contrasts = .contrasts + } + .entrez = enquo(.entrez) # Check that there are no entrez missing @@ -1495,7 +1515,7 @@ setMethod("keep_abundant", ) my_contrasts = - .contrasts %>% + contrasts %>% when( length(.) > 0 ~ limma::makeContrasts(contrasts = ., levels = design), ~ NULL diff --git a/man/test_differential_abundance-methods.Rd b/man/test_differential_abundance-methods.Rd index d2be4bc1..1efbc70e 100755 --- a/man/test_differential_abundance-methods.Rd +++ b/man/test_differential_abundance-methods.Rd @@ -16,7 +16,7 @@ test_differential_abundance( .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -25,7 +25,8 @@ test_differential_abundance( action = "add", ..., significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) \S4method{test_differential_abundance}{spec_tbl_df}( @@ -34,7 +35,7 @@ test_differential_abundance( .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -43,7 +44,8 @@ test_differential_abundance( action = "add", ..., significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) \S4method{test_differential_abundance}{tbl_df}( @@ -52,7 +54,7 @@ test_differential_abundance( .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -61,7 +63,8 @@ test_differential_abundance( action = "add", ..., significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) \S4method{test_differential_abundance}{tidybulk}( @@ -70,7 +73,7 @@ test_differential_abundance( .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -79,7 +82,8 @@ test_differential_abundance( action = "add", ..., significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) \S4method{test_differential_abundance}{SummarizedExperiment}( @@ -88,7 +92,7 @@ test_differential_abundance( .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -97,7 +101,8 @@ test_differential_abundance( action = "add", ..., significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) \S4method{test_differential_abundance}{RangedSummarizedExperiment}( @@ -106,7 +111,7 @@ test_differential_abundance( .sample = NULL, .transcript = NULL, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, method = "edgeR_quasi_likelihood", test_above_log2_fold_change = NULL, scaling_method = "TMM", @@ -115,7 +120,8 @@ test_differential_abundance( action = "add", ..., significance_threshold = NULL, - fill_missing_values = NULL + fill_missing_values = NULL, + .contrasts = NULL ) } \arguments{ @@ -129,7 +135,7 @@ test_differential_abundance( \item{.abundance}{The name of the transcript/gene abundance column} -\item{.contrasts}{This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest)} +\item{contrasts}{This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest)} \item{method}{A string character. Either "edgeR_quasi_likelihood" (i.e., QLF), "edgeR_likelihood_ratio" (i.e., LRT), "edger_robust_likelihood_ratio", "DESeq2", "limma_voom", "limma_voom_sample_weights"} @@ -148,6 +154,8 @@ test_differential_abundance( \item{significance_threshold}{DEPRECATED - A real between 0 and 1 (usually 0.05).} \item{fill_missing_values}{DEPRECATED - A boolean. Whether to fill missing sample/transcript values with the median of the transcript. This is rarely needed.} + +\item{.contrasts}{DEPRECATED - This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest)} } \value{ A consistent object (to the input) with additional columns for the statistics from the test (e.g., log fold change, p-value and false discovery rate). @@ -221,7 +229,7 @@ DESeq2::results() identify_abundant() |> test_differential_abundance( ~ 0 + condition, - .contrasts = c( "conditionTRUE - conditionFALSE") + contrasts = c( "conditionTRUE - conditionFALSE") ) # DESeq2 - equivalent for limma-voom @@ -239,7 +247,7 @@ my_se_mini |> identify_abundant() |> test_differential_abundance( ~ 0 + condition, - .contrasts = list(c("condition", "TRUE", "FALSE")), + contrasts = list(c("condition", "TRUE", "FALSE")), method="deseq2" ) diff --git a/man/test_gene_enrichment-methods.Rd b/man/test_gene_enrichment-methods.Rd index b91308fa..e6f283d8 100644 --- a/man/test_gene_enrichment-methods.Rd +++ b/man/test_gene_enrichment-methods.Rd @@ -16,13 +16,14 @@ test_gene_enrichment( .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL + method = NULL, + .contrasts = NULL ) \S4method{test_gene_enrichment}{spec_tbl_df}( @@ -31,13 +32,14 @@ test_gene_enrichment( .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL + method = NULL, + .contrasts = NULL ) \S4method{test_gene_enrichment}{tbl_df}( @@ -46,13 +48,14 @@ test_gene_enrichment( .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL + method = NULL, + .contrasts = NULL ) \S4method{test_gene_enrichment}{tidybulk}( @@ -61,13 +64,14 @@ test_gene_enrichment( .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL + method = NULL, + .contrasts = NULL ) \S4method{test_gene_enrichment}{SummarizedExperiment}( @@ -76,13 +80,14 @@ test_gene_enrichment( .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL + method = NULL, + .contrasts = NULL ) \S4method{test_gene_enrichment}{RangedSummarizedExperiment}( @@ -91,13 +96,14 @@ test_gene_enrichment( .sample = NULL, .entrez, .abundance = NULL, - .contrasts = NULL, + contrasts = NULL, methods = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), gene_sets = c("h", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "kegg_disease", "kegg_metabolism", "kegg_signaling"), species, cores = 10, - method = NULL + method = NULL, + .contrasts = NULL ) } \arguments{ @@ -111,7 +117,7 @@ test_gene_enrichment( \item{.abundance}{The name of the transcript/gene abundance column} -\item{.contrasts}{= NULL,} +\item{contrasts}{This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest)} \item{methods}{A character vector. One or 3 or more methods to use in the testing (currently EGSEA errors if 2 are used). Type EGSEA::egsea.base() to see the supported GSE methods.} @@ -122,6 +128,8 @@ test_gene_enrichment( \item{cores}{An integer. The number of cores available} \item{method}{DEPRECATED. Please use methods.} + +\item{.contrasts}{DEPRECATED - This parameter takes the format of the contrast parameter of the method of choice. For edgeR and limma-voom is a character vector. For DESeq2 is a list including a character vector of length three. The first covariate is the one the model is tested against (e.g., ~ factor_of_interest)} } \value{ A consistent object (to the input) diff --git a/tests/testthat/test-bulk_methods.R b/tests/testthat/test-bulk_methods.R index ed44cd17..9bfc1bda 100755 --- a/tests/testthat/test-bulk_methods.R +++ b/tests/testthat/test-bulk_methods.R @@ -338,7 +338,7 @@ test_that("Only differential trancript abundance - no object - with contrasts",{ .sample = a, .transcript = b, .abundance = c, - .contrasts = c( "conditionTRUE - conditionFALSE", "conditionFALSE - conditionTRUE"), + contrasts = c( "conditionTRUE - conditionFALSE", "conditionFALSE - conditionTRUE"), method = "edgeR_likelihood_ratio", action="only" ) @@ -502,7 +502,7 @@ test_that("Only differential trancript abundance - no object - with contrasts",{ .sample = a, .transcript = b, .abundance = c, - .contrasts = c( "conditionTRUE - conditionFALSE", "conditionFALSE - conditionTRUE"), + contrasts = c( "conditionTRUE - conditionFALSE", "conditionFALSE - conditionTRUE"), method = "limma_voom", action="only" ) @@ -574,7 +574,7 @@ test_that("Voom with treat method",{ .sample = a, .transcript = b, .abundance = c, - .contrasts = c("cell_typeb_cell-cell_typemonocyte", "cell_typeb_cell-cell_typet_cell"), + contrasts = c("cell_typeb_cell-cell_typemonocyte", "cell_typeb_cell-cell_typet_cell"), method = "limma_voom", test_above_log2_fold_change = 1, action="only" @@ -753,10 +753,10 @@ test_that("DESeq2 differential trancript abundance - no object",{ # .transcript = b, # .abundance = c, # method = "deseq2", - # .contrasts = "this_is - wrong", + # contrasts = "this_is - wrong", # action="only" # ) %>% - # expect_error("for the moment, the .contrasts argument") + # expect_error("for the moment, the contrasts argument") deseq2_contrasts = input_df %>% @@ -767,7 +767,7 @@ test_that("DESeq2 differential trancript abundance - no object",{ .transcript = b, .abundance = c, method = "deseq2", - .contrasts = list(c("condition", "TRUE", "FALSE")), + contrasts = list(c("condition", "TRUE", "FALSE")), action="only" ) @@ -779,7 +779,7 @@ test_that("DESeq2 differential trancript abundance - no object",{ .sample = a, .transcript = b, .abundance = c, - .contrasts = "conditionTRUE - conditionFALSE", + contrasts = "conditionTRUE - conditionFALSE", action="only" ) diff --git a/tests/testthat/test-bulk_methods_SummarizedExperiment.R b/tests/testthat/test-bulk_methods_SummarizedExperiment.R index d10faafc..a272a352 100755 --- a/tests/testthat/test-bulk_methods_SummarizedExperiment.R +++ b/tests/testthat/test-bulk_methods_SummarizedExperiment.R @@ -302,7 +302,7 @@ test_that("Voom with treat method",{ .sample = a, .transcript = b, .abundance = c, - .contrasts = c("Cell.typeb_cell-Cell.typemonocyte", "Cell.typeb_cell-Cell.typet_cell"), + contrasts = c("Cell.typeb_cell-Cell.typemonocyte", "Cell.typeb_cell-Cell.typet_cell"), method = "limma_voom", test_above_log2_fold_change = 1, action="only"