Last updated: 2020-07-29

Checks: 7 0

Knit directory: single-cell-topics/analysis/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(1) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 6625ec0. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    data/GSE103354_PulseSeq_UMI_counts.rds
    Ignored:    data/GSE103354_Trachea_droplet_UMIcounts.txt.gz
    Ignored:    data/b_cells/
    Ignored:    data/cd14_monocytes/
    Ignored:    data/cd34_filtered/
    Ignored:    data/cd4_t_helper/
    Ignored:    data/cd56_nk/
    Ignored:    data/cytotoxic_t/
    Ignored:    data/droplet.RData
    Ignored:    data/memory_t/
    Ignored:    data/naive_cytotoxic/
    Ignored:    data/naive_t/
    Ignored:    data/pbmc_68k.RData
    Ignored:    data/pbmc_68k/
    Ignored:    data/pbmc_purified.RData
    Ignored:    data/regulatory_t/

Untracked files:
    Untracked:  analysis/pulseseq.RData
    Untracked:  code/pulseseq.R

Unstaged changes:
    Modified:   .gitignore
    Modified:   analysis/prepare_droplet.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/prepare_pulseseq.Rmd) and HTML (docs/prepare_pulseseq.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 6625ec0 Peter Carbonetto 2020-07-29 wflow_publish(“prepare_pulseseq.Rmd”, view = FALSE, verbose = TRUE)

Here we prepare the “pulse-seq” UMI count data from Montoro et al (2018)—these are gene expression profiles obtained from a novel assay coupling single-cell RNA-seq with in vivo genetic lineage tracing—for topic modeling analyses.

Download file GSE103354_PulseSeq_UMI_counts.rds.gz from the Gene Expression Omnibus (GEO) website, accession GSE103354, and save this file to the “data” folder.

Load a couple packages, and some functions written specifically for loading and preparing the data.

library(Matrix)
library(tools)
source("../code/pulseseq.R")

The single-cell UMI count data are stored as a sparse matrix, with one row per tissue sample and one column per gene.

out     <- read_pulseseq_data("../data/GSE103354_PulseSeq_UMI_counts.rds")
samples <- out$samples
counts  <- out$counts
rm(out)

Remove genes that are not expressed in any of the cells.

j      <- which(colSums(counts > 0) >= 1)
counts <- counts[,j]

After these processing steps, the data set should contain UMI count data for 21,621 genes and 66,265 samples.

cat(sprintf("Number of genes: %d\n",ncol(counts)))
cat(sprintf("Number of samples: %d\n",nrow(counts)))
cat(sprintf("Proportion of counts that are non-zero: %0.1f%%.\n",
            100*mean(counts > 0)))
# Number of genes: 21621
# Number of samples: 66265
# Proportion of counts that are non-zero: 9.3%.

Three mice were profiled at 0, 30 and 60 days of homeostatic turnover:

table(samples$mouse,samples$tp)
#     
#         0   30   60
#   R1 7640 6604 9431
#   R2 4150 7182 7458
#   R3 6273 8175 9352

Krt5-creER/LSL-mT/mG mice and progeny were labeled with membrane-localized EGFP (“GFP”), whereas non-lineage-labeled cells were labeled with membrane-localized tdTomato (“Tom”):

table(samples$lineage)
# 
#   GFP   Tom 
# 36681 29584

In the Montoro et al analysis, the samples were subdivided into 13 cell types:

table(samples$tissue)
# 
#                     basal                  ciliated 
#                     42093                      3016 
#                      club club (hillock-associated) 
#                     13568                      4132 
#                  goblet.1                  goblet.2 
#                        79                         9 
#         goblet.progenitor                  ionocyte 
#                       315                       276 
#            neuroendocrine             proliferating 
#                       630                      1413 
#                    tuft.1                    tuft.2 
#                       413                       259 
#           tuft.progenitor 
#                        62

Save the processed data.

save(list = c("samples","counts"),file = "pulseseq.RData")
resaveRdaFiles("pulseseq.RData")

sessionInfo()
# R version 3.5.1 (2018-07-02)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Scientific Linux 7.4 (Nitrogen)
# 
# Matrix products: default
# BLAS/LAPACK: /software/openblas-0.2.19-el7-x86_64/lib/libopenblas_haswellp-r0.2.19.so
# 
# locale:
#  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
# [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
# 
# attached base packages:
# [1] tools     stats     graphics  grDevices utils     datasets  methods  
# [8] base     
# 
# other attached packages:
# [1] Matrix_1.2-15
# 
# loaded via a namespace (and not attached):
#  [1] workflowr_1.6.2 Rcpp_1.0.4.6    lattice_0.20-38 digest_0.6.18  
#  [5] later_0.7.5     rprojroot_1.3-2 grid_3.5.1      R6_2.3.0       
#  [9] backports_1.1.2 git2r_0.26.1    magrittr_1.5    evaluate_0.12  
# [13] stringi_1.2.4   fs_1.3.1        promises_1.0.1  whisker_0.3-2  
# [17] rmarkdown_1.10  stringr_1.3.1   glue_1.3.0      httpuv_1.4.5   
# [21] yaml_2.2.0      compiler_3.5.1  htmltools_0.3.6 knitr_1.20