Last updated: 2022-03-02

Checks: 5 2

Knit directory: BAUH_2020_MND-single-cell/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.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

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(12345) 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.

Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible.

absolute relative
/mnt/beegfs/mccarthy/backed_up/general/cazodi/Projects/BAUH_2020_MND-single-cell/output/pilot3.0_iPSC/01_cellcalling-cellbender/ ../output/pilot3.0_iPSC/01_cellcalling-cellbender
/mnt/beegfs/mccarthy/backed_up/general/cazodi/Projects/BAUH_2020_MND-single-cell/output/pilot3.0_MN/01_cellcalling-cellbender/ ../output/pilot3.0_MN/01_cellcalling-cellbender

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 3f19b81. 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:    .RData
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    .cache/
    Ignored:    .config/
    Ignored:    .nv/
    Ignored:    .snakemake/
    Ignored:    BAUH_2020_MND-single-cell.Rproj
    Ignored:    GRCh38_turboGFP-RFP_reference/
    Ignored:    Homo_sapiens.GRCh38.turboGFP/
    Ignored:    Rplots.pdf
    Ignored:    data/1-s2.0-S0002929720300781-main.pdf
    Ignored:    data/2103.11251.pdf
    Ignored:    data/3M-february-2018.txt
    Ignored:    data/737K-august-2016.txt
    Ignored:    data/STAR_index/
    Ignored:    data/STAR_output/
    Ignored:    data/genome1K.phase3.SNP_AF5e2.chr1toX.hg38.log
    Ignored:    data/genome1K.phase3.SNP_AF5e2.chr1toX.hg38.recode.sort.vcf.gz
    Ignored:    data/genome1K.phase3.SNP_AF5e2.chr1toX.hg38.recode.sort.vcf.gz.csi
    Ignored:    data/genome1K.phase3.SNP_AF5e2.chr1toX.hg38.recode.vcf.gz
    Ignored:    data/genome1K.phase3.SNP_AF5e2.chr1toX.hg38.sort.vcf.gz
    Ignored:    data/genome1K.phase3.SNP_AF5e2.chr1toX.hg38.sort.vcf.gz.csi
    Ignored:    data/genome1K.phase3.SNP_AF5e2.chr1toX.hg38.vcf.gz
    Ignored:    data/genome1k.chr22.log
    Ignored:    data/genome1k.chr22.recode.vcf
    Ignored:    data/pilot3_aggr-experiments.csv
    Ignored:    data/pilot3_donors.txt
    Ignored:    data/s41588-018-0268-8.pdf
    Ignored:    data/tr2g_hs.tsv
    Ignored:    logs/
    Ignored:    output/2021-04-27_pilot2_nCells-per-donor.pdf
    Ignored:    output/2021-08-03_pilot2_nCells-per-donor.pdf
    Ignored:    output/CB-scRNAv31-GEX-lib01_QC_metadata.txt
    Ignored:    output/CB-scRNAv31-GEX-lib02_QC_metadata.txt
    Ignored:    output/pilot1_starsoloED/
    Ignored:    output/pilot2.1_gex/
    Ignored:    output/pilot2_HTO-2/
    Ignored:    output/pilot2_HTO/
    Ignored:    output/pilot2_gex_MAF01-152/
    Ignored:    output/pilot2_gex_MAF01/
    Ignored:    output/pilot2_gex_starsolo/
    Ignored:    output/pilot2_gex_starsoloED/
    Ignored:    output/pilot2_gex_starsoloED_GFP/
    Ignored:    output/pilot2_testing/
    Ignored:    output/pilot3.0/
    Ignored:    output/pilot3.0_MN/
    Ignored:    output/pilot3.0_captures-separate/
    Ignored:    output/pilot3.0_iPSC/
    Ignored:    output/pilot3_Lenti/
    Ignored:    references/Homo_sapiens.GRCh38.turboGFP.bed
    Ignored:    references/Homo_sapiens.GRCh38.turboGFP.fa
    Ignored:    references/Homo_sapiens.GRCh38.turboGFP.fa.fai
    Ignored:    references/Homo_sapiens.GRCh38.turboGFP.filtered.gtf
    Ignored:    references/Homo_sapiens.GRCh38.turboGFP.gtf
    Ignored:    references/SAindex/
    Ignored:    references/geno_test.vcf.gz
    Ignored:    references/pilot3/
    Ignored:    references/test
    Ignored:    references/turboGFP.fa
    Ignored:    references/turboGFP.gtf
    Ignored:    references/turboRFP.fa
    Ignored:    workflow/rules/

Untracked files:
    Untracked:  Capture5-GEX/
    Untracked:  __Capture5-GEX.mro
    Untracked:  cellbender.dockerfile
    Untracked:  hwe1e-05_maf05_vcf_stats.txt
    Untracked:  hwe1e-05_vcf_stats.txt

Unstaged changes:
    Modified:   analysis/2022-01-07_pilot3_Cell-Calling-Comparison.Rmd
    Modified:   analysis/2022-03-01_pilot3_cellbender.Rmd
    Modified:   analysis/2022-03-01_pilot3_dropkick.Rmd
    Modified:   config/config_pilot3.0_MN.yml
    Modified:   config/config_pilot3.0_iPSC.yml
    Modified:   workflow/Snakefile
    Modified:   workflow/rules_cellcalling.smk
    Modified:   workflow/rules_demultiplexing.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/2022-03-01_pilot3_cellbender.Rmd) and HTML (public/2022-03-01_pilot3_cellbender.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 9eb9fcc cazodi 2022-03-01 add rmd for dropkick and dropletqc
html 9eb9fcc cazodi 2022-03-01 add rmd for dropkick and dropletqc

cellbender

cellbender is a deep generative model for inferring empty and cell-containing droplets, learning the background RNA profile, and retrieving uncontaminated counts from the non-empty droplets ( preprint). Like with nearest-neighbor pooling of similar observations, cellbender learns the distribution of gene expression across all droplets using a neural network. The learned distribution acts as a prior over background-corrected gene expression that combines information from similar cells, allowing for significantly improved estimation of background contamination. Learning the prior distribution of biological counts and estimating the background contamination of individual droplets is performed simultaneously and self-consistently within an amortized (incremental) variational inference framework.

Run stats

These numbers are pulled out of the log files.

c1 <- scan(paste0(mn_dir, "Capture1-GEX/matrix_cell_barcodes.csv"), 
              what="character")
c2 <- scan(paste0(mn_dir, "Capture2-GEX/matrix_cell_barcodes.csv"), 
              what="character")
c3 <- scan(paste0(mn_dir, "Capture3-GEX/matrix_cell_barcodes.csv"), 
              what="character")
c4 <- scan(paste0(mn_dir, "Capture4-GEX/matrix_cell_barcodes.csv"), 
              what="character")
c5 <- scan(paste0(ipsc_dir, "Capture5-GEX/matrix_cell_barcodes.csv"), 
              what="character")


run_stats <- as.data.frame(list(non_zero_genes=c(28209, 28463, 28514, 28143, 26815),
                   prior_count_empty=c(491, 600, 600, 329, 65),
                   prior_count_cell=c(995, 1199, 1064, 1148, 8739),
                   excluding_counts_below=c(245, 300, 300, 164, 32),
                   largest_empty_barcode=c(579, 683, 646, 711, 5283),
                   optimal_regularization=c(0.70, 0.77, 0.66, 0.94, 1.97),
                   nCells=c(length(c1), length(c2), length(c3), 
                            length(c4), length(c5))))

rownames(run_stats) <- c("Capture1", "Capture2", "Capture3", "Capture4", "Capture5")
round(t(run_stats),0)
                       Capture1 Capture2 Capture3 Capture4 Capture5
non_zero_genes            28209    28463    28514    28143    26815
prior_count_empty           491      600      600      329       65
prior_count_cell            995     1199     1064     1148     8739
excluding_counts_below      245      300      300      164       32
largest_empty_barcode       579      683      646      711     5283
optimal_regularization        1        1        1        1        2
nCells                     8582     8827     8113    19979    20000

iPSC (Capture5) results

Summary figures from cellbender

MN (Capture 1-4) results


sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.5 (Ootpa)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.12.so

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.14.2 tidyr_1.1.4       dplyr_1.0.7      

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7       pillar_1.6.4     compiler_4.1.1   bslib_0.3.1     
 [5] later_1.3.0      jquerylib_0.1.4  git2r_0.29.0     highr_0.9       
 [9] workflowr_1.6.2  tools_4.1.1      digest_0.6.29    jsonlite_1.7.2  
[13] evaluate_0.14    lifecycle_1.0.1  tibble_3.1.6     pkgconfig_2.0.3 
[17] rlang_0.4.12     DBI_1.1.1        yaml_2.2.1       xfun_0.28       
[21] fastmap_1.1.0    stringr_1.4.0    knitr_1.36       generics_0.1.1  
[25] fs_1.5.2         vctrs_0.3.8      sass_0.4.0       tidyselect_1.1.1
[29] rprojroot_2.0.2  glue_1.6.0       R6_2.5.1         fansi_1.0.0     
[33] rmarkdown_2.11   purrr_0.3.4      magrittr_2.0.1   whisker_0.4     
[37] promises_1.2.0.1 ellipsis_0.3.2   htmltools_0.5.2  assertthat_0.2.1
[41] httpuv_1.6.5     utf8_1.2.2       stringi_1.7.6    crayon_1.4.2