Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d35c29a
bump x.y.z version to odd y following creation of RELEASE_3_22 branch
jwokaty Oct 29, 2025
d0aa788
Update version to 1.20.4, add tidyprint dependency, and replace messa…
stemangiola Mar 11, 2026
ca22843
Add tidy print functionality for SummarizedExperiment
stemangiola Mar 12, 2026
de3e404
Add tidy_print_off to vignette to prevent display issues with pasilla…
stemangiola Mar 12, 2026
7d0f133
Enhance introduction vignette with tidyomics context and detailed tid…
stemangiola Mar 13, 2026
0335cab
Potential fix for pull request finding
stemangiola Mar 17, 2026
f82f4bc
Potential fix for pull request finding
stemangiola Mar 17, 2026
4d71d40
Potential fix for pull request finding
stemangiola Mar 17, 2026
e052943
Potential fix for pull request finding
stemangiola Mar 17, 2026
8449153
bump x.y.z version to even y prior to creation of RELEASE_3_23 branch
jwokaty Apr 28, 2026
c35aee3
bump x.y.z version to odd y following creation of RELEASE_3_23 branch
jwokaty Apr 28, 2026
1f15a3a
update docs
stemangiola Aug 20, 2026
92b39bb
version up to Bioc devel
stemangiola Aug 20, 2026
de9e00c
version UP
stemangiola Aug 20, 2026
1cacb81
Update version to 1.20.4, add tidyprint dependency, and replace messa…
stemangiola Mar 11, 2026
d41f3cc
Add tidy print functionality for SummarizedExperiment
stemangiola Mar 12, 2026
5dacc2a
Add tidy_print_off to vignette to prevent display issues with pasilla…
stemangiola Mar 12, 2026
7956bd5
Enhance introduction vignette with tidyomics context and detailed tid…
stemangiola Mar 13, 2026
7b1f1e9
Potential fix for pull request finding
stemangiola Mar 17, 2026
06561fd
Potential fix for pull request finding
stemangiola Mar 17, 2026
c751d78
Potential fix for pull request finding
stemangiola Mar 17, 2026
4108149
Potential fix for pull request finding
stemangiola Mar 17, 2026
60d4471
Merge branch 'use-tidyprint' of https://github.com/tidyomics/tidySumm…
stemangiola Aug 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: tidySummarizedExperiment
Title: Brings SummarizedExperiment to the Tidyverse
Version: 1.20.3
Version: 1.23.2
Authors@R: c(person("Stefano", "Mangiola", email = "mangiolastefano@gmail.com",
role = c("aut", "cre")) )
Author: Stefano Mangiola [aut, cre] <mangiolastefano@gmail.com>
Expand All @@ -21,7 +21,8 @@ Depends:
SummarizedExperiment,
ttservice (>= 0.5.0)
Imports:
dplyr,
tidyprint,
dplyr,
tibble (>= 3.0.4),
magrittr,
tidyr,
Expand Down
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ S3method(unnest,tidySummarizedExperiment_nested)
export("%>%")
export(subset_feature_data)
export(subset_sample_data)
export(tidy_print_enabled)
export(tidy_print_off)
export(tidy_print_on)
export(unnest_summarized_experiment)
exportMethods(subset_feature_data)
exportMethods(subset_sample_data)
Expand Down Expand Up @@ -124,6 +127,10 @@ importFrom(tibble,as_tibble)
importFrom(tibble,enframe)
importFrom(tibble,rowid_to_column)
importFrom(tibble,tibble)
importFrom(tidyprint,tidy_message)
importFrom(tidyprint,tidy_print_enabled)
importFrom(tidyprint,tidy_print_off)
importFrom(tidyprint,tidy_print_on)
importFrom(tidyr,extract)
importFrom(tidyr,gather)
importFrom(tidyr,nest)
Expand Down
36 changes: 17 additions & 19 deletions R/dplyr_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#' @importFrom SummarizedExperiment assays<-
#' @importFrom S4Vectors SimpleList
#' @importFrom ttservice bind_rows
#' @importFrom tidyprint tidy_message
#' @importFrom lifecycle deprecate_warn
#' @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
Expand All @@ -25,7 +26,7 @@ bind_rows.SummarizedExperiment <- function(..., .id=NULL, add.cell.ids=NULL) {
tts <- flatten_if(dots_values(...), is_spliced)

if (is_split_by_sample(tts) && is_split_by_transcript(tts)) {
stop("tidySummarizedExperiment says: bind_rows cannot be applied to splits both by sample- and feature-wise information")
tidy_stop("bind_rows cannot be applied to splits both by sample- and feature-wise information")
}
new_obj <- if (is_split_by_sample(tts)) {
cbind(tts[[1]], tts[[2]])
Expand All @@ -38,8 +39,7 @@ bind_rows.SummarizedExperiment <- function(..., .id=NULL, add.cell.ids=NULL) {

# If duplicated sample names
if (new_obj |> colnames() |> duplicated() |> which() |> length() |> gt(0)) {
warning("tidySummarizedExperiment says:",
" you have duplicated sample names, they will be made unique.")
tidy_warning("you have duplicated sample names, they will be made unique.")
}
unique_colnames <- make.unique(colnames(new_obj), sep="_")

Expand Down Expand Up @@ -91,8 +91,7 @@ append_samples.SummarizedExperiment <- function(x, ..., .id = NULL) {

# If duplicated sample names
if (any(duplicated(colnames(new_obj)))) {
warning("tidySummarizedExperiment says:",
" you have duplicated sample names, they will be made unique.")
tidy_warning("you have duplicated sample names, they will be made unique.")
unique_colnames <- make.unique(colnames(new_obj), sep = "_")
colnames(new_obj) <- unique_colnames

Expand Down Expand Up @@ -176,7 +175,7 @@ bind_cols_internal <- function(..., .id=NULL, column_belonging=NULL) {
))) {
update_SE_from_tibble(bound, tts[[1]], column_belonging = column_belonging)
} else {
warning("tidySummarizedExperiment says: The new columns do not include pure sample-wise or feature-wise. A data frame is returned for independent data analysis.")
tidy_warning("The new columns do not include pure sample-wise or feature-wise. A data frame is returned for independent data analysis.")
bound
}
}
Expand Down Expand Up @@ -254,7 +253,7 @@ distinct.SummarizedExperiment <- function(.data, ..., .keep_all=FALSE) {
#' @export
group_by.SummarizedExperiment <- function(.data, ...,
.add=FALSE, .drop=group_by_drop_default(.data)) {
message(data_frame_returned_message)
tidy_message(data_frame_returned_message)

# Deprecation of special column names
.cols <- enquos(..., .ignore_empty="all") %>%
Expand Down Expand Up @@ -285,7 +284,7 @@ group_by.SummarizedExperiment <- function(.data, ...,
#' Wickham, H., François, R., Henry, L., Müller, K., Vaughan, D. (2023). dplyr: A Grammar of Data Manipulation. R package version 2.1.4, https://CRAN.R-project.org/package=dplyr
#' @export
summarise.SummarizedExperiment <- function(.data, ...) {
message(data_frame_returned_message)
tidy_message(data_frame_returned_message)

# Deprecation of special column names
.cols <- enquos(..., .ignore_empty="all") %>%
Expand Down Expand Up @@ -333,7 +332,7 @@ summarize.SummarizedExperiment <- summarise.SummarizedExperiment
#' Wickham, H., François, R., Henry, L., Müller, K., Vaughan, D. (2023). dplyr: A Grammar of Data Manipulation. R package version 2.1.4, https://CRAN.R-project.org/package=dplyr
#' @export
rowwise.SummarizedExperiment <- function(data, ...) {
message(data_frame_returned_message)
tidy_message(data_frame_returned_message)

data |>
as_tibble() |>
Expand Down Expand Up @@ -406,7 +405,7 @@ sample_n.SummarizedExperiment <- function(tbl, size, replace=FALSE,
weight=NULL, .env=NULL, ...) {
lifecycle::signal_superseded("1.0.0", "sample_n()", "slice_sample()")

message(data_frame_returned_message)
tidy_message(data_frame_returned_message)

tbl |>
as_tibble() |>
Expand All @@ -425,7 +424,7 @@ sample_frac.SummarizedExperiment <- function(tbl, size=1, replace=FALSE,
weight=NULL, .env=NULL, ...) {
lifecycle::signal_superseded("1.0.0", "sample_frac()", "slice_sample()")

message(data_frame_returned_message)
tidy_message(data_frame_returned_message)

tbl |>
as_tibble() |>
Expand All @@ -448,7 +447,7 @@ sample_frac.SummarizedExperiment <- function(tbl, size=1, replace=FALSE,
#' @export
count.SummarizedExperiment <- function(x, ..., wt=NULL,
sort=FALSE, name=NULL, .drop=group_by_drop_default(x)) {
message(data_frame_returned_message)
tidy_message(data_frame_returned_message)

# Deprecation of special column names
.cols <- enquos(..., .ignore_empty="all") %>%
Expand Down Expand Up @@ -528,14 +527,13 @@ pull.SummarizedExperiment <- function(.data, var=-1, name=NULL, ...) {

# Warning if column names of assays do not overlap
if (check_if_assays_are_NOT_consistently_ordered(.data)) {
warning(
"tidySummarizedExperiment says:",
" the assays in your SummarizedExperiment have column names, ",
tidy_warning(paste0(
"the assays in your SummarizedExperiment have column names, ",
"but their order is not the same. Pulling assays can return ",
"data in a order you don't expect. To avoid unwanted behaviour",
" it is highly recommended to have assays with the same order",
" of colnames and rownames"
)
"data in a order you don't expect. To avoid unwanted behaviour ",
"it is highly recommended to have assays with the same order ",
"of colnames and rownames."
))

# reorder assay colnames before printing
# Rearrange if assays has colnames and rownames
Expand Down
10 changes: 6 additions & 4 deletions R/filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ analyze_query_scope_filter <- function(se, ...) {
#' # Learn more in ?dplyr_tidy_eval
#'
#' @importFrom purrr map
#' @importFrom tidyprint tidy_message
#' @importFrom dplyr filter
#' @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
Expand Down Expand Up @@ -90,10 +91,11 @@ filter.SummarizedExperiment <- function(.data, ..., .preserve=FALSE) {
dplyr::filter(..., .preserve=.preserve)

if (!is_rectangular(new_meta, .data)) {
message("tidySummarizedExperiment says:",
" The resulting data frame is not rectangular",
" (all genes for all samples), a tibble is returned",
" for independent data analysis.")
tidy_message(paste0(
"The resulting data frame is not rectangular ",
"(all genes for all samples), a tibble is returned ",
"for independent data analysis."
))
return(new_meta)
} else {
.data[
Expand Down
9 changes: 5 additions & 4 deletions R/join.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ join_efficient_for_SE <- function(x, y, by = NULL, copy = FALSE,
force_tibble_route) {

# If I have a big dataset
if (ncol(x) > 100) message("tidySummarizedExperiment says: if you are joining a dataframe both sample-wise and feature-wise, for efficiency (until further development), it is better to separate your joins and join datasets sample-wise OR feature-wise.")
if (ncol(x) > 100) tidyprint::tidy_message("If you are joining a dataframe both sample-wise and feature-wise, for efficiency (until further development), it is better to separate your joins and join datasets sample-wise OR feature-wise.", type = "warning")

joined <- x %>%
as_tibble(skip_GRanges = TRUE) %>%
join_function(y, by = by, copy = copy, suffix = suffix, ...)
out <- if (!is_not_duplicated(joined, x) || !is_rectangular(joined, x)) {
message(duplicated_cell_names)
message(data_frame_returned_message)
tidyprint::tidy_message(duplicated_cell_names, type = "warning")
tidyprint::tidy_message(data_frame_returned_message)
joined
} else {
update_SE_from_tibble(joined, x)
Expand Down Expand Up @@ -173,7 +173,7 @@ join_efficient_for_SE <- function(x, y, by = NULL, copy = FALSE,
x
}

else stop("tidySummarizedExperiment says: ERROR FOR DEVELOPERS: this option should not exist. In join utility.")
else tidy_stop("ERROR FOR DEVELOPERS: this option should not exist. In join utility.")
}

#' @name left_join
Expand All @@ -190,6 +190,7 @@ join_efficient_for_SE <- function(x, y, by = NULL, copy = FALSE,
#' slice(1))
#'
#' @importFrom dplyr left_join
#' @importFrom tidyprint tidy_message
#' @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
#'
Expand Down
13 changes: 6 additions & 7 deletions R/mutate.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,13 @@ mutate_via_tibble <- function(.data, ...) {
columns <-
special_columns |>
paste(collapse=", ")
stop(
"tidySummarizedExperiment says:",
" you are trying to rename a column that is view only",
tidy_stop(paste0(
"you are trying to rename a column that is view only ",
columns,
"(it is not present in the colData).",
" If you want to mutate a view-only column,",
" make a copy and mutate that one."
)
" (it is not present in the colData). ",
"If you want to mutate a view-only column, ",
"make a copy and mutate that one."
))
}

# If Ranges column not in query perform fast as_tibble
Expand Down
20 changes: 10 additions & 10 deletions R/rename.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ rename.SummarizedExperiment <- function(.data, ...) {

if (any(old_names %in% special_columns)) {
columns <- intersect(old_names, special_columns) |> paste(collapse=", ")
stop(
"tidySummarizedExperiment says:",
" you are trying to rename a column that is view only: ",
tidy_stop(paste0(
"you are trying to rename a column that is view only: ",
columns,
" (it is not present in the colData or rowData).",
" If you want to mutate a view-only column,",
" make a copy and mutate that one."
)
" (it is not present in the colData or rowData). ",
"If you want to mutate a view-only column, ",
"make a copy and mutate that one."
))
}

# Dispatch to appropriate domain-specific function
Expand All @@ -63,9 +62,10 @@ rename.SummarizedExperiment <- function(.data, ...) {
return(modify_features(.data, "rename", ...))
} else {
# No matching columns found
stop("tidySummarizedExperiment says:",
" the columns you are trying to rename (",
tidy_stop(paste0(
"the columns you are trying to rename (",
paste(old_names, collapse=", "),
") are not found in colData or rowData.")
") are not found in colData or rowData."
))
}
}
50 changes: 26 additions & 24 deletions R/select.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ analyze_query_scope_select <- function(se, ...) {
#'
#' @importFrom SummarizedExperiment colData
#' @importFrom dplyr select
#' @importFrom tidyprint tidy_message
#' @importFrom tidyselect all_of
#' @importFrom tidyselect any_of
#' @export
Expand All @@ -82,14 +83,13 @@ select.SummarizedExperiment <- function(.data, ...) {
# Warning if column names of assays do not overlap
if (check_if_assays_are_NOT_consistently_ordered(.data)) {

warning(
"tidySummarizedExperiment says:",
" the assays in your SummarizedExperiment have column names,",
" but their order is not the same. Assays were internally",
" reordered to be consistent with each other.",
" To avoid unwanted behaviour it is highly reccomended",
" to have assays with the same order of colnames and rownames."
)
tidy_warning(paste0(
"the assays in your SummarizedExperiment have column names, ",
"but their order is not the same. Assays were internally ",
"reordered to be consistent with each other. ",
"To avoid unwanted behaviour it is highly recommended ",
"to have assays with the same order of colnames and rownames."
))

# reorder assay colnames before printing
# Rearrange if assays has colnames and rownames
Expand All @@ -106,11 +106,10 @@ select.SummarizedExperiment <- function(.data, ...) {
col_data_tibble <-
colData(.data) |>
as_tibble(rownames = s_(.data)$name)
message(
"tidySummarizedExperiment says:",
" Key columns are missing.",
" A data frame is returned for independent data analysis."
)
tidy_message(paste0(
"Key columns are missing. ",
"A data frame is returned for independent data analysis."
))
return(
col_data_tibble |>
dplyr::select(tidyselect::eval_select(rlang::expr(c(...)), col_data_tibble)) |>
Expand All @@ -121,9 +120,10 @@ select.SummarizedExperiment <- function(.data, ...) {
row_data_tibble <-
rowData(.data) |>
as_tibble(rownames=f_(.data)$name)
message("tidySummarizedExperiment says:",
" Key columns are missing.",
" A data frame is returned for independent data analysis.")
tidy_message(paste0(
"Key columns are missing. ",
"A data frame is returned for independent data analysis."
))
return(
row_data_tibble |>
dplyr::select(tidyselect::eval_select(rlang::expr(c(...)), row_data_tibble)) |>
Expand Down Expand Up @@ -184,15 +184,17 @@ select.SummarizedExperiment <- function(.data, ...) {
# convert to tibble and delegate selection to dplyr
if (!all(c(get_needed_columns(.data)) %in% scope_report$selected_columns)) {
if (ncol(.data)>100) {
message("tidySummarizedExperiment says:",
" You are doing a complex selection both sample-wise",
" and feature-wise. In the latter case, for efficiency",
" (until further development), it is better to separate",
" your selects sample-wise OR feature-wise.")
tidy_message(
paste0(
"You are doing a complex selection both sample-wise ",
"and feature-wise. In the latter case, for efficiency ",
"(until further development), it is better to separate ",
"your selects sample-wise OR feature-wise."
),
type = "warning"
)
}
message("tidySummarizedExperiment says:",
" Key columns are missing.",
" A data frame is returned for independent data analysis.")
tidy_message(data_frame_returned_message)

.data |>
as_tibble(skip_GRanges=TRUE) |>
Expand Down
Loading
Loading