| Title: | Custom Print Methods for SummarizedExperiment |
|---|---|
| Description: | Provides customized print methods for 'SummarizedExperiment' objects to enhance readability and usability within a tidy workflow. It offers consistent, tidyverse-aligned console displays, including alternative tibble abstractions for large genomic data to improve discoverability and interpretation. The package also includes unified, contextual messaging utilities intended for the 'tidyomics' ecosystem. |
| Authors: | Chen Zhan [aut, cre] (ORCID: <https://orcid.org/0000-0002-4794-8339>) |
| Maintainer: | Chen Zhan <[email protected]> |
| License: | GPL-3 |
| Version: | 1.1.0 |
| Built: | 2026-05-30 09:45:14 UTC |
| Source: | https://github.com/bioc/tidyprint |
Provides customized print methods for SummarizedExperiment objects to enhance readability and usability within a tidy workflow. It offers consistent, tidyverse-aligned console displays, including alternative tibble abstractions for large genomic data to improve discoverability and interpretation. The package also includes unified, contextual messaging utilities intended for the 'tidyomics' ecosystem.
This package provides S3 methods and functions that enhance the display and manipulation of SummarizedExperiment objects. The main functions return:
print.SummarizedExperiment: Returns the input object invisibly
as_tibble.SummarizedExperiment: Returns a tibble with combined assay and metadata
tidy_message: Returns NULL invisibly (prints styled messages)
Custom Print Methods: Alternative display formats for SummarizedExperiment objects
Tidyverse Integration: Seamless integration with tidyverse workflows
Scalable Visualization: Adaptive displays for large genomic datasets
Standardized Messaging: Consistent messaging utilities for the tidyomics ecosystem
The package provides multiple print designs for SummarizedExperiment objects:
"SummarizedExperiment": Standard Bioconductor summary display
"tidyprint_1": Compact tibble abstraction with adaptive separator rows
"tidySummarizedExperiment": Legacy tidySummarizedExperiment style
"plyxp": Compact top/bottom row display
The tidy_message function provides standardized, visually appealing
messages for packages within the tidyomics ecosystem. It automatically detects
the calling package to provide contextualized messaging.
The as_tibble method converts
SummarizedExperiment objects to tibble format, combining assay data with
sample and feature metadata in a long format suitable for tidyverse workflows.
Chen Zhan [email protected]
tidyprint: Custom Print Methods for SummarizedExperiment https://github.com/tidyomics/tidyprint
SummarizedExperiment - The core Bioconductor class
as_tibble - Base tibble conversion methods
print.SummarizedExperiment - Custom print methods
tidy_message - Messaging utilities
Converts a SummarizedExperiment object to a tibble format, combining assay data with sample and feature metadata in a long format suitable for tidyverse workflows.
## S3 method for class 'SummarizedExperiment' as_tibble( x, ..., .name_repair = c("check_unique", "unique", "universal", "minimal"), rownames = pkgconfig::get_config("tibble::rownames", NULL) )## S3 method for class 'SummarizedExperiment' as_tibble( x, ..., .name_repair = c("check_unique", "unique", "universal", "minimal"), rownames = pkgconfig::get_config("tibble::rownames", NULL) )
x |
A |
... |
Additional arguments passed to internal conversion functions. |
.name_repair |
Treatment of problematic column names. See
|
rownames |
Either |
This method provides a bridge between Bioconductor's SummarizedExperiment objects and tidyverse data manipulation workflows. The conversion creates a long-format tibble where each row represents a feature-sample combination, making it suitable for filtering, grouping, and other tidyverse operations.
A tibble containing the assay data combined with sample and feature metadata. The structure includes:
Feature identifiers (from rownames or rowData)
Sample identifiers (from colnames or colData)
Assay values (one column per assay)
Sample metadata (from colData)
Feature metadata (from rowData)
SummarizedExperiment, as_tibble
## Not run: library(tidyprint) data(se_airway) as_tibble(se_airway) ## End(Not run)## Not run: library(tidyprint) data(se_airway) as_tibble(se_airway) ## End(Not run)
Runs through examples of the tidy_message() function for all
supported message types ("info", "success", "warning", "danger").
Intended for demonstration and testing only.
demo_tidy_message()demo_tidy_message()
Invisibly returns NULL. Called for side effects (messages
printed to the console).
demo_tidy_message()demo_tidy_message()
Format covariate header by distributing label across covariate columns
format_covariate_header( separator_row, printed_colnames, covariate_names, number_of_total_rows, label = "COVARIATES" )format_covariate_header( separator_row, printed_colnames, covariate_names, number_of_total_rows, label = "COVARIATES" )
separator_row |
The separator row with column widths |
printed_colnames |
The printed column names |
covariate_names |
The names of covariate columns |
number_of_total_rows |
The total number of rows for spacing |
label |
The label to distribute (default: "COVARIATES") |
Formatted header string
Provides a compact tibble-like display for a SummarizedExperiment object that preserves assay values and key covariates with a separator band when the table is truncated.
## S3 method for class 'SummarizedExperiment' print(x, n = 10, ...)## S3 method for class 'SummarizedExperiment' print(x, n = 10, ...)
x |
A |
n |
Integer (default |
... |
Additional arguments passed to internal printers (currently unused). |
This method constructs a tibble abstraction for SummarizedExperiment data with
columns: .feature, .sample, assay columns, a vertical separator "|",
followed by selected colData and rowData fields. When the output
is truncated, an adaptive dash-only separator row is inserted after the first
half block of rows. Additional indication of colData is provided as well.
By default, this method uses the standard SummarizedExperiment print format.
To enable the tidy print format, use tidy_print_on. To check
the current status, use tidy_print_enabled.
x is returned invisibly after printing.
SummarizedExperiment, as_tibble
## Not run: library(tidyprint) print(se_airway) # compact tibble display print(se_airway, n = 20) # with custom row count ## End(Not run)## Not run: library(tidyprint) print(se_airway) # compact tibble display print(se_airway, n = 20) # with custom row count ## End(Not run)
Scaled RNA-seq counts for airway samples packaged as a SummarizedExperiment.
data(se_airway)data(se_airway)
A SummarizedExperiment object with:
A matrix of scaled counts
Sample metadata (cell type, treatment, etc.)
airway package
Formats the header using pillar’s formatting context so it aligns with the tibble body and adds a centered COVARIATES banner.
## S3 method for class 'SE_print_abstraction' tbl_format_header(x, setup, ...)## S3 method for class 'SE_print_abstraction' tbl_format_header(x, setup, ...)
x |
An object of class |
setup |
A pillar formatting setup (list) passed by pillar; contains
things like the rendering |
... |
Unused; present for S3 method consistency. |
A character vector of header lines to be displayed above the table. (pillar prints the returned character; this function has no side effects beyond returning those lines.)
Prints a message to the console with a consistent tidyomics style. A package-specific prefix is automatically added based on the calling package name, followed by the message text. Different message types are displayed using appropriate styles from the cli package.
tidy_message(message, type = c("info", "success", "warning", "danger"))tidy_message(message, type = c("info", "success", "warning", "danger"))
message |
A character string containing the message to display. |
type |
The type of message to display. One of
|
Invisibly returns NULL. Called for side effects (printing
a styled message to the console).
tidy_message("Loading data...", type = "info") tidy_message("Data loaded successfully!", type = "success")tidy_message("Loading data...", type = "info") tidy_message("Data loaded successfully!", type = "success")
These functions control whether SummarizedExperiment objects use the custom tidy print format or the standard Bioconductor print format. By default, standard print is used.
tidy_print_on(remember = FALSE) tidy_print_off(remember = FALSE) tidy_print_enabled()tidy_print_on(remember = FALSE) tidy_print_off(remember = FALSE) tidy_print_enabled()
remember |
Logical (default |
The tidy print format provides a compact tibble-like display that combines assay data with sample and feature metadata. The standard print format is the default Bioconductor display.
When tidy print is enabled, SummarizedExperiment objects will display using the custom tibble abstraction format. When disabled (default), they will use the standard SummarizedExperiment print method from the Bioconductor package.
The setting is stored in the global R options as tidyprint.use_tidy_print.
When remember = TRUE, the setting is also saved to a cache file in
the user's R configuration directory, which takes precedence over the option.
The cache file location is determined by tools::R_user_dir("tidyprint", "config").
tidy_print_on(): Returns TRUE invisibly after enabling tidy print
tidy_print_off(): Returns FALSE invisibly after disabling tidy print
tidy_print_enabled(): Returns a logical indicating whether tidy print is currently enabled
# Check current status tidy_print_enabled() # Enable tidy print (session only) tidy_print_on() # Enable tidy print and remember the setting (saved to cache) tidy_print_on(remember = TRUE) # Disable tidy print (use standard print) tidy_print_off() # Disable tidy print and remember the setting tidy_print_off(remember = TRUE)# Check current status tidy_print_enabled() # Enable tidy print (session only) tidy_print_on() # Enable tidy print and remember the setting (saved to cache) tidy_print_on(remember = TRUE) # Disable tidy print (use standard print) tidy_print_off() # Disable tidy print and remember the setting tidy_print_off(remember = TRUE)