About Install Get Started Frequently Asked Questions Frequently Requested Vignettes Contact
Interoperability between Seurat, SingleCellExperiment, and anndata

In this vignette, we demonstrate the ability to convert between Seurat objects, SingleCellExperiment objects, and anndata objects.

# install scater
# https://bioconductor.org/packages/release/bioc/html/scater.html
library(scater)
library(Seurat)
library(cowplot)

Converting to/from SingleCellExperiment

SingleCellExperiment is a class for storing single-cell experiment data, created by Davide Risso, Aaron Lun, and Keegan Korthauer, and is used by many Bioconductor analysis packages. Here we demonstrate converting the Seurat object produced in our 3k PBMC tutorial to SingleCellExperiment for use with Davis McCarthy’s scater package.

# download from satija lab
# https://www.dropbox.com/s/kwd3kcxkmpzqg6w/pbmc3k_final.rds?dl=0
pbmc <- readRDS("~/Downloads/pbmc3k_final.rds")
pbmc_sce <- Convert(from = pbmc, to = "sce")
p1 <- plotExpression(object = pbmc_sce, features = "MS4A1", x = "ident") + theme(axis.text.x = element_text(angle = 45, 
    hjust = 1))
p2 <- plotPCA(object = pbmc_sce, colour_by = "ident")
plot_grid(p1, p2)