Last updated: 2021-07-07

Checks: 7 0

Knit directory: scRNA_NB_comparison/

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(20210706) 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 052425f. 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/raw_data/
    Ignored:    data/rds_filtered/
    Ignored:    data/rds_raw/
    Ignored:    data/sampled_counts/
    Ignored:    output/snakemake_output/

Untracked files:
    Untracked:  output/figures/
    Untracked:  output/tables/

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/01_Smart-seq3.Rmd) and HTML (docs/01_Smart-seq3.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 400797a Saket Choudhary 2021-07-06 workflowr::wflow_git_commit(all = TRUE)
html 400797a Saket Choudhary 2021-07-06 workflowr::wflow_git_commit(all = TRUE)

suppressPackageStartupMessages({
  library(Seurat)
})
set.seed(42)
download_dir <- here::here("data/raw_data/Smart-seq3/E-MTAB")
dir.create(download_dir, showWarnings = F, recursive = T)
file_location <- here::here(download_dir, "E-MTAB-8735.processed.3.zip")
if(! file.exists(file_location)){
  download.file("https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-8735/E-MTAB-8735.processed.3.zip", file_location)
}
unzip(file_location, exdir=download_dir)
pbmc <- read.csv(here::here(download_dir, "HCA.UMIcounts.PBMC.txt"), stringsAsFactors = F, sep="\t")
dim(pbmc)
[1] 38630  3129
pbmc[1:5, 1:5]
                AACGTGACAAAACTGACCAA AACGTGACAAACCGATTAGA AACGTGACAAAGTCTAGAGA
ENSG00000000003                    0                    0                    0
ENSG00000000005                    0                    0                    0
ENSG00000000419                    0                    0                    0
ENSG00000000457                    0                    0                    0
ENSG00000000460                    0                    0                    0
                AACGTGACAACCTCCTAGGT AACGTGACAACGATTACGTA
ENSG00000000003                    0                    0
ENSG00000000005                    0                    0
ENSG00000000419                    1                    0
ENSG00000000457                    0                    0
ENSG00000000460                    0                    0
gene_ids <- rownames(pbmc)
ensembl <- biomaRt::useEnsembl(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")
symbols <- biomaRt::getBM(attributes = c("ensembl_gene_id", "external_gene_name"), filters = "ensembl_gene_id", 
    values = gene_ids, mart = ensembl)
rownames(symbols) <- symbols$ensembl_gene_id
ids.use <- intersect(rownames(pbmc), rownames(symbols))
symbols <- symbols[ids.use, ]
pbmc.counts <- pbmc[ids.use, ]
symbols[symbols$external_gene_name=="", "external_gene_name"] <- symbols[symbols$external_gene_name=="", "ensembl_gene_id"]

rownames(pbmc.counts) <- make.unique(symbols$external_gene_name)
dim(pbmc.counts)
[1] 38452  3129

Create Object

pbmc.seu <- CreateSeuratObject(pbmc.counts, project="PBMC__Smart-seq3", min.cells = 1, min.features = 1)
Warning: Feature names cannot have underscores ('_'), replacing with dashes
('-')
pbmc.seu[["percent.mt"]] <- PercentageFeatureSet(pbmc.seu, pattern = "^MT-")
dir.create(here::here("data/rds_raw"), showWarnings = F, recursive = T)
saveRDS(pbmc.seu, here::here("data/rds_raw/PBMC__Smart-seq3.rds"))
dim(pbmc.seu)
[1] 30783  3129
rm(pbmc.seu)
rm(pbmc.counts)
fibroblasts <- read.csv(here::here(download_dir, "Smartseq3.Fibroblasts.NovaSeq.UMIcounts.txt"), stringsAsFactors = F, sep="\t")
dim(fibroblasts)
[1] 24824   369
fibroblasts[1:5, 1:5]
                   AAGAGACGAACCGCAA AAGAGACGAATGCGGA AAGAGACGACAGTGGA
ENSMUSG00000000001               16               15               32
ENSMUSG00000000028                0                0                0
ENSMUSG00000000031                0                0                0
ENSMUSG00000000037                0                0                0
ENSMUSG00000000049                0                0                0
                   AAGAGACGACCTCACA AAGAGACGCCAACCAA
ENSMUSG00000000001               34               24
ENSMUSG00000000028                0                1
ENSMUSG00000000031                0                0
ENSMUSG00000000037                0                0
ENSMUSG00000000049                0                0
gene_ids <- rownames(fibroblasts)
ensembl <- biomaRt::useEnsembl(biomart = "ensembl", dataset = "mmusculus_gene_ensembl")
symbols <- biomaRt::getBM(attributes = c("ensembl_gene_id", "external_gene_name"), filters = "ensembl_gene_id", 
    values = gene_ids, mart = ensembl)
rownames(symbols) <- symbols$ensembl_gene_id
ids.use <- intersect(rownames(fibroblasts), rownames(symbols))
symbols <- symbols[ids.use, ]
fibroblasts.counts <- fibroblasts[ids.use, ]
symbols[symbols$external_gene_name=="", "external_gene_name"] <- symbols[symbols$external_gene_name=="", "ensembl_gene_id"]

rownames(fibroblasts.counts) <- make.unique(symbols$external_gene_name)
dim(fibroblasts.counts)
[1] 24302   369
fibroblasts.seu <- CreateSeuratObject(fibroblasts.counts, project="Fibroblasts__Smart-seq3")
fibroblasts.seu[["percent.mt"]] <- PercentageFeatureSet(fibroblasts.seu, pattern = "^mt-")
saveRDS(fibroblasts.seu, here::here("data/rds_raw/Fibroblasts__Smart-seq3.rds"))
dim(fibroblasts.seu)
[1] 24302   369
rm(fibroblasts.seu)
rm(fibroblasts.counts)
hek <- read.csv(here::here(download_dir, "Smartseq3.HEK.fwdprimer.UMIcounts.txt"), stringsAsFactors = F, sep="\t")
dim(hek)
[1] 27604   117
hek[1:5, 1:5]
                AAGAGACGCCGTGTAT AAGAGACGCCTCTCTT AAGAGACGCCTCTTCA
ENSG00000000003                8               17               29
ENSG00000000005                1                0                0
ENSG00000000419                9               12               11
ENSG00000000457                0                0                0
ENSG00000000460                0                0                6
                AAGAGACGCTACGAGT AAGAGACGCTGAGACT
ENSG00000000003               24               12
ENSG00000000005                0                0
ENSG00000000419               18                7
ENSG00000000457                0                0
ENSG00000000460                1                0
gene_ids <- rownames(hek)
ensembl <- biomaRt::useEnsembl(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")
symbols <- biomaRt::getBM(attributes = c("ensembl_gene_id", "external_gene_name"), filters = "ensembl_gene_id", 
    values = gene_ids, mart = ensembl)
rownames(symbols) <- symbols$ensembl_gene_id
ids.use <- intersect(rownames(hek), rownames(symbols))
symbols <- symbols[ids.use, ]
hek.counts <- hek[ids.use, ]
symbols[symbols$external_gene_name=="", "external_gene_name"] <- symbols[symbols$external_gene_name=="", "ensembl_gene_id"]

rownames(hek.counts) <- make.unique(symbols$external_gene_name)
hek.seu <- CreateSeuratObject(hek.counts, project="HEK__Smart-seq3", min.cells = 1, min.features = 1)
Warning: Feature names cannot have underscores ('_'), replacing with dashes
('-')
hek.seu[["percent.mt"]] <- PercentageFeatureSet(hek.seu, pattern = "^MT-")

saveRDS(hek.seu, here::here("data/rds_raw/HEK__Smart-seq3.rds"))
dim(hek.seu)
[1] 27491   117
rm(hek.seu)
rm(hek.counts)
sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

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] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] SeuratObject_4.0.2 Seurat_4.0.3       workflowr_1.6.2   

loaded via a namespace (and not attached):
  [1] BiocFileCache_1.14.0   plyr_1.8.6             igraph_1.2.6          
  [4] lazyeval_0.2.2         splines_4.0.0          listenv_0.8.0         
  [7] scattermore_0.7        ggplot2_3.3.5          digest_0.6.27         
 [10] htmltools_0.5.1.1      fansi_0.5.0            magrittr_2.0.1        
 [13] memoise_2.0.0          tensor_1.5             cluster_2.1.0         
 [16] ROCR_1.0-11            globals_0.14.0         matrixStats_0.59.0    
 [19] askpass_1.1            spatstat.sparse_2.0-0  prettyunits_1.1.1     
 [22] colorspace_2.0-2       rappdirs_0.3.3         blob_1.2.1            
 [25] ggrepel_0.9.1          xfun_0.24              dplyr_1.0.7           
 [28] crayon_1.4.1           jsonlite_1.7.2         spatstat.data_2.1-0   
 [31] survival_3.2-7         zoo_1.8-9              glue_1.4.2            
 [34] polyclip_1.10-0        gtable_0.3.0           leiden_0.3.8          
 [37] future.apply_1.7.0     BiocGenerics_0.36.1    abind_1.4-5           
 [40] scales_1.1.1           DBI_1.1.1              miniUI_0.1.1.1        
 [43] Rcpp_1.0.6             viridisLite_0.4.0      xtable_1.8-4          
 [46] progress_1.2.2         reticulate_1.20        spatstat.core_2.2-0   
 [49] bit_4.0.4              stats4_4.0.0           htmlwidgets_1.5.3     
 [52] httr_1.4.2             RColorBrewer_1.1-2     ellipsis_0.3.2        
 [55] ica_1.0-2              pkgconfig_2.0.3        XML_3.99-0.6          
 [58] dbplyr_2.1.1           sass_0.4.0             uwot_0.1.10           
 [61] deldir_0.2-10          utf8_1.2.1             here_1.0.1            
 [64] tidyselect_1.1.1       rlang_0.4.11           reshape2_1.4.4        
 [67] later_1.2.0            AnnotationDbi_1.52.0   munsell_0.5.0         
 [70] tools_4.0.0            cachem_1.0.5           generics_0.1.0        
 [73] RSQLite_2.2.7          ggridges_0.5.3         evaluate_0.14         
 [76] stringr_1.4.0          fastmap_1.1.0          yaml_2.2.1            
 [79] goftest_1.2-2          knitr_1.33             bit64_4.0.5           
 [82] fs_1.5.0               fitdistrplus_1.1-5     purrr_0.3.4           
 [85] RANN_2.6.1             pbapply_1.4-3          future_1.21.0         
 [88] nlme_3.1-152           whisker_0.4            mime_0.11             
 [91] xml2_1.3.2             biomaRt_2.46.3         compiler_4.0.0        
 [94] curl_4.3.2             plotly_4.9.4.1         png_0.1-7             
 [97] spatstat.utils_2.2-0   tibble_3.1.2           bslib_0.2.5.1         
[100] stringi_1.6.2          lattice_0.20-41        Matrix_1.3-4          
[103] vctrs_0.3.8            pillar_1.6.1           lifecycle_1.0.0       
[106] spatstat.geom_2.2-0    lmtest_0.9-38          jquerylib_0.1.4       
[109] RcppAnnoy_0.0.18       data.table_1.14.0      cowplot_1.1.1         
[112] irlba_2.3.3            httpuv_1.6.1           patchwork_1.1.1       
[115] R6_2.5.0               promises_1.2.0.1       KernSmooth_2.23-17    
[118] gridExtra_2.3          IRanges_2.24.1         parallelly_1.26.0     
[121] codetools_0.2-16       MASS_7.3-51.6          assertthat_0.2.1      
[124] openssl_1.4.4          rprojroot_2.0.2        withr_2.4.2           
[127] sctransform_0.3.2.9008 S4Vectors_0.28.1       mgcv_1.8-33           
[130] parallel_4.0.0         hms_1.1.0              grid_4.0.0            
[133] rpart_4.1-15           tidyr_1.1.3            rmarkdown_2.9         
[136] Rtsne_0.15             git2r_0.26.1           Biobase_2.50.0        
[139] shiny_1.6.0           

sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

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] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] SeuratObject_4.0.2 Seurat_4.0.3       workflowr_1.6.2   

loaded via a namespace (and not attached):
  [1] BiocFileCache_1.14.0   plyr_1.8.6             igraph_1.2.6          
  [4] lazyeval_0.2.2         splines_4.0.0          listenv_0.8.0         
  [7] scattermore_0.7        ggplot2_3.3.5          digest_0.6.27         
 [10] htmltools_0.5.1.1      fansi_0.5.0            magrittr_2.0.1        
 [13] memoise_2.0.0          tensor_1.5             cluster_2.1.0         
 [16] ROCR_1.0-11            globals_0.14.0         matrixStats_0.59.0    
 [19] askpass_1.1            spatstat.sparse_2.0-0  prettyunits_1.1.1     
 [22] colorspace_2.0-2       rappdirs_0.3.3         blob_1.2.1            
 [25] ggrepel_0.9.1          xfun_0.24              dplyr_1.0.7           
 [28] crayon_1.4.1           jsonlite_1.7.2         spatstat.data_2.1-0   
 [31] survival_3.2-7         zoo_1.8-9              glue_1.4.2            
 [34] polyclip_1.10-0        gtable_0.3.0           leiden_0.3.8          
 [37] future.apply_1.7.0     BiocGenerics_0.36.1    abind_1.4-5           
 [40] scales_1.1.1           DBI_1.1.1              miniUI_0.1.1.1        
 [43] Rcpp_1.0.6             viridisLite_0.4.0      xtable_1.8-4          
 [46] progress_1.2.2         reticulate_1.20        spatstat.core_2.2-0   
 [49] bit_4.0.4              stats4_4.0.0           htmlwidgets_1.5.3     
 [52] httr_1.4.2             RColorBrewer_1.1-2     ellipsis_0.3.2        
 [55] ica_1.0-2              pkgconfig_2.0.3        XML_3.99-0.6          
 [58] dbplyr_2.1.1           sass_0.4.0             uwot_0.1.10           
 [61] deldir_0.2-10          utf8_1.2.1             here_1.0.1            
 [64] tidyselect_1.1.1       rlang_0.4.11           reshape2_1.4.4        
 [67] later_1.2.0            AnnotationDbi_1.52.0   munsell_0.5.0         
 [70] tools_4.0.0            cachem_1.0.5           generics_0.1.0        
 [73] RSQLite_2.2.7          ggridges_0.5.3         evaluate_0.14         
 [76] stringr_1.4.0          fastmap_1.1.0          yaml_2.2.1            
 [79] goftest_1.2-2          knitr_1.33             bit64_4.0.5           
 [82] fs_1.5.0               fitdistrplus_1.1-5     purrr_0.3.4           
 [85] RANN_2.6.1             pbapply_1.4-3          future_1.21.0         
 [88] nlme_3.1-152           whisker_0.4            mime_0.11             
 [91] xml2_1.3.2             biomaRt_2.46.3         compiler_4.0.0        
 [94] curl_4.3.2             plotly_4.9.4.1         png_0.1-7             
 [97] spatstat.utils_2.2-0   tibble_3.1.2           bslib_0.2.5.1         
[100] stringi_1.6.2          lattice_0.20-41        Matrix_1.3-4          
[103] vctrs_0.3.8            pillar_1.6.1           lifecycle_1.0.0       
[106] spatstat.geom_2.2-0    lmtest_0.9-38          jquerylib_0.1.4       
[109] RcppAnnoy_0.0.18       data.table_1.14.0      cowplot_1.1.1         
[112] irlba_2.3.3            httpuv_1.6.1           patchwork_1.1.1       
[115] R6_2.5.0               promises_1.2.0.1       KernSmooth_2.23-17    
[118] gridExtra_2.3          IRanges_2.24.1         parallelly_1.26.0     
[121] codetools_0.2-16       MASS_7.3-51.6          assertthat_0.2.1      
[124] openssl_1.4.4          rprojroot_2.0.2        withr_2.4.2           
[127] sctransform_0.3.2.9008 S4Vectors_0.28.1       mgcv_1.8-33           
[130] parallel_4.0.0         hms_1.1.0              grid_4.0.0            
[133] rpart_4.1-15           tidyr_1.1.3            rmarkdown_2.9         
[136] Rtsne_0.15             git2r_0.26.1           Biobase_2.50.0        
[139] shiny_1.6.0