Skip to content

Commit a912b38

Browse files
committed
documation updates
1 parent eb43f60 commit a912b38

File tree

7 files changed

+313
-20
lines changed

7 files changed

+313
-20
lines changed

NEWS

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# tidyprint NEWS
2+
3+
## tidyprint 0.99.3 (2024-12-19)
4+
5+
### NEW FEATURES
6+
- Initial Bioconductor submission
7+
- Custom print methods for SummarizedExperiment objects
8+
- Tidyverse-aligned console displays for genomic data
9+
- Alternative tibble abstractions for large genomic datasets
10+
- Unified messaging utilities for the tidyomics ecosystem
11+
- Support for multiple print designs: SummarizedExperiment, tidyprint_1, tidySummarizedExperiment, and plyxp
12+
- Automatic package detection for contextualized messaging
13+
14+
### IMPROVEMENTS
15+
- Enhanced readability and usability within tidy workflows
16+
- Consistent display formatting across different data sizes
17+
- Improved discoverability and interpretation of genomic data
18+
19+
### BUG FIXES
20+
- None in this initial release
21+
22+
### DOCUMENTATION
23+
- Comprehensive vignette with Introduction section
24+
- Complete man pages for all exported functions
25+
- Package-level documentation

R/tibble_methods.R

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
#' Convert SummarizedExperiment to tibble
2+
#'
3+
#' Converts a \link[SummarizedExperiment]{SummarizedExperiment} object to a tibble
4+
#' format, combining assay data with sample and feature metadata in a long format
5+
#' suitable for tidyverse workflows.
6+
#'
7+
#' @param x A \code{SummarizedExperiment} object to convert.
8+
#' @param ... Additional arguments passed to internal conversion functions.
9+
#' @param .name_repair Treatment of problematic column names. See
10+
#' \code{\link[tibble]{as_tibble}} for details.
11+
#' @param rownames Either \code{NULL} or a string giving the name of a column
12+
#' to use as rownames. See \code{\link[tibble]{as_tibble}} for details.
13+
#'
14+
#' @return A tibble containing the assay data combined with sample and feature
15+
#' metadata. The structure includes:
16+
#' \itemize{
17+
#' \item Feature identifiers (from \code{rownames} or \code{rowData})
18+
#' \item Sample identifiers (from \code{colnames} or \code{colData})
19+
#' \item Assay values (one column per assay)
20+
#' \item Sample metadata (from \code{colData})
21+
#' \item Feature metadata (from \code{rowData})
22+
#' }
23+
#'
24+
#' @details
25+
#' This method provides a bridge between Bioconductor's SummarizedExperiment
26+
#' objects and tidyverse data manipulation workflows. The conversion creates
27+
#' a long-format tibble where each row represents a feature-sample combination,
28+
#' making it suitable for filtering, grouping, and other tidyverse operations.
29+
#'
30+
#' @seealso \link[SummarizedExperiment]{SummarizedExperiment}, \link[tibble]{as_tibble}
31+
#'
32+
#' @examples
33+
#' \dontrun{
34+
#' library(tidyprint)
35+
#' data(se_airway)
36+
#' as_tibble(se_airway)
37+
#' }
38+
#'
139
#' @importFrom purrr reduce
240
#' @importFrom purrr map map2
341
#' @importFrom tidyr spread

R/tidyprint-package.R

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#' tidyprint: Custom Print Methods for SummarizedExperiment
2+
#'
3+
#' Provides customized print methods for \link[SummarizedExperiment]{SummarizedExperiment} objects
4+
#' to enhance readability and usability within a tidy workflow. It offers
5+
#' consistent, tidyverse-aligned console displays, including alternative
6+
#' tibble abstractions for large genomic data to improve discoverability and
7+
#' interpretation. The package also includes unified, contextual messaging
8+
#' utilities intended for the 'tidyomics' ecosystem.
9+
#'
10+
#' @section Key Features:
11+
#' \itemize{
12+
#' \item \strong{Custom Print Methods}: Alternative display formats for SummarizedExperiment objects
13+
#' \item \strong{Tidyverse Integration}: Seamless integration with tidyverse workflows
14+
#' \item \strong{Scalable Visualization}: Adaptive displays for large genomic datasets
15+
#' \item \strong{Standardized Messaging}: Consistent messaging utilities for the tidyomics ecosystem
16+
#' }
17+
#'
18+
#' @section Print Designs:
19+
#' The package provides multiple print designs for SummarizedExperiment objects:
20+
#' \itemize{
21+
#' \item \code{"SummarizedExperiment"}: Standard Bioconductor summary display
22+
#' \item \code{"tidyprint_1"}: Compact tibble abstraction with adaptive separator rows
23+
#' \item \code{"tidySummarizedExperiment"}: Legacy tidySummarizedExperiment style
24+
#' \item \code{"plyxp"}: Compact top/bottom row display
25+
#' }
26+
#'
27+
#' @section Messaging System:
28+
#' The \code{\link{tidy_message}} function provides standardized, visually appealing
29+
#' messages for packages within the tidyomics ecosystem. It automatically detects
30+
#' the calling package to provide contextualized messaging.
31+
#'
32+
#' @section Data Conversion:
33+
#' The \code{\link[=as_tibble.SummarizedExperiment]{as_tibble}} method converts
34+
#' SummarizedExperiment objects to tibble format, combining assay data with
35+
#' sample and feature metadata in a long format suitable for tidyverse workflows.
36+
#'
37+
#' @author Chen Zhan \email{[email protected]}
38+
#'
39+
#' @seealso
40+
#' \itemize{
41+
#' \item \link[SummarizedExperiment]{SummarizedExperiment} - The core Bioconductor class
42+
#' \item \link[tibble]{as_tibble} - Base tibble conversion methods
43+
#' \item \link{print.SummarizedExperiment} - Custom print methods
44+
#' \item \link{tidy_message} - Messaging utilities
45+
#' }
46+
#'
47+
#' @references
48+
#' tidyprint: Custom Print Methods for SummarizedExperiment
49+
#' \url{https://github.com/tidyomics/tidyprint}
50+
#'
51+
#' @name tidyprint-package
52+
#' @aliases tidyprint-package tidyprint
53+
NULL

README.md

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,47 @@ tidyprint
77

88
<!-- badges: end -->
99

10+
## Introduction
11+
1012
**tidyprint** is an R package that provides a centralised tidy display
1113
strategy for biological data (e.g. SummarizedExperiment) and centralised
12-
messaging styles for the `tidyomics` packages. To facilitate the
13-
discussion about data display, we compare here four data displays:
14+
messaging styles for the `tidyomics` packages. This package addresses a
15+
critical need in the Bioconductor ecosystem for improved data
16+
visualization and user experience when working with genomic data.
17+
18+
**tidyprint** fills this important gap by:
19+
20+
1. **Enhancing Data Discoverability**: Large genomic datasets often
21+
contain millions of features and thousands of samples, making it
22+
difficult to quickly understand data structure and content.
23+
tidyprint provides intuitive, compact visualizations that help
24+
researchers immediately grasp their data’s dimensions and key
25+
characteristics.
26+
27+
2. **Improving Workflow Integration**: The package seamlessly
28+
integrates with existing Bioconductor infrastructure while providing
29+
output formats that are familiar to users of modern R data science
30+
tools, particularly the tidyverse ecosystem.
31+
32+
3. **Supporting Reproducible Research**: By standardizing how
33+
SummarizedExperiment objects are displayed across different analysis
34+
contexts, tidyprint promotes consistency in scientific communication
35+
and documentation.
36+
37+
4. **Addressing Scalability Challenges**: As genomic datasets continue
38+
to grow in size and complexity, traditional display methods become
39+
inadequate. tidyprint’s adaptive display strategies ensure that
40+
users can effectively explore data regardless of scale.
41+
42+
5. **Fostering Community Standards**: The package establishes
43+
conventions for data display that can be adopted across the
44+
Bioconductor ecosystem, promoting consistency and reducing the
45+
learning curve for new users.
46+
47+
### Package Overview
48+
49+
To facilitate the discussion about data display, we compare here four
50+
data displays:
1451

1552
1. **SummarizedExperiment**: Standard R/SummarizedExperiment printing
1653
style.
@@ -23,7 +60,7 @@ it easy to switch between these printing styles.
2360

2461
------------------------------------------------------------------------
2562

26-
## 1. Installation
63+
## Installation
2764

2865
You need the `remotes` package to install from GitHub. If you don’t have
2966
it, install it via:
@@ -48,12 +85,12 @@ BiocManager::install("tidyprint")
4885

4986
------------------------------------------------------------------------
5087

51-
## 2. Demo
88+
## Demo
5289

5390
Below is an example demonstrating how to use **tidyprint** with a sample
5491
`SummarizedExperiment` object.
5592

56-
### 2.1 Load Required Packages
93+
### Load Required Packages
5794

5895
``` r
5996
library(dplyr)
@@ -113,7 +150,7 @@ airway
113150
**For comparative purposes we display the alternative visualisations we
114151
are trying to harmonise (now depreciated)**
115152

116-
### 2.4 **tidySummarizedExperiment**
153+
### **tidySummarizedExperiment**
117154

118155
Use the “tidySummarizedExperiment” design to view your data in a
119156
**tidy-friendly tibble** format:
@@ -142,7 +179,7 @@ airway %>% print(design = "tidySummarizedExperiment")
142179
#> # seq_coord_system <int>, symbol <chr>, GRangesList <list>
143180
```
144181

145-
### 2.5 **plyxp**
182+
### **plyxp**
146183

147184
For a more compact view (top and bottom rows), similar to a
148185
plyxp/tidyverse style:
@@ -168,7 +205,7 @@ airway %>% print(design = "plyxp")
168205
#> # avgLength <int>, Experiment <fct>, Sample <fct>, BioSample <fct>
169206
```
170207

171-
# 3. Messaging function
208+
## Messaging function
172209

173210
We integrated a messaging function providing standardized, visually
174211
appealing messages for packages within the tidyomics ecosystem. It
@@ -232,7 +269,7 @@ sessionInfo()
232269
#> [8] base
233270
#>
234271
#> other attached packages:
235-
#> [1] tidyprint_0.99.0 airway_1.26.0
272+
#> [1] tidyprint_0.99.2 airway_1.26.0
236273
#> [3] SummarizedExperiment_1.36.0 Biobase_2.66.0
237274
#> [5] GenomicRanges_1.58.0 GenomeInfoDb_1.42.3
238275
#> [7] IRanges_2.40.1 S4Vectors_0.44.0
@@ -243,17 +280,17 @@ sessionInfo()
243280
#> loaded via a namespace (and not attached):
244281
#> [1] utf8_1.2.6 generics_0.1.4 SparseArray_1.6.2
245282
#> [4] stringi_1.8.7 lattice_0.22-6 digest_0.6.37
246-
#> [7] magrittr_2.0.3 evaluate_1.0.5 grid_4.4.3
283+
#> [7] magrittr_2.0.4 evaluate_1.0.5 grid_4.4.3
247284
#> [10] fastmap_1.2.0 rprojroot_2.1.0 jsonlite_2.0.0
248285
#> [13] Matrix_1.7-2 httr_1.4.7 fansi_1.0.6
249286
#> [16] purrr_1.1.0 UCSC.utils_1.2.0 abind_1.4-8
250287
#> [19] cli_3.6.5 rlang_1.1.6 crayon_1.5.3
251288
#> [22] XVector_0.46.0 withr_3.0.2 DelayedArray_0.32.0
252289
#> [25] yaml_2.3.10 S4Arrays_1.6.0 tools_4.4.3
253290
#> [28] GenomeInfoDbData_1.2.13 vctrs_0.6.5 R6_2.6.1
254-
#> [31] lifecycle_1.0.4 stringr_1.5.1 zlibbioc_1.52.0
255-
#> [34] pkgconfig_2.0.3 pillar_1.11.0 glue_1.8.0
291+
#> [31] lifecycle_1.0.4 stringr_1.5.2 zlibbioc_1.52.0
292+
#> [34] pkgconfig_2.0.3 pillar_1.11.1 glue_1.8.0
256293
#> [37] xfun_0.53 tibble_3.3.0 tidyselect_1.2.1
257294
#> [40] rstudioapi_0.17.1 knitr_1.50 htmltools_0.5.8.1
258-
#> [43] rmarkdown_2.29 compiler_4.4.3
295+
#> [43] rmarkdown_2.30 compiler_4.4.3
259296
```

man/as_tibble.SummarizedExperiment.Rd

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

man/tidyprint-package.Rd

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

0 commit comments

Comments
 (0)