This document provides a walk-through of a basic scRNA-seq analysis worklow in SCTK using 10x Cell Ranger V3 data from 1k 1:1 Human(HEK293T) & Mouse(NIH3T3). The counts matrix has been subsetted to 20 genes x 20 cells for a quick example and is availble through the SCTK package.

Load SCTK

Example Data

To list available example data from the SCTK package, run

data(package = 'singleCellTK')

Example datasets from other upstream tools are included in the extdata directory

list.files(system.file("extdata/", package = "singleCellTK"))

Import Data

sce <- importCellRanger(cellRangerDirs = system.file("extdata/", package = "singleCellTK"),
sampleDirs = "hgmm_1k_v3_20x20",sampleNames = "hgmm1kv3", dataType = "filtered")

sce

Perform Quality Control

Cell QC

sce <- runCellQC(sce,
                algorithms = c("QCMetrics", "doubletCells", "cxds", "bcds",
                "cxds_bcds_hybrid", "scrublet", "doubletFinder", "decontX"))

Droplet QC

sce <- runDropletQC(inSCE,
                    algorithms = c("QCMetrics", "emptyDrops", "barcodeRanks"))

Visualize Results

plotUMAP(sce, reducedDimName = "scrublet_UMAP", runUMAP = FALSE, useAssay = "logcounts")

Export SCE as text file

The SingleCellExperiment object which contains QC metrics can be exported as rds, h5 or text files. More information about output format can be found in Quality Control. Also, refer documentation exportSCEtoAnnData and exportSCEtoFlatFile.

## TXT files
exportSCEtoFlatFile(sce = sce, outputDir = "example_sce")
## h5 files
exportSCEtoAnnData(sce = sce, outputDir = "example_sce")
## rds
saveRDS(sce, file="example_sce/example_sce.rds")

Vignettes

Detailed vignettes are available under the “Command Line Analysis” tab.

Session info

## R version 4.0.4 (2021-02-15)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19042)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=Chinese (Simplified)_China.936 
## [2] LC_CTYPE=Chinese (Simplified)_China.936   
## [3] LC_MONETARY=Chinese (Simplified)_China.936
## [4] LC_NUMERIC=C                              
## [5] LC_TIME=Chinese (Simplified)_China.936    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## loaded via a namespace (and not attached):
##  [1] rprojroot_2.0.2   digest_0.6.27     crayon_1.4.1      R6_2.5.0         
##  [5] jsonlite_1.7.2    magrittr_2.0.1    evaluate_0.14     stringi_1.5.3    
##  [9] rlang_0.4.10      cachem_1.0.4      fs_1.5.0          jquerylib_0.1.3  
## [13] bslib_0.2.4       ragg_1.1.1        rmarkdown_2.7     pkgdown_1.6.1    
## [17] textshaping_0.3.1 desc_1.3.0        tools_4.0.4       stringr_1.4.0    
## [21] yaml_2.2.1        xfun_0.21         fastmap_1.1.0     compiler_4.0.4   
## [25] systemfonts_1.0.1 memoise_2.0.0     htmltools_0.5.1.1 knitr_1.31       
## [29] sass_0.3.1