library(BiocStyle)
knitr::opts_chunk$set(error=FALSE, message=FALSE, warning=FALSE)

Downloading the data

We obtain a single-cell RNA sequencing dataset of the mouse haematopoietic stem cells from @grun2016denovo. Counts for endogenous genes are available from the Gene Expression Omnibus using the accession number GSE76983. We download and cache them using the r Biocpkg("BiocFileCache") package.

library(BiocFileCache)
bfc <- BiocFileCache("raw_data", ask = FALSE)
count.file <- bfcrpath(bfc, file.path("ftp://ftp.ncbi.nlm.nih.gov/geo/series",
    "GSE76nnn/GSE76983/suppl/GSE76983_expdata_BMJhscC.csv.gz"))

We read this into memory as a sparse matrix.

library(scater)
counts <- readSparseCounts(count.file)
dim(counts)

Saving to file

We save the relevant components to file for upload to r Biocpkg("ExperimentHub").

path <- file.path("scRNAseq", "grun-hsc", "2.0.0")
dir.create(path, showWarnings=FALSE, recursive=TRUE)
saveRDS(counts, file=file.path(path, "counts.rds"))

Session information

sessionInfo()

References



drisso/scRNAseq documentation built on Feb. 16, 2021, 1:18 a.m.