Last updated: 2021-12-17
Checks: 7 0
Knit directory: sct2_revision/
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 8afc486. 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: .Rhistory
Ignored: .Rproj.user/
Ignored: data/raw_data/
Ignored: data/rds_filtered/
Ignored: data/rds_raw/
Ignored: data/sampled_counts/
Ignored: output/snakemake_output/
Untracked files:
Untracked: code/02_run_seurat_noclip.R
Untracked: code/07AA_deseq2_muscat_simulate.R
Untracked: code/07A_muscat_simulate.R
Untracked: code/07A_simulate_muscat.R
Untracked: code/07BB_deseq2_muscat_process.R
Untracked: code/07B_muscat_process.R
Untracked: code/07B_process_muscat.R
Untracked: code/08_run_presto.R
Untracked: code/17A_HEK_SS3_dropseq.Rmd
Untracked: code/17A_HEK_SS3_dropseq_files/
Untracked: code/17C_HEK_Quartzeseq2_dropseq.Rmd
Untracked: code/17C_HEK_Quartzeseq2_dropseq_files/
Untracked: code/17_HEK_SS3_ChromiumV3.Rmd
Untracked: code/17_HEK_SS3_ChromiumV3.nb.html
Untracked: code/17_HEK_SS3_ChromiumV3_files/
Untracked: code/AA_process_muscat.R
Untracked: code/BB_process_muscat.R
Untracked: code/DD_simulate_muscat.R
Untracked: code/EE_simulate_muscat.R
Untracked: code/XX_process_muscat.R
Untracked: code/XX_simulate_muscat.R
Untracked: code/YY_simulate_muscat.R
Untracked: code/ZZ_simulate_muscat.R
Untracked: code/kang_muscat.R
Untracked: code/prep_sce.R
Untracked: code/prep_sce_ss3_dropseq.R
Untracked: data/azimuth_predictions/
Untracked: junk/
Untracked: mamba_update_changes.txt
Untracked: output/11C_VST/
Untracked: output/AAmuscat_simulated/
Untracked: output/BBmuscat_simulated/
Untracked: output/CCmuscat_simulated/
Untracked: output/CD4_NK_downsampling_DE.rds
Untracked: output/DDmuscat_simulated/
Untracked: output/EEmuscat_simulated/
Untracked: output/KANGmuscat_simulated/
Untracked: output/NK_downsampling/
Untracked: output/XXmuscat_simulated/
Untracked: output/YYmuscat_simulated/
Untracked: output/ZZmuscat_simulated/
Untracked: output/figures/
Untracked: output/kang_prepsce.rds
Untracked: output/muscat_simulated/
Untracked: output/muscat_simulation/
Untracked: output/seu_sct2_sim.rds
Untracked: output/simulation_HEK_QuartzSeq2_Dropseq_downsampling/
Untracked: output/simulation_HEK_SS3_ChromiumV3_downsampling/
Untracked: output/simulation_HEK_SS3_Dropseq_downsampling/
Untracked: output/simulation_HEK_downsampling/
Untracked: output/simulation_NK_downsampling/
Untracked: output/ss3_dropseq_prepsim.rds
Untracked: output/tables/
Untracked: output/vargenes/
Untracked: snakemake/.snakemake/
Untracked: snakemake/Snakefile_noclip.smk
Untracked: snakemake/Snakefile_presto.smk
Untracked: snakemake/cluster.yaml
Untracked: snakemake/install_glm.R
Untracked: snakemake/jobscript.sh
Untracked: snakemake/jobscript_ncells.sh
Untracked: snakemake/local_run_downsampling.sh
Untracked: snakemake/local_run_glm.sh
Untracked: snakemake/local_run_ncells.sh
Untracked: snakemake/local_run_noclip.sh
Untracked: snakemake/local_run_presto.sh
Untracked: snakemake/local_run_time.sh
Untracked: snakemake/run_glm.sh
Untracked: snakemake/run_ncells.sh
Untracked: snakemake/sct2_revision_env.yml
Untracked: temp_figures/
Unstaged changes:
Deleted: analysis/04_PBMC68k.Rmd
Modified: code/02_run_seurat.R
Modified: code/03_run_vst2_downsample.R
Modified: code/04_run_vst_ncells.R
Modified: code/06_run_sct.R
Modified: data/datasets.csv
Modified: snakemake/Snakefile_downsampling.smk
Modified: snakemake/Snakefile_glm_seurat.smk
Modified: snakemake/Snakefile_metacell.smk
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 |
---|---|---|---|---|
html | d736ec8 | Saket Choudhary | 2021-07-07 | Build site. |
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] 38436 3129
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] 30768 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")
Ensembl site unresponsive, trying uswest mirror
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] 24301 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] 24301 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] 27482 117
rm(hek.seu)
rm(hek.counts)
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
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.4 Seurat_4.0.5 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] BiocFileCache_2.0.0 plyr_1.8.6 igraph_1.2.9
[4] lazyeval_0.2.2 splines_4.1.2 listenv_0.8.0
[7] scattermore_0.7 GenomeInfoDb_1.28.4 ggplot2_3.3.5
[10] digest_0.6.29 htmltools_0.5.2 fansi_0.5.0
[13] magrittr_2.0.1 memoise_2.0.0 tensor_1.5
[16] cluster_2.1.2 ROCR_1.0-11 globals_0.14.0
[19] Biostrings_2.60.2 matrixStats_0.61.0 spatstat.sparse_2.0-0
[22] prettyunits_1.1.1 colorspace_2.0-2 rappdirs_0.3.3
[25] blob_1.2.2 ggrepel_0.9.1 xfun_0.28
[28] dplyr_1.0.7 crayon_1.4.2 RCurl_1.98-1.5
[31] jsonlite_1.7.2 spatstat.data_2.1-0 survival_3.2-13
[34] zoo_1.8-9 glue_1.5.1 polyclip_1.10-0
[37] gtable_0.3.0 zlibbioc_1.38.0 XVector_0.32.0
[40] leiden_0.3.9 future.apply_1.8.1 BiocGenerics_0.38.0
[43] abind_1.4-5 scales_1.1.1 DBI_1.1.1
[46] miniUI_0.1.1.1 Rcpp_1.0.7 progress_1.2.2
[49] viridisLite_0.4.0 xtable_1.8-4 reticulate_1.22
[52] spatstat.core_2.3-2 bit_4.0.4 stats4_4.1.2
[55] htmlwidgets_1.5.4 httr_1.4.2 RColorBrewer_1.1-2
[58] ellipsis_0.3.2 ica_1.0-2 pkgconfig_2.0.3
[61] XML_3.99-0.8 dbplyr_2.1.1 sass_0.4.0
[64] uwot_0.1.11 deldir_1.0-6 utf8_1.2.2
[67] here_1.0.1 tidyselect_1.1.1 rlang_0.4.12
[70] reshape2_1.4.4 later_1.3.0 AnnotationDbi_1.54.1
[73] munsell_0.5.0 tools_4.1.2 cachem_1.0.6
[76] generics_0.1.1 RSQLite_2.2.9 ggridges_0.5.3
[79] evaluate_0.14 stringr_1.4.0 fastmap_1.1.0
[82] yaml_2.2.1 goftest_1.2-3 knitr_1.36
[85] bit64_4.0.5 fs_1.5.2 fitdistrplus_1.1-6
[88] purrr_0.3.4 RANN_2.6.1 KEGGREST_1.32.0
[91] pbapply_1.5-0 future_1.23.0 nlme_3.1-152
[94] whisker_0.4 mime_0.12 xml2_1.3.3
[97] biomaRt_2.48.3 compiler_4.1.2 filelock_1.0.2
[100] curl_4.3.2 plotly_4.10.0 png_0.1-7
[103] spatstat.utils_2.3-0 tibble_3.1.6 bslib_0.3.1
[106] stringi_1.7.6 lattice_0.20-45 Matrix_1.4-0
[109] vctrs_0.3.8 pillar_1.6.4 lifecycle_1.0.1
[112] spatstat.geom_2.3-1 lmtest_0.9-39 jquerylib_0.1.4
[115] RcppAnnoy_0.0.19 bitops_1.0-7 data.table_1.14.2
[118] cowplot_1.1.1 irlba_2.3.5 httpuv_1.6.3
[121] patchwork_1.1.1 R6_2.5.1 promises_1.2.0.1
[124] KernSmooth_2.23-20 gridExtra_2.3 IRanges_2.26.0
[127] parallelly_1.29.0 codetools_0.2-18 MASS_7.3-54
[130] assertthat_0.2.1 rprojroot_2.0.2 withr_2.4.3
[133] sctransform_0.3.2.9008 GenomeInfoDbData_1.2.6 S4Vectors_0.30.2
[136] hms_1.1.1 mgcv_1.8-38 parallel_4.1.2
[139] grid_4.1.2 rpart_4.1-15 tidyr_1.1.4
[142] rmarkdown_2.11 Rtsne_0.15 git2r_0.29.0
[145] Biobase_2.52.0 shiny_1.7.1
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
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.4 Seurat_4.0.5 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] BiocFileCache_2.0.0 plyr_1.8.6 igraph_1.2.9
[4] lazyeval_0.2.2 splines_4.1.2 listenv_0.8.0
[7] scattermore_0.7 GenomeInfoDb_1.28.4 ggplot2_3.3.5
[10] digest_0.6.29 htmltools_0.5.2 fansi_0.5.0
[13] magrittr_2.0.1 memoise_2.0.0 tensor_1.5
[16] cluster_2.1.2 ROCR_1.0-11 globals_0.14.0
[19] Biostrings_2.60.2 matrixStats_0.61.0 spatstat.sparse_2.0-0
[22] prettyunits_1.1.1 colorspace_2.0-2 rappdirs_0.3.3
[25] blob_1.2.2 ggrepel_0.9.1 xfun_0.28
[28] dplyr_1.0.7 crayon_1.4.2 RCurl_1.98-1.5
[31] jsonlite_1.7.2 spatstat.data_2.1-0 survival_3.2-13
[34] zoo_1.8-9 glue_1.5.1 polyclip_1.10-0
[37] gtable_0.3.0 zlibbioc_1.38.0 XVector_0.32.0
[40] leiden_0.3.9 future.apply_1.8.1 BiocGenerics_0.38.0
[43] abind_1.4-5 scales_1.1.1 DBI_1.1.1
[46] miniUI_0.1.1.1 Rcpp_1.0.7 progress_1.2.2
[49] viridisLite_0.4.0 xtable_1.8-4 reticulate_1.22
[52] spatstat.core_2.3-2 bit_4.0.4 stats4_4.1.2
[55] htmlwidgets_1.5.4 httr_1.4.2 RColorBrewer_1.1-2
[58] ellipsis_0.3.2 ica_1.0-2 pkgconfig_2.0.3
[61] XML_3.99-0.8 dbplyr_2.1.1 sass_0.4.0
[64] uwot_0.1.11 deldir_1.0-6 utf8_1.2.2
[67] here_1.0.1 tidyselect_1.1.1 rlang_0.4.12
[70] reshape2_1.4.4 later_1.3.0 AnnotationDbi_1.54.1
[73] munsell_0.5.0 tools_4.1.2 cachem_1.0.6
[76] generics_0.1.1 RSQLite_2.2.9 ggridges_0.5.3
[79] evaluate_0.14 stringr_1.4.0 fastmap_1.1.0
[82] yaml_2.2.1 goftest_1.2-3 knitr_1.36
[85] bit64_4.0.5 fs_1.5.2 fitdistrplus_1.1-6
[88] purrr_0.3.4 RANN_2.6.1 KEGGREST_1.32.0
[91] pbapply_1.5-0 future_1.23.0 nlme_3.1-152
[94] whisker_0.4 mime_0.12 xml2_1.3.3
[97] biomaRt_2.48.3 compiler_4.1.2 filelock_1.0.2
[100] curl_4.3.2 plotly_4.10.0 png_0.1-7
[103] spatstat.utils_2.3-0 tibble_3.1.6 bslib_0.3.1
[106] stringi_1.7.6 lattice_0.20-45 Matrix_1.4-0
[109] vctrs_0.3.8 pillar_1.6.4 lifecycle_1.0.1
[112] spatstat.geom_2.3-1 lmtest_0.9-39 jquerylib_0.1.4
[115] RcppAnnoy_0.0.19 bitops_1.0-7 data.table_1.14.2
[118] cowplot_1.1.1 irlba_2.3.5 httpuv_1.6.3
[121] patchwork_1.1.1 R6_2.5.1 promises_1.2.0.1
[124] KernSmooth_2.23-20 gridExtra_2.3 IRanges_2.26.0
[127] parallelly_1.29.0 codetools_0.2-18 MASS_7.3-54
[130] assertthat_0.2.1 rprojroot_2.0.2 withr_2.4.3
[133] sctransform_0.3.2.9008 GenomeInfoDbData_1.2.6 S4Vectors_0.30.2
[136] hms_1.1.1 mgcv_1.8-38 parallel_4.1.2
[139] grid_4.1.2 rpart_4.1-15 tidyr_1.1.4
[142] rmarkdown_2.11 Rtsne_0.15 git2r_0.29.0
[145] Biobase_2.52.0 shiny_1.7.1