From 3073ed43696b2f70af84ae22df335d5e73bfadc9 Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Wed, 29 Oct 2025 17:18:45 +1030 Subject: [PATCH 1/3] use generics package --- DESCRIPTION | 5 +++-- NAMESPACE | 2 +- R/methods.R | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 247b189..338ec0b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: tidySingleCellExperiment Title: Brings SingleCellExperiment to the Tidyverse -Version: 1.19.3 +Version: 1.19.4 Authors@R: c(person("Stefano", "Mangiola", comment=c(ORCID="0000-0001-7474-836X"), email="mangiolastefano@gmail.com", @@ -42,7 +42,8 @@ Imports: cli, fansi, Matrix, - stats + stats, + generics Suggests: BiocStyle, testthat, diff --git a/NAMESPACE b/NAMESPACE index 1b89dc6..c94abf9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -47,7 +47,7 @@ S3method(unite,SingleCellExperiment) S3method(unnest,tidySingleCellExperiment_nested) export("%>%") export(join_transcripts) -export(tidy) +importFrom(generics,tidy) export(unnest_single_cell_experiment) exportMethods(join_features) importFrom(Matrix,rowSums) diff --git a/R/methods.R b/R/methods.R index 50343c4..fe30cbe 100755 --- a/R/methods.R +++ b/R/methods.R @@ -107,10 +107,9 @@ setMethod("join_features", "SingleCellExperiment", function(.data, #' @references #' 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 #' +#' @importFrom generics tidy #' @export -tidy <- function(object) { - UseMethod("tidy", object) -} +generics::tidy #' @rdname tidy #' @importFrom lifecycle deprecate_warn From 17e548110d81565e738e33b145c3e842f04dedc3 Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Wed, 29 Oct 2025 17:43:53 +1030 Subject: [PATCH 2/3] do not reexport --- NAMESPACE | 2 +- R/methods.R | 2 -- man/tidy.Rd | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index c94abf9..810e0fa 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -47,7 +47,6 @@ S3method(unite,SingleCellExperiment) S3method(unnest,tidySingleCellExperiment_nested) export("%>%") export(join_transcripts) -importFrom(generics,tidy) export(unnest_single_cell_experiment) exportMethods(join_features) importFrom(Matrix,rowSums) @@ -101,6 +100,7 @@ importFrom(dplyr,summarize) importFrom(dplyr,vars) importFrom(ellipsis,check_dots_used) importFrom(fansi,strwrap_ctl) +importFrom(generics,tidy) importFrom(ggplot2,aes) importFrom(ggplot2,ggplot) importFrom(lifecycle,deprecate_warn) diff --git a/R/methods.R b/R/methods.R index fe30cbe..3b90d80 100755 --- a/R/methods.R +++ b/R/methods.R @@ -108,8 +108,6 @@ setMethod("join_features", "SingleCellExperiment", function(.data, #' 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 #' #' @importFrom generics tidy -#' @export -generics::tidy #' @rdname tidy #' @importFrom lifecycle deprecate_warn diff --git a/man/tidy.Rd b/man/tidy.Rd index f5fb2de..e74713f 100644 --- a/man/tidy.Rd +++ b/man/tidy.Rd @@ -5,7 +5,7 @@ \alias{tidy.SingleCellExperiment} \title{(DEPRECATED) tidy for `SingleCellExperiment`} \usage{ -tidy(object) +tidy(x, ...) \method{tidy}{SingleCellExperiment}(object) } From abb3ddab477f2d4247ea1ecfcb4bb9d30a22dbdb Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Mon, 10 Nov 2025 10:16:41 +1030 Subject: [PATCH 3/3] Update tidy method for SingleCellExperiment - Rename parameter from 'object' to 'x' in tidy.SingleCellExperiment function. - Update documentation to reflect the new parameter name and clarify usage. - Mark tidy method as deprecated, indicating it is no longer needed. --- R/methods.R | 12 +++++------- man/tidy.Rd | 11 +++++------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/R/methods.R b/R/methods.R index 3b90d80..5ad298a 100755 --- a/R/methods.R +++ b/R/methods.R @@ -93,11 +93,11 @@ setMethod("join_features", "SingleCellExperiment", function(.data, } }) -#' @name tidy -#' @rdname tidy #' @title (DEPRECATED) tidy for `SingleCellExperiment` +#' @name tidy.SingleCellExperiment #' -#' @param object A `SingleCellExperiment` object. +#' @param x A `SingleCellExperiment` object. +#' @param ... Additional arguments passed to `generics::tidy`. (Unused.) #' @return A `tidySingleCellExperiment` object. (DEPRECATED - not needed anymore) #' #' @examples @@ -108,11 +108,9 @@ setMethod("join_features", "SingleCellExperiment", function(.data, #' 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 #' #' @importFrom generics tidy - -#' @rdname tidy #' @importFrom lifecycle deprecate_warn #' @export -tidy.SingleCellExperiment <- function(object) { +tidy.SingleCellExperiment <- function(x, ...) { # DEPRECATE deprecate_warn( @@ -120,7 +118,7 @@ tidy.SingleCellExperiment <- function(object) { what="tidy()", details="tidySingleCellExperiment says: tidy() is not needed anymore.") - return(object) + return(x) } #' @name aggregate_cells diff --git a/man/tidy.Rd b/man/tidy.Rd index e74713f..d2675fa 100644 --- a/man/tidy.Rd +++ b/man/tidy.Rd @@ -1,16 +1,15 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/methods.R -\name{tidy} -\alias{tidy} +\name{tidy.SingleCellExperiment} \alias{tidy.SingleCellExperiment} \title{(DEPRECATED) tidy for `SingleCellExperiment`} \usage{ -tidy(x, ...) - -\method{tidy}{SingleCellExperiment}(object) +\method{tidy}{SingleCellExperiment}(x, ...) } \arguments{ -\item{object}{A `SingleCellExperiment` object.} +\item{x}{A `SingleCellExperiment` object.} + +\item{...}{Additional arguments passed to \code{generics::tidy}. (Unused.)} } \value{ A `tidySingleCellExperiment` object. (DEPRECATED - not needed anymore)