knitr::opts_chunk$set(echo = TRUE) options(width = 100)
The count table was downloaded from https://s3.amazonaws.com/czbiohub-tabula-muris/TM_droplet_mat.rds, following instructions on https://github.com/czbiohub/tabula-muris-vignettes/tree/master/data (accessed August 26, 2018).
The metadata was obtained from https://github.com/czbiohub/tabula-muris-vignettes/tree/master/data (accessed August 26, 2018).
suppressPackageStartupMessages({ library(Matrix) library(SingleCellExperiment) library(readr) library(dplyr) }) counts <- readRDS("TM_droplet_mat.rds") metadata <- readr::read_csv("TM_droplet_metadata.csv")
SingleCellExperiment
objectstopifnot(all(colnames(counts) == metadata$cell)) droplet <- SingleCellExperiment( assay = list(counts = counts), colData = DataFrame(metadata %>% dplyr::rename(mouse_id = mouse.id, mouse_sex = mouse.sex)), rowData = DataFrame(ID = rownames(counts), Symbol = rownames(counts)) )
droplet <- droplet[grep("^ERCC-", rownames(droplet), invert = TRUE), ] dim(droplet)
SingleCellExperiment
objectdroplet head(colData(droplet)) saveRDS(droplet, file = "TabulaMurisDroplet.rds")
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.