Skip to content

Commit ef6f9cb

Browse files
authored
Merge pull request #112 from tidyomics/use-tidy-generics
rely on generics tidy
2 parents 7d03660 + a19b80c commit ef6f9cb

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ Imports:
4141
fansi,
4242
stats,
4343
pkgconfig,
44-
plyxp
44+
plyxp,
45+
generics
4546
Suggests:
4647
BiocStyle,
4748
testthat,

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ S3method(tidy,SummarizedExperiment)
3737
S3method(unite,SummarizedExperiment)
3838
S3method(unnest,tidySummarizedExperiment_nested)
3939
export("%>%")
40-
export(tidy)
4140
export(unnest_summarized_experiment)
4241
importFrom(S4Vectors,"metadata<-")
4342
importFrom(S4Vectors,DataFrame)
@@ -81,6 +80,7 @@ importFrom(dplyr,summarise)
8180
importFrom(dplyr,summarize)
8281
importFrom(dplyr,vars)
8382
importFrom(ellipsis,check_dots_used)
83+
importFrom(generics,tidy)
8484
importFrom(ggplot2,aes)
8585
importFrom(ggplot2,ggplot)
8686
importFrom(lifecycle,deprecate_warn)

R/methods.R

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ setClass("tidySummarizedExperiment",
66
#' @rdname tidy
77
#' @title tidy for `Seurat`
88
#'
9-
#' @param object A `Seurat` object.
109
#' @return A `tidyseurat` object.
1110
#'
1211
#' @examples
@@ -16,13 +15,10 @@ setClass("tidySummarizedExperiment",
1615
#' @references
1716
#' Hutchison, W.J., Keyes, T.J., The tidyomics Consortium. et al. The tidyomics ecosystem: enhancing omic data analyses. Nat Methods 21, 1166–1170 (2024). https://doi.org/10.1038/s41592-024-02299-2
1817
#'
19-
#' @export
20-
tidy <- function(object) {
21-
UseMethod("tidy", object)
22-
}
18+
#' @importFrom generics tidy
2319

2420
#' @importFrom lifecycle deprecate_warn
25-
tidy_ <- function(object) {
21+
tidy_ <- function(x, ...) {
2622

2723
# DEPRECATE
2824
deprecate_warn(
@@ -31,20 +27,22 @@ tidy_ <- function(object) {
3127
details = "tidySummarizedExperiment says: tidy() is not needed anymore."
3228
)
3329

34-
object
30+
x
3531
}
3632

3733
#' @importFrom methods as
3834
#' @rdname tidy
39-
#' @param object A SummarizedExperiment object
35+
#' @param x A SummarizedExperiment object
36+
#' @param ... Additional arguments passed to methods
4037
#' @references
4138
#' Hutchison, W.J., Keyes, T.J., The tidyomics Consortium. et al. The tidyomics ecosystem: enhancing omic data analyses. Nat Methods 21, 1166–1170 (2024). https://doi.org/10.1038/s41592-024-02299-2
4239
#' @export
4340
tidy.SummarizedExperiment <- tidy_
4441

4542
#' @importFrom methods as
4643
#' @rdname tidy
47-
#' @param object A SummarizedExperiment object
44+
#' @param x A SummarizedExperiment object
45+
#' @param ... Additional arguments passed to methods
4846
#' @references
4947
#' Hutchison, W.J., Keyes, T.J., The tidyomics Consortium. et al. The tidyomics ecosystem: enhancing omic data analyses. Nat Methods 21, 1166–1170 (2024). https://doi.org/10.1038/s41592-024-02299-2
5048
#' @export

man/tidy.Rd

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)