Skip to content

No major adaptations are needed for ggplot2 s7 #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 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.15.1
Version: 1.19.1
Authors@R: c(person("Stefano", "Mangiola", email = "mangiolastefano@gmail.com",
role = c("aut", "cre")) )
Description: The tidySummarizedExperiment package provides a set of tools for creating and
Expand Down Expand Up @@ -55,7 +55,7 @@ Biarch: true
biocViews: AssayDomain, Infrastructure, RNASeq, DifferentialExpression, GeneExpression, Normalization, Clustering, QualityControl, Sequencing, Transcription, Transcriptomics
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
LazyDataCompression: xz
URL: https://github.com/stemangiola/tidySummarizedExperiment
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ importFrom(SummarizedExperiment,elementMetadata)
importFrom(SummarizedExperiment,rbind)
importFrom(SummarizedExperiment,rowData)
importFrom(SummarizedExperiment,rowRanges)
importFrom(cli,col_br_black)
importFrom(dplyr,count)
importFrom(dplyr,distinct)
importFrom(dplyr,distinct_at)
Expand Down
2 changes: 1 addition & 1 deletion R/ggplot2_methods.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @name ggplot
#' @rdname ggplot
#' @inherit ggplot2::ggplot
#' @title Create a new \code{ggplot} from a \code{tidyseurat}
#' @title Create a new \code{ggplot} from a \code{SummarizedExperiment}
#' @return `ggplot`
#'
#' @examples
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Here we plot the distribution of counts per sample.

```{r plot1}
pasilla_tidy %>%
tidySummarizedExperiment::ggplot(aes(counts + 1, group=.sample, color=`type`)) +
ggplot(aes(counts + 1, group=.sample, color=`type`)) +
geom_density() +
scale_x_log10() +
my_theme
Expand Down
66 changes: 34 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,35 @@ tidySummarizedExperiment - part of tidytranscriptomics
================

<!-- badges: start -->

[![Lifecycle:maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![R build
status](https://github.com/stemangiola/tidySummarizedExperiment/workflows/R-CMD-check-bioc/badge.svg)](https://github.com/stemangiola/tidySummarizedExperiment/actions)
<!-- badges: end -->

**Brings SummarizedExperiment to the tidyverse!**
**Brings SummarizedExperiment to the tidyverse!**

website:
[stemangiola.github.io/tidySummarizedExperiment/](https://stemangiola.github.io/tidySummarizedExperiment/)

Another [nice introduction](https://carpentries-incubator.github.io/bioc-intro/60-next-steps/index.html) by carpentries-incubator.
Another [nice
introduction](https://carpentries-incubator.github.io/bioc-intro/60-next-steps/index.html)
by carpentries-incubator.

Please also have a look at

- [tidySingleCellExperiment](https://stemangiola.github.io/tidySingleCellExperiment/)
for tidy manipulation of SingleCellExperiment objects
- [tidyseurat](https://stemangiola.github.io/tidyseurat/) for tidy
manipulation of Seurat objects
- [tidybulk](https://stemangiola.github.io/tidybulk/) for tidy
analysis of RNA sequencing data
- [nanny](https://github.com/stemangiola/nanny) for tidy high-level
data analysis and manipulation
- [tidygate](https://github.com/stemangiola/tidygate) for adding
custom gate information to your tibble
- [tidyHeatmap](https://stemangiola.github.io/tidyHeatmap/) for
heatmaps produced with tidy principles
- [tidySingleCellExperiment](https://stemangiola.github.io/tidySingleCellExperiment/)
for tidy manipulation of SingleCellExperiment objects
- [tidyseurat](https://stemangiola.github.io/tidyseurat/) for tidy
manipulation of Seurat objects
- [tidybulk](https://stemangiola.github.io/tidybulk/) for tidy analysis
of RNA sequencing data
- [nanny](https://github.com/stemangiola/nanny) for tidy high-level data
analysis and manipulation
- [tidygate](https://github.com/stemangiola/tidygate) for adding custom
gate information to your tibble
- [tidyHeatmap](https://stemangiola.github.io/tidyHeatmap/) for heatmaps
produced with tidy principles

# Introduction

Expand All @@ -43,9 +45,9 @@ tidyverse worlds.

## Functions/utilities available

| SummarizedExperiment-compatible Functions | Description |
|-------------------------------------------|------------------------------------------------------------------------------------|
| `all` | After all `tidySummarizedExperiment` is a SummarizedExperiment object, just better |
| SummarizedExperiment-compatible Functions | Description |
|----|----|
| `all` | After all `tidySummarizedExperiment` is a SummarizedExperiment object, just better |

| tidyverse Packages | Description |
|--------------------|---------------------------------------------|
Expand Down Expand Up @@ -98,7 +100,7 @@ pasilla_tidy
```

## # A SummarizedExperiment-tibble abstraction: 102,193 × 5
## # Transcripts=14599 | Samples=7 | Assays=counts
## # Features=14599 | Samples=7 | Assays=counts
## .feature .sample counts condition type
## <chr> <chr> <int> <chr> <chr>
## 1 FBgn0000003 untrt1 0 untreated single_end
Expand All @@ -111,7 +113,7 @@ pasilla_tidy
## 8 FBgn0000024 untrt1 10 untreated single_end
## 9 FBgn0000028 untrt1 0 untreated single_end
## 10 FBgn0000032 untrt1 1446 untreated single_end
## # … with 40 more rows
## # 40 more rows

**But it is a SummarizedExperiment object after all**

Expand All @@ -136,7 +138,7 @@ pasilla_tidy %>%
```

## # A SummarizedExperiment-tibble abstraction: 1 × 5
## # Transcripts=1 | Samples=1 | Assays=counts
## # Features=1 | Samples=1 | Assays=counts
## .feature .sample counts condition type
## <chr> <chr> <int> <chr> <chr>
## 1 FBgn0000003 untrt1 0 untreated single_end
Expand All @@ -149,7 +151,7 @@ pasilla_tidy %>%
```

## # A SummarizedExperiment-tibble abstraction: 58,396 × 5
## # Transcripts=14599 | Samples=4 | Assays=counts
## # Features=14599 | Samples=4 | Assays=counts
## .feature .sample counts condition type
## <chr> <chr> <int> <chr> <chr>
## 1 FBgn0000003 untrt1 0 untreated single_end
Expand All @@ -162,7 +164,7 @@ pasilla_tidy %>%
## 8 FBgn0000024 untrt1 10 untreated single_end
## 9 FBgn0000028 untrt1 0 untreated single_end
## 10 FBgn0000032 untrt1 1446 untreated single_end
## # … with 40 more rows
## # 40 more rows

We can use `select` to choose columns.

Expand All @@ -184,7 +186,7 @@ pasilla_tidy %>%
## 8 untrt1
## 9 untrt1
## 10 untrt1
## # … with 102,183 more rows
## # 102,183 more rows

We can use `count` to count how many rows we have for each sample.

Expand Down Expand Up @@ -231,7 +233,7 @@ pasilla_tidy %>%
```

## # A SummarizedExperiment-tibble abstraction: 102,193 × 5
## # Transcripts=14599 | Samples=7 | Assays=counts
## # Features=14599 | Samples=7 | Assays=counts
## .feature .sample counts condition sequencing
## <chr> <chr> <int> <chr> <chr>
## 1 FBgn0000003 untrt1 0 untreated single_end
Expand All @@ -244,7 +246,7 @@ pasilla_tidy %>%
## 8 FBgn0000024 untrt1 10 untreated single_end
## 9 FBgn0000028 untrt1 0 untreated single_end
## 10 FBgn0000032 untrt1 1446 untreated single_end
## # … with 40 more rows
## # 40 more rows

We could use `mutate` to create a column. For example, we could create a
new type column that contains single and paired instead of single_end
Expand All @@ -256,7 +258,7 @@ pasilla_tidy %>%
```

## # A SummarizedExperiment-tibble abstraction: 102,193 × 5
## # Transcripts=14599 | Samples=7 | Assays=counts
## # Features=14599 | Samples=7 | Assays=counts
## .feature .sample counts condition type
## <chr> <chr> <int> <chr> <chr>
## 1 FBgn0000003 untrt1 0 untreated single
Expand All @@ -269,7 +271,7 @@ pasilla_tidy %>%
## 8 FBgn0000024 untrt1 10 untreated single
## 9 FBgn0000028 untrt1 0 untreated single
## 10 FBgn0000032 untrt1 1446 untreated single
## # … with 40 more rows
## # 40 more rows

We could use `unite` to combine multiple columns into a single column.

Expand All @@ -279,7 +281,7 @@ pasilla_tidy %>%
```

## # A SummarizedExperiment-tibble abstraction: 102,193 × 4
## # Transcripts=14599 | Samples=7 | Assays=counts
## # Features=14599 | Samples=7 | Assays=counts
## .feature .sample counts group
## <chr> <chr> <int> <chr>
## 1 FBgn0000003 untrt1 0 untreated_single_end
Expand All @@ -292,7 +294,7 @@ pasilla_tidy %>%
## 8 FBgn0000024 untrt1 10 untreated_single_end
## 9 FBgn0000028 untrt1 0 untreated_single_end
## 10 FBgn0000032 untrt1 1446 untreated_single_end
## # … with 40 more rows
## # 40 more rows

We can also combine commands with the tidyverse pipe `%>%`.

Expand Down Expand Up @@ -340,7 +342,7 @@ pasilla_tidy %>%
## 8 FBgn0000024 untrt1 10 untreated single_end 7
## 9 FBgn0000028 untrt1 0 untreated single_end 0.429
## 10 FBgn0000032 untrt1 1446 untreated single_end 1085.
## # … with 86,503 more rows
## # 86,503 more rows

# Plotting

Expand Down Expand Up @@ -371,7 +373,7 @@ Here we plot the distribution of counts per sample.

``` r
pasilla_tidy %>%
tidySummarizedExperiment::ggplot(aes(counts + 1, group=.sample, color=`type`)) +
ggplot(aes(counts + 1, group=.sample, color=`type`)) +
geom_density() +
scale_x_log10() +
my_theme
Expand Down
6 changes: 6 additions & 0 deletions inst/NEWS.rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
\name{NEWS}
\title{News for Package \pkg{tidySummarizedExperiment}}

\section{Changes in version 1.16.0, Bioconductor 3.22 Release}{
\itemize{
\item Updated documentation to properly reflect S3 method structure.
\item Simplified ggplot2 compatibility - S3 method continues to work with ggplot2 4.0.0.
}}

\section{Changes in version 1.4.0, Bioconductor 3.14 Release}{
\itemize{
\item Improved join_*() functions.
Expand Down
2 changes: 2 additions & 0 deletions man/as_tibble.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/formatting.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ggplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading