From 6a7b6ef3756424ddac1421d095081781788f8cdc Mon Sep 17 00:00:00 2001 From: Daenarys8 Date: Thu, 27 Jul 2023 10:07:04 +0100 Subject: [PATCH 1/4] Rename agglomerateByRank/Prevalence Signed-off-by: Daenarys8 --- R/plotAbundance.R | 2 +- R/plotGraph.R | 4 ++-- R/plotPrevalence.R | 10 +++++----- R/plotSeries.R | 2 +- man/plotAbundance.Rd | 2 +- man/plotGraph.Rd | 4 ++-- man/plotPrevalence.Rd | 10 +++++----- tests/testthat/test-2plotGraph.R | 2 +- tests/testthat/test-2plotTree.R | 2 +- vignettes/miaViz.Rmd | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/R/plotAbundance.R b/R/plotAbundance.R index d1943870..c2be97b6 100644 --- a/R/plotAbundance.R +++ b/R/plotAbundance.R @@ -111,7 +111,7 @@ #' #' # Getting top taxa on a Phylum level #' se <- transformCounts(se, method="relabundance") -#' se_phylum <- agglomerateByRank(se, rank ="Phylum", onRankOnly=TRUE) +#' se_phylum <- `mergeFeaturesByRank(se, rank ="Phylum", onRankOnly=TRUE) #' top_taxa <- getTopTaxa(se_phylum,top = 5, assay.type = "relabundance") #' #' # Renaming the "Phylum" rank to keep only top taxa and the rest to "Other" diff --git a/R/plotGraph.R b/R/plotGraph.R index 99ecc1e5..b54257c6 100644 --- a/R/plotGraph.R +++ b/R/plotGraph.R @@ -88,9 +88,9 @@ #' data(row_graph_order) #' metadata(GlobalPatterns)$col_graph <- col_graph #' -#' genus <- agglomerateByRank(GlobalPatterns,"Genus",na.rm=TRUE) +#' genus <- `mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) #' metadata(genus)$row_graph <- row_graph -#' order <- agglomerateByRank(genus,"Order",na.rm=TRUE) +#' order <- `mergeFeaturesByRank(genus,"Order",na.rm=TRUE) #' metadata(order)$row_graph <- row_graph_order #' #' # plot a graph independently diff --git a/R/plotPrevalence.R b/R/plotPrevalence.R index 7a64cbe5..811fa4a0 100644 --- a/R/plotPrevalence.R +++ b/R/plotPrevalence.R @@ -13,8 +13,8 @@ #' @param rank,... additional arguments #' \itemize{ #' \item{If \code{!is.null(rank)} matching arguments are passed on to -#' \code{\link[=agglomerate-methods]{agglomerateByRank}}. See -#' \code{\link[=agglomerate-methods]{?agglomerateByRank}} for more details. +#' \code{\link[=agglomerate-methods]{`mergeFeaturesByRank}}. See +#' \code{\link[=agglomerate-methods]{?`mergeFeaturesByRank}} for more details. #' } #' \item{additional arguments for plotting. See #' \code{\link{mia-plot-args}} for more details i.e. call \code{help("mia-plot-args")}} @@ -79,7 +79,7 @@ #' #' To exclude certain taxa, preprocess \code{x} to your liking, for example #' with subsetting via \code{getPrevalentTaxa} or -#' \code{agglomerateByPrevalence}. +#' \code{`mergeFeaturesByPrevalence}. #' #' @return #' A \code{ggplot2} object or \code{plotly} object, if more than one @@ -87,8 +87,8 @@ #' #' @seealso #' \code{\link[mia:getPrevalence]{getPrevalence}}, -#' \code{\link[mia:getPrevalence]{agglomerateByPrevalence}}, -#' \code{\link[mia:agglomerate-methods]{agglomerateByRank}} +#' \code{\link[mia:getPrevalence]{`mergeFeaturesByPrevalence}}, +#' \code{\link[mia:agglomerate-methods]{`mergeFeaturesByRank}} #' #' @name plotPrevalence #' diff --git a/R/plotSeries.R b/R/plotSeries.R index 637a524c..6c987c24 100644 --- a/R/plotSeries.R +++ b/R/plotSeries.R @@ -134,7 +134,7 @@ setMethod("plotSeries", signature = c(object = "SummarizedExperiment"), .check_taxonomic_rank(rank, object) # Agglomerates the object - object <- agglomerateByRank(object, rank = rank) + object <- `mergeFeaturesByRank(object, rank = rank) } # Checks Y diff --git a/man/plotAbundance.Rd b/man/plotAbundance.Rd index bffe42bb..88340664 100644 --- a/man/plotAbundance.Rd +++ b/man/plotAbundance.Rd @@ -135,7 +135,7 @@ wrap_plots(plot, ncol = 1, heights = c(0.8,0.2)) # Getting top taxa on a Phylum level se <- transformCounts(se, method="relabundance") -se_phylum <- agglomerateByRank(se, rank ="Phylum", onRankOnly=TRUE) +se_phylum <- `mergeFeaturesByRank(se, rank ="Phylum", onRankOnly=TRUE) top_taxa <- getTopTaxa(se_phylum,top = 5, assay.type = "relabundance") # Renaming the "Phylum" rank to keep only top taxa and the rest to "Other" diff --git a/man/plotGraph.Rd b/man/plotGraph.Rd index 749a3acb..413f99bf 100644 --- a/man/plotGraph.Rd +++ b/man/plotGraph.Rd @@ -142,9 +142,9 @@ data(row_graph) data(row_graph_order) metadata(GlobalPatterns)$col_graph <- col_graph -genus <- agglomerateByRank(GlobalPatterns,"Genus",na.rm=TRUE) +genus <- `mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) metadata(genus)$row_graph <- row_graph -order <- agglomerateByRank(genus,"Order",na.rm=TRUE) +order <- `mergeFeaturesByRank(genus,"Order",na.rm=TRUE) metadata(order)$row_graph <- row_graph_order # plot a graph independently diff --git a/man/plotPrevalence.Rd b/man/plotPrevalence.Rd index 9975a7f7..1b191cdf 100644 --- a/man/plotPrevalence.Rd +++ b/man/plotPrevalence.Rd @@ -82,8 +82,8 @@ on compositional (relative) abundances? Passed onto \item{rank, ...}{additional arguments \itemize{ \item{If \code{!is.null(rank)} matching arguments are passed on to -\code{\link[=agglomerate-methods]{agglomerateByRank}}. See -\code{\link[=agglomerate-methods]{?agglomerateByRank}} for more details. +\code{\link[=agglomerate-methods]{`mergeFeaturesByRank}}. See +\code{\link[=agglomerate-methods]{?`mergeFeaturesByRank}} for more details. } \item{additional arguments for plotting. See \code{\link{mia-plot-args}} for more details i.e. call \code{help("mia-plot-args")}} @@ -141,7 +141,7 @@ Agglomeration on different taxonomic levels is available through the To exclude certain taxa, preprocess \code{x} to your liking, for example with subsetting via \code{getPrevalentTaxa} or -\code{agglomerateByPrevalence}. +\code{`mergeFeaturesByPrevalence}. } \examples{ data(GlobalPatterns, package = "mia") @@ -172,6 +172,6 @@ plotPrevalentAbundance(GlobalPatterns, rank = "Family", } \seealso{ \code{\link[mia:getPrevalence]{getPrevalence}}, -\code{\link[mia:getPrevalence]{agglomerateByPrevalence}}, -\code{\link[mia:agglomerate-methods]{agglomerateByRank}} +\code{\link[mia:getPrevalence]{`mergeFeaturesByPrevalence}}, +\code{\link[mia:agglomerate-methods]{`mergeFeaturesByRank}} } diff --git a/tests/testthat/test-2plotGraph.R b/tests/testthat/test-2plotGraph.R index d2bc6462..8000589a 100644 --- a/tests/testthat/test-2plotGraph.R +++ b/tests/testthat/test-2plotGraph.R @@ -50,7 +50,7 @@ test_that("plot graph", { expect_equal(miaViz:::.colnames_tbl_graph(actual,"edges"), c("from","to","weight")) # - genus <- agglomerateByRank(GlobalPatterns,"Genus",na.rm=TRUE) + genus <- `mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) plot <- plotColGraph(col_graph, genus, colour_by = "SampleType", diff --git a/tests/testthat/test-2plotTree.R b/tests/testthat/test-2plotTree.R index 8402e3ca..f51ca142 100644 --- a/tests/testthat/test-2plotTree.R +++ b/tests/testthat/test-2plotTree.R @@ -58,7 +58,7 @@ test_that("plot tree", { library(scater) library(mia) data(GlobalPatterns) - altExp(GlobalPatterns,"genus") <- agglomerateByRank(GlobalPatterns,"Genus", make_unique = FALSE) + altExp(GlobalPatterns,"genus") <- `mergeFeaturesByRank(GlobalPatterns,"Genus", make_unique = FALSE) altExp(GlobalPatterns,"genus") <- addPerFeatureQC(altExp(GlobalPatterns,"genus")) rowData(altExp(GlobalPatterns,"genus"))$log_mean <- log(rowData(altExp(GlobalPatterns,"genus"))$mean) top_taxa <- getTopTaxa(altExp(GlobalPatterns,"genus"), diff --git a/vignettes/miaViz.Rmd b/vignettes/miaViz.Rmd index 2fbceaea..85e58686 100644 --- a/vignettes/miaViz.Rmd +++ b/vignettes/miaViz.Rmd @@ -149,7 +149,7 @@ library(scater) library(mia) ``` ```{r} -altExp(GlobalPatterns,"Genus") <- agglomerateByRank(GlobalPatterns,"Genus") +altExp(GlobalPatterns,"Genus") <- `mergeFeaturesByRank(GlobalPatterns,"Genus") altExp(GlobalPatterns,"Genus") <- addPerFeatureQC(altExp(GlobalPatterns,"Genus")) rowData(altExp(GlobalPatterns,"Genus"))$log_mean <- log(rowData(altExp(GlobalPatterns,"Genus"))$mean) From a80708a5b1475ac09216976d47171ec4445171c1 Mon Sep 17 00:00:00 2001 From: Daenarys8 Date: Thu, 27 Jul 2023 10:51:12 +0100 Subject: [PATCH 2/4] Up Signed-off-by: Daenarys8 --- R/plotAbundance.R | 2 +- R/plotGraph.R | 4 ++-- R/plotPrevalence.R | 10 +++++----- R/plotSeries.R | 2 +- man/plotAbundance.Rd | 2 +- man/plotGraph.Rd | 4 ++-- man/plotPrevalence.Rd | 10 +++++----- tests/testthat/test-2plotGraph.R | 2 +- tests/testthat/test-2plotTree.R | 2 +- vignettes/miaViz.Rmd | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/R/plotAbundance.R b/R/plotAbundance.R index c2be97b6..22bdd805 100644 --- a/R/plotAbundance.R +++ b/R/plotAbundance.R @@ -111,7 +111,7 @@ #' #' # Getting top taxa on a Phylum level #' se <- transformCounts(se, method="relabundance") -#' se_phylum <- `mergeFeaturesByRank(se, rank ="Phylum", onRankOnly=TRUE) +#' se_phylum <- mergeFeaturesByRank(se, rank ="Phylum", onRankOnly=TRUE) #' top_taxa <- getTopTaxa(se_phylum,top = 5, assay.type = "relabundance") #' #' # Renaming the "Phylum" rank to keep only top taxa and the rest to "Other" diff --git a/R/plotGraph.R b/R/plotGraph.R index b54257c6..bec9e038 100644 --- a/R/plotGraph.R +++ b/R/plotGraph.R @@ -88,9 +88,9 @@ #' data(row_graph_order) #' metadata(GlobalPatterns)$col_graph <- col_graph #' -#' genus <- `mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) +#' genus <- mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) #' metadata(genus)$row_graph <- row_graph -#' order <- `mergeFeaturesByRank(genus,"Order",na.rm=TRUE) +#' order <- mergeFeaturesByRank(genus,"Order",na.rm=TRUE) #' metadata(order)$row_graph <- row_graph_order #' #' # plot a graph independently diff --git a/R/plotPrevalence.R b/R/plotPrevalence.R index 811fa4a0..c0192d53 100644 --- a/R/plotPrevalence.R +++ b/R/plotPrevalence.R @@ -13,8 +13,8 @@ #' @param rank,... additional arguments #' \itemize{ #' \item{If \code{!is.null(rank)} matching arguments are passed on to -#' \code{\link[=agglomerate-methods]{`mergeFeaturesByRank}}. See -#' \code{\link[=agglomerate-methods]{?`mergeFeaturesByRank}} for more details. +#' \code{\link[=agglomerate-methods]{mergeFeaturesByRank}}. See +#' \code{\link[=agglomerate-methods]{?mergeFeaturesByRank}} for more details. #' } #' \item{additional arguments for plotting. See #' \code{\link{mia-plot-args}} for more details i.e. call \code{help("mia-plot-args")}} @@ -79,7 +79,7 @@ #' #' To exclude certain taxa, preprocess \code{x} to your liking, for example #' with subsetting via \code{getPrevalentTaxa} or -#' \code{`mergeFeaturesByPrevalence}. +#' \code{mergeFeaturesByPrevalence}. #' #' @return #' A \code{ggplot2} object or \code{plotly} object, if more than one @@ -87,8 +87,8 @@ #' #' @seealso #' \code{\link[mia:getPrevalence]{getPrevalence}}, -#' \code{\link[mia:getPrevalence]{`mergeFeaturesByPrevalence}}, -#' \code{\link[mia:agglomerate-methods]{`mergeFeaturesByRank}} +#' \code{\link[mia:getPrevalence]{mergeFeaturesByPrevalence}}, +#' \code{\link[mia:agglomerate-methods]{mergeFeaturesByRank}} #' #' @name plotPrevalence #' diff --git a/R/plotSeries.R b/R/plotSeries.R index 6c987c24..d61b23d8 100644 --- a/R/plotSeries.R +++ b/R/plotSeries.R @@ -134,7 +134,7 @@ setMethod("plotSeries", signature = c(object = "SummarizedExperiment"), .check_taxonomic_rank(rank, object) # Agglomerates the object - object <- `mergeFeaturesByRank(object, rank = rank) + object <- mergeFeaturesByRank(object, rank = rank) } # Checks Y diff --git a/man/plotAbundance.Rd b/man/plotAbundance.Rd index 88340664..595d87b6 100644 --- a/man/plotAbundance.Rd +++ b/man/plotAbundance.Rd @@ -135,7 +135,7 @@ wrap_plots(plot, ncol = 1, heights = c(0.8,0.2)) # Getting top taxa on a Phylum level se <- transformCounts(se, method="relabundance") -se_phylum <- `mergeFeaturesByRank(se, rank ="Phylum", onRankOnly=TRUE) +se_phylum <- mergeFeaturesByRank(se, rank ="Phylum", onRankOnly=TRUE) top_taxa <- getTopTaxa(se_phylum,top = 5, assay.type = "relabundance") # Renaming the "Phylum" rank to keep only top taxa and the rest to "Other" diff --git a/man/plotGraph.Rd b/man/plotGraph.Rd index 413f99bf..8401eeb6 100644 --- a/man/plotGraph.Rd +++ b/man/plotGraph.Rd @@ -142,9 +142,9 @@ data(row_graph) data(row_graph_order) metadata(GlobalPatterns)$col_graph <- col_graph -genus <- `mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) +genus <- mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) metadata(genus)$row_graph <- row_graph -order <- `mergeFeaturesByRank(genus,"Order",na.rm=TRUE) +order <- mergeFeaturesByRank(genus,"Order",na.rm=TRUE) metadata(order)$row_graph <- row_graph_order # plot a graph independently diff --git a/man/plotPrevalence.Rd b/man/plotPrevalence.Rd index 1b191cdf..3e64c537 100644 --- a/man/plotPrevalence.Rd +++ b/man/plotPrevalence.Rd @@ -82,8 +82,8 @@ on compositional (relative) abundances? Passed onto \item{rank, ...}{additional arguments \itemize{ \item{If \code{!is.null(rank)} matching arguments are passed on to -\code{\link[=agglomerate-methods]{`mergeFeaturesByRank}}. See -\code{\link[=agglomerate-methods]{?`mergeFeaturesByRank}} for more details. +\code{\link[=agglomerate-methods]{mergeFeaturesByRank}}. See +\code{\link[=agglomerate-methods]{?mergeFeaturesByRank}} for more details. } \item{additional arguments for plotting. See \code{\link{mia-plot-args}} for more details i.e. call \code{help("mia-plot-args")}} @@ -141,7 +141,7 @@ Agglomeration on different taxonomic levels is available through the To exclude certain taxa, preprocess \code{x} to your liking, for example with subsetting via \code{getPrevalentTaxa} or -\code{`mergeFeaturesByPrevalence}. +\code{mergeFeaturesByPrevalence}. } \examples{ data(GlobalPatterns, package = "mia") @@ -172,6 +172,6 @@ plotPrevalentAbundance(GlobalPatterns, rank = "Family", } \seealso{ \code{\link[mia:getPrevalence]{getPrevalence}}, -\code{\link[mia:getPrevalence]{`mergeFeaturesByPrevalence}}, -\code{\link[mia:agglomerate-methods]{`mergeFeaturesByRank}} +\code{\link[mia:getPrevalence]{mergeFeaturesByPrevalence}}, +\code{\link[mia:agglomerate-methods]{mergeFeaturesByRank}} } diff --git a/tests/testthat/test-2plotGraph.R b/tests/testthat/test-2plotGraph.R index 8000589a..5ebaadcc 100644 --- a/tests/testthat/test-2plotGraph.R +++ b/tests/testthat/test-2plotGraph.R @@ -50,7 +50,7 @@ test_that("plot graph", { expect_equal(miaViz:::.colnames_tbl_graph(actual,"edges"), c("from","to","weight")) # - genus <- `mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) + genus <- mergeFeaturesByRank(GlobalPatterns,"Genus",na.rm=TRUE) plot <- plotColGraph(col_graph, genus, colour_by = "SampleType", diff --git a/tests/testthat/test-2plotTree.R b/tests/testthat/test-2plotTree.R index f51ca142..0073f013 100644 --- a/tests/testthat/test-2plotTree.R +++ b/tests/testthat/test-2plotTree.R @@ -58,7 +58,7 @@ test_that("plot tree", { library(scater) library(mia) data(GlobalPatterns) - altExp(GlobalPatterns,"genus") <- `mergeFeaturesByRank(GlobalPatterns,"Genus", make_unique = FALSE) + altExp(GlobalPatterns,"genus") <- mergeFeaturesByRank(GlobalPatterns,"Genus", make_unique = FALSE) altExp(GlobalPatterns,"genus") <- addPerFeatureQC(altExp(GlobalPatterns,"genus")) rowData(altExp(GlobalPatterns,"genus"))$log_mean <- log(rowData(altExp(GlobalPatterns,"genus"))$mean) top_taxa <- getTopTaxa(altExp(GlobalPatterns,"genus"), diff --git a/vignettes/miaViz.Rmd b/vignettes/miaViz.Rmd index 85e58686..f8951e39 100644 --- a/vignettes/miaViz.Rmd +++ b/vignettes/miaViz.Rmd @@ -149,7 +149,7 @@ library(scater) library(mia) ``` ```{r} -altExp(GlobalPatterns,"Genus") <- `mergeFeaturesByRank(GlobalPatterns,"Genus") +altExp(GlobalPatterns,"Genus") <- mergeFeaturesByRank(GlobalPatterns,"Genus") altExp(GlobalPatterns,"Genus") <- addPerFeatureQC(altExp(GlobalPatterns,"Genus")) rowData(altExp(GlobalPatterns,"Genus"))$log_mean <- log(rowData(altExp(GlobalPatterns,"Genus"))$mean) From aff2127dbc7709c498de4e03021301b77fcfa0ce Mon Sep 17 00:00:00 2001 From: Daenarys8 Date: Sat, 5 Aug 2023 10:57:26 +0100 Subject: [PATCH 3/4] Up Signed-off-by: Daenarys8 --- DESCRIPTION | 3 ++- NEWS | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fdacfcc3..76414e2e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: miaViz Title: Microbiome Analysis Plotting and Visualization -Version: 1.9.2 +Version: 1.9.3 Authors@R: c(person(given = "Tuomas", family = "Borman", role = c("aut", "cre"), email = "tuomas.v.borman@utu.fi", @@ -12,6 +12,7 @@ Authors@R: email = "leo.lahti@iki.fi", comment = c(ORCID = "0000-0001-5537-637X")), person(given = "Basil", family = "Courbayre", role = c("ctb")) + person(given = "Muluh", family = "Muluh", role=c("ctb")) ) Description: The miaViz package implements functions to visualize TreeSummarizedExperiment objects especially in the context of microbiome diff --git a/NEWS b/NEWS index 45477bdf..f51dd3fa 100644 --- a/NEWS +++ b/NEWS @@ -19,4 +19,5 @@ Changes in version 1.7.x + Fixed plotGraph* that was broked due changes in dependencies Changes in version 1.9.x -+ Updated plotDMN to work with newest mia version \ No newline at end of file ++ Updated plotDMN to work with newest mia version ++ deprecate agglomerateByRank and agglomerateByPrevalence From 99fac620832d72ec33242e28a905d9226f33ce90 Mon Sep 17 00:00:00 2001 From: Daenarys8 Date: Tue, 8 Aug 2023 10:35:08 +0100 Subject: [PATCH 4/4] Up Signed-off-by: Daenarys8 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 76414e2e..95e74db4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,7 @@ Authors@R: person(given = "Leo", family = "Lahti", role = c("aut"), email = "leo.lahti@iki.fi", comment = c(ORCID = "0000-0001-5537-637X")), - person(given = "Basil", family = "Courbayre", role = c("ctb")) + person(given = "Basil", family = "Courbayre", role = c("ctb")), person(given = "Muluh", family = "Muluh", role=c("ctb")) ) Description: The miaViz package implements functions to visualize