From 9725b09580a74e7342e1b582cbbedb0e547f6dbc Mon Sep 17 00:00:00 2001 From: almeidasilvaf Date: Fri, 17 Nov 2023 15:17:40 +0100 Subject: [PATCH] Added option to specify level for midparent values --- R/02_de_analyses.R | 8 ++++++-- man/get_deg_list.Rd | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/R/02_de_analyses.R b/R/02_de_analyses.R index 86f0b1d..c9ed39f 100644 --- a/R/02_de_analyses.R +++ b/R/02_de_analyses.R @@ -13,6 +13,9 @@ #' @param offspring Character indicating which level of the #' variable \strong{coldata_column} represents the offspring (hybrid #' or allopolyploid). Default: "F1" +#' @param midparent Character indicating which level of the variable +#' \strong{coldata_column} represents the midparent value. Default: +#' "midparent", as returned by \code{add_midparent_expression()}. #' @param spikein_norm Logical indicating whether or not to normalize data #' using spike-ins. Default: FALSE. #' @param spikein_pattern Character with the pattern (regex) to use @@ -55,7 +58,8 @@ #' deg_list <- get_deg_list(se, spikein_norm = TRUE) get_deg_list <- function( se, coldata_column = "Generation", - parent1 = "P1", parent2 = "P2", offspring = "F1", + parent1 = "P1", parent2 = "P2", offspring = "F1", + midparent = "midparent", spikein_norm = FALSE, spikein_pattern = "ERCC", lfcThreshold = 0, alpha = 0.01, @@ -88,7 +92,7 @@ get_deg_list <- function( "P2_vs_P1" = c(parent2, parent1), "F1_vs_P1" = c(offspring, parent1), "F1_vs_P2" = c(offspring, parent2), - "F1_vs_midparent" = c(offspring, "midparent") + "F1_vs_midparent" = c(offspring, midparent) ) dge_list <- lapply(contrasts, function(x) { diff --git a/man/get_deg_list.Rd b/man/get_deg_list.Rd index 43922b9..db08be7 100644 --- a/man/get_deg_list.Rd +++ b/man/get_deg_list.Rd @@ -10,6 +10,7 @@ get_deg_list( parent1 = "P1", parent2 = "P2", offspring = "F1", + midparent = "midparent", spikein_norm = FALSE, spikein_pattern = "ERCC", lfcThreshold = 0, @@ -35,6 +36,10 @@ variable \strong{coldata_column} represents parent 2. Default: "P2".} variable \strong{coldata_column} represents the offspring (hybrid or allopolyploid). Default: "F1"} +\item{midparent}{Character indicating which level of the variable +\strong{coldata_column} represents the midparent value. Default: +"midparent", as returned by \code{add_midparent_expression()}.} + \item{spikein_norm}{Logical indicating whether or not to normalize data using spike-ins. Default: FALSE.}