Last updated: 2021-04-28

Checks: 6 1

Knit directory: MS_lesions/

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.

The global environment had objects present when the code in the R Markdown file was run. These objects 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. Use wflow_publish or wflow_build to ensure that the code is always run in an empty environment.

The following objects were defined in the global environment when these results were created:

Name Class Size
q function 1008 bytes

The command set.seed(20210118) 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 a6bdc98. 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:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rprofile
    Ignored:    .Rproj.user/
    Ignored:    ._.DS_Store
    Ignored:    ._MS_lesions.sublime-project
    Ignored:    MS_lesions.sublime-project
    Ignored:    MS_lesions.sublime-workspace
    Ignored:    analysis/.__site.yml
    Ignored:    analysis/ms07_soup_cache/
    Ignored:    analysis/ms08_modules_cache/
    Ignored:    analysis/ms10_muscat_run01_cache/
    Ignored:    analysis/ms10_muscat_run02_cache/
    Ignored:    analysis/ms10_muscat_template_cache/
    Ignored:    analysis/supp10_muscat_cache/
    Ignored:    data/
    Ignored:    output/

Untracked files:
    Untracked:  analysis/ms10_muscat_run01.Rmd
    Untracked:  analysis/ms10_muscat_run02.Rmd
    Untracked:  analysis/ms10_muscat_template.Rmd
    Untracked:  code/ms10_muscat_fns.R
    Untracked:  code/ms10_muscat_runs.R
    Untracked:  code/muscat_plan.txt
    Untracked:  code/plot_dotplot.R
    Untracked:  code/supp10_muscat.R

Unstaged changes:
    Modified:   analysis/index.Rmd
    Modified:   analysis/ms07_soup.Rmd
    Modified:   analysis/ms08_modules.Rmd
    Modified:   analysis/supp10_muscat.Rmd
    Modified:   code/ms00_utils.R
    Modified:   code/ms07_soup.R
    Deleted:    code/ms10_muscat.R

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/ms02_doublet_id.Rmd) and HTML (docs/ms02_doublet_id.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 21997f9 wmacnair 2021-02-10 Script and code to run scDblFinder

Setup / definitions

Libraries

Helper functions

source('code/ms02_doublet_id.R')

Inputs

# dirs
date_stamp  = format(Sys.Date(), '%Y_%m_%d')

## read
data_dir    = 'data/sce_raw'
sce_f       = file.path(data_dir, 'ms_sce.rds')

Outputs

save_dir    = 'output/ms02_doublet_id'
dbl_f       = file.path(save_dir, 'scDblFinder_outputs.txt')
dimred_f    = file.path(save_dir, 'scDblFinder_dimreds.txt')

Load inputs

Processing / calculations

sc_dbl_dt   = calc_sc_dbl_dt(sce_f, dbl_f)
scDblFinder already done! loading
dimred_dt   = calc_dimred_dt(sce_f, dimred_f)
dimensionality reduction already done! loading
assert_that( all(sort(dimred_dt$cell_id) == sort(sc_dbl_dt$cell_id)) )
[1] TRUE

Analysis

Checks of doublet ID calcs

Samples are shown in decreasing order of doublet proportion.

# calculate ordering of samples
lib_list    = sc_dbl_dt %>%
  .[, .(
    prop_dbl=mean(class == 'doublet')
    ), by=.(library_id=sample)] %>%
  setorder(-'prop_dbl') %>% 
  use_series('library_id')

# plot them all
for (l in lib_list) {
    cat('### ', l, '\n')
    print(dimred_plot(l, sc_dbl_dt, dimred_dt))
    cat('\n\n')
}

EU025

EU022

EU032

EU064

WM162

EU074

EU058

EU066

EU067

EU020

WM156

EU017

WM158

EU015

WM183

WM121

WM185

EU071

WM155

WM193

EU037

EU061

EU063

EU077

EU021

EU050

EU062

EU027

WM194

WM151

WM122

EU070

EU009

WM146

EU026

EU051

EU053

EU046

WM157

EU040

EU048

EU038

WM199

EU033

WM143

EU052

WM179

WM126

WM168

EU036

WM187

EU042

EU012

WM118

EU007

WM119

EU054

EU060

WM120

EU039

EU035

WM195

EU059

EU019

EU031

WM177

WM174

WM178

EU023

EU057

WM196

EU076

EU068

EU069

EU072

EU014

EU055

EU047

WM189

WM163

WM132

EU029

WM169

WM176

WM149

WM150

WM159

EU045

EU024

WM198

EU013

WM131

EU006

WM190

EU078

WM137

WM140

WM106

WM182

EU073

WM153

EU065

EU011

WM166

WM175

WM148

EU044

WM142

WM134

EU034

WM170

WM184

WM102

WM141

WM171

EU075

WM160

WM192

WM107

WM186

EU049

WM154

WM104

EU008

WM173

WM116

WM128

WM161

EU004

WM127

WM129

EU043

WM123

EU056

EU030

EU018

WM172

WM167

EU016

WM136

WM188

WM164

EU041

EU028

WM135

WM181

WM111

WM147

WM138

WM115

WM152

WM180

WM191

WM110

WM133

WM117

EU005

EU010

WM101

WM112

WM109

WM105

WM124

WM130

WM103

WM108

WM197

WM139

WM145

WM125

WM113

WM165

WM114

Outputs

devtools::session_info()
- Session info ---------------------------------------------------------------
 setting  value                       
 version  R version 4.0.3 (2020-10-10)
 os       CentOS Linux 7 (Core)       
 system   x86_64, linux-gnu           
 ui       X11                         
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    C                           
 tz       Europe/Zurich               
 date     2021-04-28                  

- Packages -------------------------------------------------------------------
 package              * version  date       lib
 assertthat           * 0.2.1    2019-03-21 [2]
 beachmat               2.6.4    2020-12-20 [1]
 beeswarm               0.3.1    2021-03-07 [1]
 Biobase              * 2.50.0   2020-10-27 [1]
 BiocGenerics         * 0.36.1   2021-04-16 [1]
 BiocManager            1.30.12  2021-03-28 [1]
 BiocNeighbors          1.8.2    2020-12-07 [1]
 BiocParallel         * 1.24.1   2020-11-06 [1]
 BiocSingular           1.6.0    2020-10-27 [1]
 BiocStyle            * 2.18.1   2020-11-24 [1]
 bitops                 1.0-6    2013-08-17 [2]
 bluster                1.0.0    2020-10-27 [1]
 bslib                  0.2.4    2021-01-25 [2]
 cachem                 1.0.4    2021-02-13 [2]
 callr                  3.6.0    2021-03-28 [2]
 cli                    2.4.0    2021-04-05 [2]
 codetools              0.2-18   2020-11-04 [2]
 colorout             * 1.2-2    2021-04-15 [1]
 colorspace             2.0-0    2020-11-11 [2]
 crayon                 1.4.1    2021-02-08 [2]
 data.table           * 1.14.0   2021-02-21 [2]
 DBI                    1.1.1    2021-01-15 [2]
 DelayedArray           0.16.3   2021-03-24 [1]
 DelayedMatrixStats     1.12.3   2021-02-03 [1]
 desc                   1.3.0    2021-03-05 [2]
 devtools               2.4.0    2021-04-07 [1]
 digest                 0.6.27   2020-10-24 [2]
 dplyr                  1.0.5    2021-03-05 [2]
 dqrng                  0.2.1    2019-05-17 [2]
 edgeR                  3.32.1   2021-01-14 [1]
 ellipsis               0.3.1    2020-05-15 [2]
 evaluate               0.14     2019-05-28 [2]
 fansi                  0.4.2    2021-01-15 [2]
 farver                 2.1.0    2021-02-28 [2]
 fastmap                1.1.0    2021-01-25 [2]
 fs                     1.5.0    2020-07-31 [2]
 generics               0.1.0    2020-10-31 [2]
 GenomeInfoDb         * 1.26.7   2021-04-08 [1]
 GenomeInfoDbData       1.2.4    2021-04-15 [1]
 GenomicRanges        * 1.42.0   2020-10-27 [1]
 ggbeeswarm             0.6.0    2017-08-07 [1]
 ggplot.multistats    * 1.0.0    2019-10-28 [1]
 ggplot2              * 3.3.3    2020-12-30 [2]
 git2r                  0.28.0   2021-01-10 [1]
 glue                   1.4.2    2020-08-27 [2]
 gridExtra              2.3      2017-09-09 [2]
 gtable                 0.3.0    2019-03-25 [2]
 hexbin                 1.28.2   2021-01-08 [2]
 highr                  0.9      2021-04-16 [2]
 htmltools              0.5.1.1  2021-01-22 [2]
 httpuv                 1.5.5    2021-01-13 [2]
 igraph                 1.2.6    2020-10-06 [2]
 IRanges              * 2.24.1   2020-12-12 [1]
 irlba                  2.3.3    2019-02-05 [2]
 jquerylib              0.1.3    2020-12-17 [2]
 jsonlite               1.7.2    2020-12-09 [2]
 knitr                  1.32     2021-04-14 [1]
 labeling               0.4.2    2020-10-20 [2]
 later                  1.1.0.1  2020-06-05 [2]
 lattice                0.20-41  2020-04-02 [2]
 lifecycle              1.0.0    2021-02-15 [2]
 limma                  3.46.0   2020-10-27 [1]
 locfit                 1.5-9.4  2020-03-25 [1]
 magrittr             * 2.0.1    2020-11-17 [1]
 Matrix               * 1.3-2    2021-01-06 [2]
 MatrixGenerics       * 1.2.1    2021-01-30 [1]
 matrixStats          * 0.58.0   2021-01-29 [2]
 memoise                2.0.0    2021-01-26 [1]
 munsell                0.5.0    2018-06-12 [2]
 patchwork            * 1.1.1    2020-12-17 [2]
 pillar                 1.6.0    2021-04-13 [2]
 pkgbuild               1.2.0    2020-12-15 [1]
 pkgconfig              2.0.3    2019-09-22 [2]
 pkgload                1.2.1    2021-04-06 [2]
 prettyunits            1.1.1    2020-01-24 [2]
 processx               3.5.1    2021-04-04 [2]
 promises               1.2.0.1  2021-02-11 [2]
 ps                     1.6.0    2021-02-28 [2]
 purrr                  0.3.4    2020-04-17 [2]
 R6                     2.5.0    2020-10-28 [2]
 RColorBrewer           1.1-2    2014-12-07 [2]
 Rcpp                   1.0.6    2021-01-15 [2]
 RCurl                  1.98-1.3 2021-03-16 [1]
 remotes                2.3.0    2021-04-01 [1]
 rlang                  0.4.10   2020-12-30 [2]
 rmarkdown              2.7      2021-02-19 [2]
 rprojroot              2.0.2    2020-11-15 [2]
 rsvd                   1.0.5    2021-04-16 [1]
 S4Vectors            * 0.28.1   2020-12-09 [1]
 sass                   0.3.1    2021-01-24 [2]
 scales               * 1.1.1    2020-05-11 [2]
 scater               * 1.18.6   2021-02-26 [1]
 scDblFinder          * 1.4.0    2020-10-27 [1]
 scran                  1.18.7   2021-04-16 [1]
 scuttle                1.0.4    2020-12-17 [1]
 sessioninfo            1.1.1    2018-11-05 [1]
 SingleCellExperiment * 1.12.0   2020-10-27 [1]
 sparseMatrixStats      1.2.1    2021-02-02 [1]
 statmod                1.4.35   2020-10-19 [1]
 stringi                1.5.3    2020-09-09 [2]
 stringr              * 1.4.0    2019-02-10 [2]
 SummarizedExperiment * 1.20.0   2020-10-27 [1]
 testthat               3.0.2    2021-02-14 [2]
 tibble                 3.1.1    2021-04-18 [2]
 tidyselect             1.1.0    2020-05-11 [2]
 usethis                2.0.1    2021-02-10 [1]
 utf8                   1.2.1    2021-03-12 [2]
 vctrs                  0.3.7    2021-03-29 [2]
 vipor                  0.4.5    2017-03-22 [1]
 viridis              * 0.6.0    2021-04-15 [1]
 viridisLite          * 0.4.0    2021-04-13 [2]
 whisker                0.4      2019-08-28 [1]
 withr                  2.4.2    2021-04-18 [2]
 workflowr            * 1.6.2    2020-04-30 [1]
 xfun                   0.22     2021-03-11 [1]
 xgboost                1.3.2.1  2021-01-18 [1]
 XVector                0.30.0   2020-10-27 [1]
 yaml                   2.2.1    2020-02-01 [2]
 zlibbioc               1.36.0   2020-10-27 [1]
 source                            
 CRAN (R 4.0.0)                    
 Bioconductor                      
 CRAN (R 4.0.3)                    
 Bioconductor                      
 Bioconductor                      
 CRAN (R 4.0.3)                    
 Bioconductor                      
 Bioconductor                      
 Bioconductor                      
 Bioconductor                      
 CRAN (R 4.0.0)                    
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 Github (jalvesaq/colorout@79931fd)
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 Bioconductor                      
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 Bioconductor                      
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.2)                    
 CRAN (R 4.0.3)                    
 Bioconductor                      
 Bioconductor                      
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 Bioconductor                      
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 Bioconductor                      
 Bioconductor                      
 Bioconductor                      
 Bioconductor                      
 CRAN (R 4.0.3)                    
 Bioconductor                      
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 Bioconductor                      
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.0)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 CRAN (R 4.0.3)                    
 Bioconductor                      
 CRAN (R 4.0.3)                    
 Bioconductor                      

[1] /pstore/home/macnairw/lib/conda_r3.12
[2] /pstore/home/macnairw/.conda/envs/r_4.0.3/lib/R/library

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /pstore/home/macnairw/.conda/envs/r_4.0.3/lib/libopenblasp-r0.3.12.so

locale:
 [1] LC_CTYPE=C                 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] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] patchwork_1.1.1             scales_1.1.1               
 [3] viridis_0.6.0               viridisLite_0.4.0          
 [5] ggplot.multistats_1.0.0     BiocParallel_1.24.1        
 [7] scDblFinder_1.4.0           Matrix_1.3-2               
 [9] scater_1.18.6               ggplot2_3.3.3              
[11] SingleCellExperiment_1.12.0 SummarizedExperiment_1.20.0
[13] Biobase_2.50.0              GenomicRanges_1.42.0       
[15] GenomeInfoDb_1.26.7         IRanges_2.24.1             
[17] S4Vectors_0.28.1            BiocGenerics_0.36.1        
[19] MatrixGenerics_1.2.1        matrixStats_0.58.0         
[21] assertthat_0.2.1            magrittr_2.0.1             
[23] stringr_1.4.0               data.table_1.14.0          
[25] BiocStyle_2.18.1            colorout_1.2-2             
[27] workflowr_1.6.2            

loaded via a namespace (and not attached):
 [1] ggbeeswarm_0.6.0          colorspace_2.0-0         
 [3] ellipsis_0.3.1            rprojroot_2.0.2          
 [5] scuttle_1.0.4             bluster_1.0.0            
 [7] XVector_0.30.0            BiocNeighbors_1.8.2      
 [9] fs_1.5.0                  rstudioapi_0.13          
[11] farver_2.1.0              hexbin_1.28.2            
[13] remotes_2.3.0             fansi_0.4.2              
[15] codetools_0.2-18          sparseMatrixStats_1.2.1  
[17] cachem_1.0.4              knitr_1.32               
[19] pkgload_1.2.1             jsonlite_1.7.2           
[21] BiocManager_1.30.12       compiler_4.0.3           
[23] dqrng_0.2.1               fastmap_1.1.0            
[25] limma_3.46.0              cli_2.4.0                
[27] later_1.1.0.1             BiocSingular_1.6.0       
[29] prettyunits_1.1.1         htmltools_0.5.1.1        
[31] tools_4.0.3               rsvd_1.0.5               
[33] igraph_1.2.6              gtable_0.3.0             
[35] glue_1.4.2                GenomeInfoDbData_1.2.4   
[37] dplyr_1.0.5               Rcpp_1.0.6               
[39] jquerylib_0.1.3           vctrs_0.3.7              
[41] DelayedMatrixStats_1.12.3 xfun_0.22                
[43] ps_1.6.0                  testthat_3.0.2           
[45] beachmat_2.6.4            lifecycle_1.0.0          
[47] irlba_2.3.3               devtools_2.4.0           
[49] statmod_1.4.35            edgeR_3.32.1             
[51] zlibbioc_1.36.0           promises_1.2.0.1         
[53] RColorBrewer_1.1-2        yaml_2.2.1               
[55] memoise_2.0.0             gridExtra_2.3            
[57] sass_0.3.1                stringi_1.5.3            
[59] highr_0.9                 desc_1.3.0               
[61] scran_1.18.7              pkgbuild_1.2.0           
[63] rlang_0.4.10              pkgconfig_2.0.3          
[65] bitops_1.0-6              evaluate_0.14            
[67] lattice_0.20-41           purrr_0.3.4              
[69] labeling_0.4.2            tidyselect_1.1.0         
[71] processx_3.5.1            R6_2.5.0                 
[73] generics_0.1.0            DelayedArray_0.16.3      
[75] DBI_1.1.1                 pillar_1.6.0             
[77] whisker_0.4               withr_2.4.2              
[79] RCurl_1.98-1.3            tibble_3.1.1             
[81] crayon_1.4.1              xgboost_1.3.2.1          
[83] utf8_1.2.1                rmarkdown_2.7            
[85] usethis_2.0.1             locfit_1.5-9.4           
[87] grid_4.0.3                callr_3.6.0              
[89] git2r_0.28.0              digest_0.6.27            
[91] httpuv_1.5.5              munsell_0.5.0            
[93] beeswarm_0.3.1            vipor_0.4.5              
[95] bslib_0.2.4               sessioninfo_1.1.1