From d95c1f8f5319a74f78de158fe15d91544c47dafd Mon Sep 17 00:00:00 2001 From: thpralas Date: Wed, 17 Apr 2024 11:03:51 +0300 Subject: [PATCH 1/3] remove plotNMDS from mia package merge devel --- NAMESPACE | 1 - R/runNMDS.R | 7 ------- man/estimateDiversity.Rd | 2 +- man/hierarchy-tree.Rd | 9 --------- man/runNMDS.Rd | 3 --- man/taxonomy-methods.Rd | 1 - tests/testthat/test-5runNMDS.R | 4 ---- 7 files changed, 1 insertion(+), 26 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index f6d645f33..fa64ed7bf 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -74,7 +74,6 @@ export(mergeSamples) export(perSampleDominantFeatures) export(perSampleDominantTaxa) export(performDMNgroupCV) -export(plotNMDS) export(readQZA) export(relAbundanceCounts) export(relabundance) diff --git a/R/runNMDS.R b/R/runNMDS.R index db9f85e4b..3991b0ca0 100644 --- a/R/runNMDS.R +++ b/R/runNMDS.R @@ -216,10 +216,3 @@ runNMDS <- function(x, ..., altexp = NULL, name = "NMDS") { reducedDim(x, name) <- calculateNMDS(y, ...) x } - -#' @rdname runNMDS -#' @export -plotNMDS <- function(x, ..., ncomponents = 2){ - plotReducedDim(x, ncomponents = ncomponents, dimred = "NMDS", - ...) -} diff --git a/man/estimateDiversity.Rd b/man/estimateDiversity.Rd index ac033b912..dba7006f4 100644 --- a/man/estimateDiversity.Rd +++ b/man/estimateDiversity.Rd @@ -102,7 +102,7 @@ By default, \code{quantile} is 0.5.} from zero to the quantile cutoff indicated by \code{quantile}. By default, \code{num_of_classes} is 50.} \item{only.tips}{ A boolean value specifying whether to remove internal -nodes when Faith's inex is calculated. When \code{only.tips=TRUE}, those +nodes when Faith's index is calculated. When \code{only.tips=TRUE}, those rows that are not tips of tree are removed. (By default: \code{only.tips=FALSE})} }} diff --git a/man/hierarchy-tree.Rd b/man/hierarchy-tree.Rd index bcfc1069c..afeffe90c 100644 --- a/man/hierarchy-tree.Rd +++ b/man/hierarchy-tree.Rd @@ -62,13 +62,4 @@ getHierarchyTree(tse) # Please note that any tree already stored in rowTree() will be overwritten. tse <- addHierarchyTree(tse) tse - -# For instance, the TreeSummarizedExperiment Tengeler2020 contains an -# actual phylogenetic tree. - -data(Tengeler2020) -tse2 <- Tengeler2020 -phylo_tree <- rowTree(tse2) -phylo_tree - } diff --git a/man/runNMDS.Rd b/man/runNMDS.Rd index a3c636800..8e5eb028f 100644 --- a/man/runNMDS.Rd +++ b/man/runNMDS.Rd @@ -6,7 +6,6 @@ \alias{calculateNMDS,ANY-method} \alias{calculateNMDS,SummarizedExperiment-method} \alias{calculateNMDS,SingleCellExperiment-method} -\alias{plotNMDS} \title{Perform non-metric MDS on sample-level data} \usage{ calculateNMDS(x, ...) @@ -45,8 +44,6 @@ calculateNMDS(x, ...) ) runNMDS(x, ..., altexp = NULL, name = "NMDS") - -plotNMDS(x, ..., ncomponents = 2) } \arguments{ \item{x}{For \code{calculateNMDS}, a numeric matrix of expression values diff --git a/man/taxonomy-methods.Rd b/man/taxonomy-methods.Rd index 2e9c2a6b3..87b0b894a 100644 --- a/man/taxonomy-methods.Rd +++ b/man/taxonomy-methods.Rd @@ -188,7 +188,6 @@ setTaxonomyRanks(colnames(rowData(tse))) # getTaxonomyRanks is to get/check if the taxonomic ranks is set to "TAXA1" getTaxonomyRanks() - } \seealso{ \code{\link[=agglomerate-methods]{agglomerateByRank}}, diff --git a/tests/testthat/test-5runNMDS.R b/tests/testthat/test-5runNMDS.R index d7c504bd4..956adae7e 100644 --- a/tests/testthat/test-5runNMDS.R +++ b/tests/testthat/test-5runNMDS.R @@ -22,8 +22,4 @@ test_that("runNMDS", { expect_equal(dim(reducedDim(esophagus,"BC")),c(3,2)) expect_true(is.matrix(reducedDim(esophagus,"BC"))) expect_equal(dim(reducedDim(esophagus,"BC")),c(3,2)) - # - esophagus <- runNMDS(esophagus) - plot <- plotNMDS(esophagus) - expect_s3_class(plot,c("gg","ggplot")) }) From 05f5d90fe47c7d61b9048a6d0500825fdeeb2918 Mon Sep 17 00:00:00 2001 From: thpralas Date: Wed, 17 Apr 2024 11:35:11 +0300 Subject: [PATCH 2/3] deprecate plotNMDS --- NAMESPACE | 1 + R/deprecate.R | 9 +++++++++ man/deprecate.Rd | 3 +++ 3 files changed, 13 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index fa64ed7bf..f6d645f33 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -74,6 +74,7 @@ export(mergeSamples) export(perSampleDominantFeatures) export(perSampleDominantTaxa) export(performDMNgroupCV) +export(plotNMDS) export(readQZA) export(relAbundanceCounts) export(relabundance) diff --git a/R/deprecate.R b/R/deprecate.R index e7de57ff7..a1b3c7ac8 100644 --- a/R/deprecate.R +++ b/R/deprecate.R @@ -104,3 +104,12 @@ loadFromHumann <- function(...) { " Use 'importHUMAnN' instead.")) importHUMAnN(...) } + +#' @rdname deprecate +#' @export +plotNMDS <- function(x, ...){ + .Deprecated(msg = paste0("'plotNMDS' is deprecated. ", + "Use 'scater::plotReducedDim' with ", + "dimred = 'NMDS' instead.")) + plotReducedDim(x, ncomponents = 2, dimred = "NMDS",...) +} diff --git a/man/deprecate.Rd b/man/deprecate.Rd index 31d5fa706..c8a0877d5 100644 --- a/man/deprecate.Rd +++ b/man/deprecate.Rd @@ -14,6 +14,7 @@ \alias{loadFromMothur} \alias{loadFromMetaphlan} \alias{loadFromHumann} +\alias{plotNMDS} \title{These functions will be deprecated. Please use other functions instead.} \usage{ cluster(x, ...) @@ -39,6 +40,8 @@ loadFromMothur(...) loadFromMetaphlan(...) loadFromHumann(...) + +plotNMDS(x, ...) } \arguments{ \item{x}{A From ba4b7a9d3b9ec0a249e93504c62f00e77bf51522 Mon Sep 17 00:00:00 2001 From: thpralas Date: Wed, 17 Apr 2024 11:36:14 +0300 Subject: [PATCH 3/3] up --- DESCRIPTION | 2 +- NEWS | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 38c76d2ef..e81c257c1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: mia Type: Package -Version: 1.11.10 +Version: 1.11.11 Authors@R: c(person(given = "Felix G.M.", family = "Ernst", role = c("aut"), email = "felix.gm.ernst@outlook.com", diff --git a/NEWS b/NEWS index dccefd5d3..d785f6549 100644 --- a/NEWS +++ b/NEWS @@ -108,3 +108,4 @@ Changes in version 1.11.x + Rename cluster to addCluster + rename importers loadFromBiom, loadFromQIIME2, readQZA, loadFromMothur, loadFromMetaphlan, loadFromHumann ++ deprecate plotNMDS after moving it to miaViz package