Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Daenarys8 <rysdaena8@gmail.com>
  • Loading branch information
Daenarys8 committed Jul 25, 2023
1 parent 31307f8 commit dc8f6c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/agglomerate.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ setMethod("mergeFeaturesByRank", signature = c(x = "SummarizedExperiment"),
function(x, rank = taxonomyRanks(x)[1], onRankOnly = FALSE, na.rm = FALSE,
empty.fields = c(NA, "", " ", "\t", "-", "_"), ...){
.Deprecated(old="agglomerateByRank", new="mergeFeaturesByRank", "Now agglomerateByRank is deprecated. Use mergeFeaturesByRank instead.")
x <- agglomerateByRank(x)
x <- agglomerateByRank(x, ...)
x
}
)
Expand Down Expand Up @@ -256,7 +256,7 @@ setMethod("agglomerateByRank", signature = c(x = "SingleCellExperiment"),
setMethod("mergeFeaturesByRank", signature = c(x = "SingleCellExperiment"),
function(x, ..., altexp = NULL, strip_altexp = TRUE){
.Deprecated(old="agglomerateByRank", new="mergeFeaturesByRank", "Now agglomerateByRank is deprecated. Use mergeFeaturesByRank instead.")
x <- agglomerateByRank(x)
x <- agglomerateByRank(x, ...)
x
}
)
Expand Down Expand Up @@ -301,7 +301,7 @@ setMethod("agglomerateByRank", signature = c(x = "TreeSummarizedExperiment"),
setMethod("mergeFeaturesByRank", signature = c(x = "TreeSummarizedExperiment"),
function(x, ..., agglomerateTree = FALSE){
.Deprecated(old="agglomerateByRank", new="mergeFeaturesByRank", "Now agglomerateByRank is deprecated. Use mergeFeaturesByRank instead.")
x <- agglomerateByRank(x)
x <- agglomerateByRank(x,...)
x
}
)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-2merge.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ test_that("merge", {
expect_equal(rowTree(tse), rowTree(merged2))
expect_equal(rowTree(merged), rowTree(merged3))
expect_equal(merged4, merged5)
expect_equal(mergeRows(tse, f=rowData(tse)$group2), mergeFeatures(tse, f=rowData(tse)$group2))

# Both datasets have group variable
merged <- mergeRows(tse, f = rowData(tse)$group, mergeTree = TRUE)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-3agglomerate.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ test_that("agglomerate", {
actual1 <- agglomerateByRank(xtse,"Family")
actual2 <- .merge_features(xtse, merge.by = "Family")
expect_equal(actual1, actual2)
expect_equal(agglomerateByRank(xtse,"Family"), mergeFeaturesByRank(xtse,"Family"))

# Only one rank available in the object -
# the same dimensionality is retained
Expand Down

0 comments on commit dc8f6c1

Please sign in to comment.