1 Introduction

In this tutorial, we demonstrate how to extract both raw and normalized single-cell RNA sequencing (scRNA-seq) datasets from Seurat and SingleCellExperiment objects. These objects are widely used containers for conducting scRNA-seq analysis.

Many tutorials provide guidance on how to use these frameworks for data cleaning, such as the Seurat tutorial and the SingleCellExperiment tutorial..

Our focus here will be on retrieving raw and normalized scRNA-seq datasets that have been stored in these objects as they are required for the first step of Escort.

2 Seurat

For scRNA-seq data processed using Seurat, the raw and normalized data are stored in a Seurat object and can be extracted as follows:

library(Seurat)
# Extract Raw and Normalized
rawcounts <- as.matrix(seuratobj@assays$RNA$counts)
norm_counts <- as.matrix(seuratobj@assays$RNA$data)

# Save locally:
setwd("path/to/your_file")
write.csv(rawcounts, file = "filename_rawcount.csv")
write.csv(norm_counts, file = "filename_normcount.csv")

3 SingleCellExperiment

For scRNA-seq data processed using and stored in an SingleCellExperiment object, the raw and normalized data can be extracted by:

library(SingleCellExperiment)
# Extract Raw and Normalized
rawcounts <- as.matrix(sceobj@assays$counts)
norm_counts <- as.matrix(sceobj@assays$logcounts)

setwd("path/to/your_file")
write.csv(rawcounts, file = "filename_rawcount.csv")
write.csv(norm_counts, file = "filename_normcount.csv")

4 Contact

For any additional questions or issues at this step, please do not hesitate to reach out to us at https://github.com/xiaorudong/Escort/issues