Last updated on 2026-09-04 17:50:26 CEST.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 0.8.10 | 26.46 | 288.02 | 314.48 | OK | |
| r-devel-linux-x86_64-debian-gcc | 0.8.10 | 18.10 | 203.44 | 221.54 | OK | |
| r-devel-linux-x86_64-fedora-clang | 0.8.10 | 20.00 | 191.39 | 211.39 | OK | |
| r-devel-linux-x86_64-fedora-gcc | 0.8.10 | 20.00 | 200.23 | 220.23 | OK | |
| r-devel-windows-x86_64 | 0.8.10 | 32.00 | 268.00 | 300.00 | ERROR | |
| r-patched-linux-x86_64 | 0.8.10 | 27.77 | 286.18 | 313.95 | OK | |
| r-release-linux-x86_64 | 0.8.10 | 28.91 | 285.92 | 314.83 | OK | |
| r-release-macos-arm64 | 0.8.10 | 7.00 | 66.00 | 73.00 | OK | |
| r-release-macos-x86_64 | 0.8.10 | 19.00 | 277.00 | 296.00 | OK | |
| r-release-windows-x86_64 | 0.8.10 | 31.00 | 274.00 | 305.00 | OK | |
| r-oldrel-macos-arm64 | 0.8.10 | 7.00 | 78.00 | 85.00 | OK | |
| r-oldrel-macos-x86_64 | 0.8.10 | 22.00 | 410.00 | 432.00 | OK | |
| r-oldrel-windows-x86_64 | 0.8.10 | 43.00 | 369.00 | 412.00 | OK |
Version: 0.8.10
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
--- re-building 'figures_article.Rmd' using knitr
--- finished re-building 'figures_article.Rmd'
--- re-building 'introduction.Rmd' using knitr
**Brings Seurat to the tidyverse!**
website: [stemangiola.github.io/tidyseurat/](https://stemangiola.github.io/tidyseurat/)
Please also have a look at
- [tidyseurat](https://stemangiola.github.io/tidyseurat/) for tidy single-cell RNA sequencing analysis
- [tidySummarizedExperiment](https://tidyomics.github.io/tidySummarizedExperiment/) for tidy bulk RNA sequencing analysis
- [tidybulk](https://tidyomics.github.io/tidybulk/) for tidy bulk RNA-seq analysis
- [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
tidyseurat provides a bridge between the Seurat single-cell package [@butler2018integrating; @stuart2019comprehensive] and the tidyverse [@wickham2019welcome]. It creates an invisible layer that enables viewing the
Seurat object as a tidyverse tibble, and provides Seurat-compatible *dplyr*, *tidyr*, *ggplot* and *plotly* functions.
## Functions/utilities available
Seurat-compatible Functions | Description
------------ | -------------
`all` |
tidyverse Packages | Description
------------ | -------------
`dplyr` | All `dplyr` APIs like for any tibble
`tidyr` | All `tidyr` APIs like for any tibble
`ggplot2` | `ggplot` like for any tibble
`plotly` | `plot_ly` like for any tibble
Utilities | Description
------------ | -------------
`tidy` | Add `tidyseurat` invisible layer over a Seurat object
`as_tibble` | Convert cell-wise information to a `tbl_df`
`join_features` | Add feature-wise information, returns a `tbl_df`
`aggregate_cells`| Aggregate cell gene-transcription abundance as pseudobulk tissue |
## Installation
From CRAN
``` r
install.packages("tidyseurat")
```
From Github (development)
``` r
devtools::install_github("stemangiola/tidyseurat")
```
``` r
library(dplyr)
library(tidyr)
library(purrr)
library(magrittr)
library(ggplot2)
library(Seurat)
library(tidyseurat)
```
## Create `tidyseurat`, the best of both worlds!
This is a seurat object but it is evaluated as tibble. So it is fully compatible both with Seurat and tidyverse APIs.
``` r
pbmc_small = SeuratObject::pbmc_small
```
**It looks like a tibble**
``` r
pbmc_small
```
```
## # A Seurat-tibble abstraction: 80 × 15
## # <1b>[90mFeatures=230 | Cells=80 | Active assay=RNA | Assays=RNA<1b>[0m
## .cell orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8 letter.idents groups
## <chr> <fct> <dbl> <int> <fct> <fct> <chr>
## 1 ATGC… SeuratPro… 70 47 0 A g2
## 2 CATG… SeuratPro… 85 52 0 A g1
## 3 GAAC… SeuratPro… 87 50 1 B g2
## 4 TGAC… SeuratPro… 127 56 0 A g2
## 5 AGTC… SeuratPro… 173 53 0 A g2
## 6 TCTG… SeuratPro… 70 48 0 A g1
## 7 TGGT… SeuratPro… 64 36 0 A g1
## 8 GCAG… SeuratPro… 72 45 0 A g1
## 9 GATA… SeuratPro… 52 36 0 A g1
## 10 AATG… SeuratPro… 100 41 0 A g1
## # ℹ 70 more rows
## # ℹ 8 more variables: RNA_snn_res.1 <fct>, PC_1 <dbl>, PC_2 <dbl>, PC_3 <dbl>,
## # PC_4 <dbl>, PC_5 <dbl>, tSNE_1 <dbl>, tSNE_2 <dbl>
```
**But it is a Seurat object after all**
``` r
pbmc_small@assays
```
```
## $RNA
## Assay data with 230 features for 80 cells
## Top 10 variable features:
## PPBP, IGLL5, VDAC3, CD1C, AKR1C3, PF4, MYL9, GNLY, TREML1, CA2
```
# Preliminary plots
Set colours and theme for plots.
``` r
# Use colourblind-friendly colours
friendly_cols <- c("#88CCEE", "#CC6677", "#DDCC77", "#117733", "#332288", "#AA4499", "#44AA99", "#999933", "#882255", "#661100", "#6699CC")
# Set theme
my_theme <-
list(
scale_fill_manual(values = friendly_cols),
scale_color_manual(values = friendly_cols),
theme_bw() +
theme(
panel.border = element_blank(),
axis.line = element_line(),
panel.grid.major = element_line(size = 0.2),
panel.grid.minor = element_line(size = 0.1),
text = element_text(size = 12),
legend.position = "bottom",
aspect.ratio = 1,
strip.background = element_blank(),
axis.title.x = element_text(margin = margin(t = 10, r = 10, b = 10, l = 10)),
axis.title.y = element_text(margin = margin(t = 10, r = 10, b = 10, l = 10))
)
)
```
We can treat `pbmc_small` effectively as a normal tibble for plotting.
Here we plot number of features per cell.
``` r
pbmc_small %>%
ggplot(aes(nFeature_RNA, fill = groups)) +
geom_histogram() +
my_theme
```

Here we plot total features per cell.
``` r
pbmc_small %>%
ggplot(aes(groups, nCount_RNA, fill = groups)) +
geom_boxplot(outlier.shape = NA) +
geom_jitter(width = 0.1) +
my_theme
```

Here we plot abundance of two features for each group.
``` r
pbmc_small %>%
join_features(features = c("HLA-DRA", "LYZ"), shape = "long") %>%
ggplot(aes(groups, .abundance_RNA + 1, fill = groups)) +
geom_boxplot(outlier.shape = NA) +
geom_jitter(aes(size = nCount_RNA), alpha = 0.5, width = 0.2) +
scale_y_log10() +
my_theme
```

# Preprocess the dataset
Also you can treat the object as Seurat object and proceed with data processing.
``` r
pbmc_small_pca <-
pbmc_small %>%
SCTransform(verbose = FALSE) %>%
FindVariableFeatures(verbose = FALSE) %>%
RunPCA(verbose = FALSE)
pbmc_small_pca
```
```
## # A Seurat-tibble abstraction: 80 × 17
## # <1b>[90mFeatures=220 | Cells=80 | Active assay=SCT | Assays=RNA, SCT<1b>[0m
## .cell orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8 letter.idents groups
## <chr> <fct> <dbl> <int> <fct> <fct> <chr>
## 1 ATGC… SeuratPro… 70 47 0 A g2
## 2 CATG… SeuratPro… 85 52 0 A g1
## 3 GAAC… SeuratPro… 87 50 1 B g2
## 4 TGAC… SeuratPro… 127 56 0 A g2
## 5 AGTC… SeuratPro… 173 53 0 A g2
## 6 TCTG… SeuratPro… 70 48 0 A g1
## 7 TGGT… SeuratPro… 64 36 0 A g1
## 8 GCAG… SeuratPro… 72 45 0 A g1
## 9 GATA… SeuratPro… 52 36 0 A g1
## 10 AATG… SeuratPro… 100 41 0 A g1
## # ℹ 70 more rows
## # ℹ 10 more variables: RNA_snn_res.1 <fct>, nCount_SCT <dbl>,
## # nFeature_SCT <int>, PC_1 <dbl>, PC_2 <dbl>, PC_3 <dbl>, PC_4 <dbl>,
## # PC_5 <dbl>, tSNE_1 <dbl>, tSNE_2 <dbl>
```
If a tool is not included in the tidyseurat collection, we can use `as_tibble` to permanently convert `tidyseurat` into tibble.
Quitting from ./../man/fragments/intro.Rmd:170-176 [pc_plot]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error:
! object 'ggcoef_multinom' is not exported by 'namespace:ggstats'
---
Backtrace:
▆
1. ├─... %>% ...
2. └─base::loadNamespace(x)
3. └─base::namespaceImportFrom(...)
4. └─base::importIntoEnv(impenv, impnames, ns, impvars)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quitting from introduction.Rmd:30-31 [unnamed-chunk-2]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error:
! object 'ggcoef_multinom' is not exported by 'namespace:ggstats'
---
Backtrace:
▆
1. ├─... %>% ...
2. └─base::loadNamespace(x)
3. └─base::namespaceImportFrom(...)
4. └─base::importIntoEnv(impenv, impnames, ns, impvars)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'introduction.Rmd' failed with diagnostics:
object 'ggcoef_multinom' is not exported by 'namespace:ggstats'
--- failed re-building 'introduction.Rmd'
SUMMARY: processing the following file failed:
'introduction.Rmd'
Error: Vignette re-building failed.
Execution halted
Flavor: r-devel-windows-x86_64