From 79ae6b92ccd2497b6fb69527ed782bfae7206bc7 Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Fri, 10 May 2024 13:42:47 +0930 Subject: [PATCH 1/2] return tibble with get action --- DESCRIPTION | 2 +- R/methods_SE.R | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index eec2a78f..82f3b652 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: tidybulk Title: Brings transcriptomics to the tidyverse -Version: 1.15.8 +Version: 1.15.9 Authors@R: c(person("Stefano", "Mangiola", email = "mangiolastefano@gmail.com", role = c("aut", "cre")), person("Maria", "Doyle", email = "Maria.Doyle@petermac.org", diff --git a/R/methods_SE.R b/R/methods_SE.R index 8aa478b5..c161cc0d 100755 --- a/R/methods_SE.R +++ b/R/methods_SE.R @@ -1476,22 +1476,21 @@ such as batch effects (if applicable) in the formula. else stop("tidybulk says: the only methods supported at the moment are \"edgeR_quasi_likelihood\" (i.e., QLF), \"edgeR_likelihood_ratio\" (i.e., LRT), \"limma_voom\", \"limma_voom_sample_weights\", \"DESeq2\", \"glmmseq_lme4\", \"glmmseq_glmmTMB\"") - - statistics = - my_differential_abundance$result %>% - as_matrix(rownames = "transcript") %>% - .[match(rownames(rowData(.data)), rownames(.)),,drop=FALSE] - # If action is get just return the statistics - if(action == "get") return(statistics) - + if(action == "get") return(my_differential_abundance$result) + # Add results - rowData(.data) = rowData(.data) %>% cbind(statistics) + rowData(.data) = rowData(.data) %>% cbind( + + # Parse the statistics + my_differential_abundance$result %>% + as_matrix(rownames = "transcript") %>% + .[match(rownames(rowData(.data)), rownames(.)),,drop=FALSE] + ) .data %>% - # Add bibliography when( tolower(method) == "edger_likelihood_ratio" ~ (.) %>% memorise_methods_used(c("edger", "edgeR_likelihood_ratio")), From b328287cb17befa91c61309223b6f7f164084324 Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Fri, 10 May 2024 13:42:47 +0930 Subject: [PATCH 2/2] return tibble with get action --- DESCRIPTION | 2 +- R/methods_SE.R | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cb5aa2b2..f42f43ba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: tidybulk Title: Brings transcriptomics to the tidyverse -Version: 1.17.1 +Version: 1.17.2 Authors@R: c(person("Stefano", "Mangiola", email = "mangiolastefano@gmail.com", role = c("aut", "cre")), person("Maria", "Doyle", email = "Maria.Doyle@petermac.org", diff --git a/R/methods_SE.R b/R/methods_SE.R index 89edcddf..48443d1b 100755 --- a/R/methods_SE.R +++ b/R/methods_SE.R @@ -1479,22 +1479,21 @@ such as batch effects (if applicable) in the formula. else stop("tidybulk says: the only methods supported at the moment are \"edgeR_quasi_likelihood\" (i.e., QLF), \"edgeR_likelihood_ratio\" (i.e., LRT), \"limma_voom\", \"limma_voom_sample_weights\", \"DESeq2\", \"glmmseq_lme4\", \"glmmseq_glmmTMB\"") - - statistics = - my_differential_abundance$result %>% - as_matrix(rownames = "transcript") %>% - .[match(rownames(rowData(.data)), rownames(.)),,drop=FALSE] - # If action is get just return the statistics - if(action == "get") return(statistics) - + if(action == "get") return(my_differential_abundance$result) + # Add results - rowData(.data) = rowData(.data) %>% cbind(statistics) + rowData(.data) = rowData(.data) %>% cbind( + + # Parse the statistics + my_differential_abundance$result %>% + as_matrix(rownames = "transcript") %>% + .[match(rownames(rowData(.data)), rownames(.)),,drop=FALSE] + ) .data %>% - # Add bibliography when( tolower(method) == "edger_likelihood_ratio" ~ (.) %>% memorise_methods_used(c("edger", "edgeR_likelihood_ratio")),