Setup

R version 4.0 or greater is required. We also recommend installing R Studio.

To install scMiko, run:

# Enter commands in R (or R studio)
devtools::install_github(repo = "NMikolajewicz/scMiko")
# load scMiko
library(scMiko)

scMiko within the Seurat framework

The scMiko package was developed using the Seurat framework. Consequently, Seurat objects preprocessed using sctransform are expected in scMiko-implemented workflows.

Option 1: Preprocess data using Seurat workflow

To preprocess data, users can either refer to the excellent vignette offered by Seurat, or follow the adapted workflow shown here.

# load Seurat
library(Seurat)

# load data
count_matrix <- readRDS("../data/demo/ps_count_matrix.rds")
meta_data <- readRDS("../data/demo/ps_meta_data.rds")

# create and preprocess seurat object
so.query <- CreateSeuratObject(counts = count_matrix, meta.data = meta_data)
so.query <- PercentageFeatureSet(so.query, pattern = "^mt-", col.name = "percent.mt")
so.query <- SCTransform(so.query, method = "glmGamPoi", vars.to.regress = "percent.mt", verbose = FALSE)
so.query <- RunPCA(so.query, verbose = FALSE)
so.query <- RunUMAP(so.query, dims = 1:30, verbose = FALSE)
so.query <- FindNeighbors(so.query, dims = 1:30, verbose = FALSE)
so.query <- FindClusters(so.query, verbose = FALSE)

# visualize
cluster.UMAP(so.query) + theme_void() + theme(legend.position = "none")

Option 2: Preprocess data using scPipeline QC & Preprocessing Module.

Another way to preprocess single-cell data is to use our QC & Preprocessing Module implemented in scPipeline. Given a gene x cell count matrix, or cell ranger output, the QC & Preprocessing module applies quality-control filters and preprocesses the data. The output from the module is a Seurat object, compatible with all downstream analysis work flows, and an intuitive dashboard report summarizing the data set and results.

Sample stratification

Sample-level meta data is often of interest in single cell analyses. To accommodate this information, we have included sample-wise stratification and visualization throughout our scPipeline workflows which can be leveraged by including sample-level information in the Barcodes field of the Seurat object meta data. This is an optional feature and will not affect the performance of your analysis if omitted.

Species support

The scMiko package has been optimized for human and murine samples.

Session Info
## R version 4.2.0 (2022-04-22 ucrt)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19044)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_Canada.utf8  LC_CTYPE=English_Canada.utf8   
## [3] LC_MONETARY=English_Canada.utf8 LC_NUMERIC=C                   
## [5] LC_TIME=English_Canada.utf8    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] scMiko_0.1.0        flexdashboard_0.5.2 tidyr_1.2.0        
## [4] sp_1.4-7            SeuratObject_4.1.0  Seurat_4.1.1       
## [7] dplyr_1.0.9         ggplot2_3.3.6      
## 
## loaded via a namespace (and not attached):
##   [1] systemfonts_1.0.4           plyr_1.8.7                 
##   [3] igraph_1.3.1                lazyeval_0.2.2             
##   [5] splines_4.2.0               listenv_0.8.0              
##   [7] scattermore_0.8             GenomeInfoDb_1.32.2        
##   [9] digest_0.6.29               htmltools_0.5.2            
##  [11] fansi_1.0.3                 magrittr_2.0.3             
##  [13] memoise_2.0.1               tensor_1.5                 
##  [15] cluster_2.1.3               ROCR_1.0-11                
##  [17] globals_0.15.0              matrixStats_0.62.0         
##  [19] pkgdown_2.0.3               spatstat.sparse_2.1-1      
##  [21] colorspace_2.0-3            ggrepel_0.9.1              
##  [23] textshaping_0.3.6           xfun_0.31                  
##  [25] RCurl_1.98-1.6              crayon_1.5.1               
##  [27] jsonlite_1.8.0              progressr_0.10.0           
##  [29] spatstat.data_2.2-0         survival_3.3-1             
##  [31] zoo_1.8-10                  glue_1.6.2                 
##  [33] polyclip_1.10-0             gtable_0.3.0               
##  [35] zlibbioc_1.42.0             XVector_0.36.0             
##  [37] leiden_0.4.2                DelayedArray_0.22.0        
##  [39] future.apply_1.9.0          BiocGenerics_0.42.0        
##  [41] abind_1.4-5                 scales_1.2.0               
##  [43] DBI_1.1.2                   spatstat.random_2.2-0      
##  [45] miniUI_0.1.1.1              Rcpp_1.0.8.3               
##  [47] viridisLite_0.4.0           xtable_1.8-4               
##  [49] reticulate_1.25             spatstat.core_2.4-4        
##  [51] stats4_4.2.0                htmlwidgets_1.5.4          
##  [53] httr_1.4.3                  RColorBrewer_1.1-3         
##  [55] ellipsis_0.3.2              ica_1.0-2                  
##  [57] farver_2.1.0                pkgconfig_2.0.3            
##  [59] sass_0.4.1                  uwot_0.1.11                
##  [61] deldir_1.0-6                utf8_1.2.2                 
##  [63] labeling_0.4.2              tidyselect_1.1.2           
##  [65] rlang_1.0.2                 reshape2_1.4.4             
##  [67] later_1.3.0                 munsell_0.5.0              
##  [69] tools_4.2.0                 cachem_1.0.6               
##  [71] cli_3.3.0                   generics_0.1.2             
##  [73] ggridges_0.5.3              evaluate_0.15              
##  [75] stringr_1.4.0               fastmap_1.1.0              
##  [77] yaml_2.3.5                  ragg_1.2.2                 
##  [79] goftest_1.2-3               knitr_1.39                 
##  [81] fs_1.5.2                    fitdistrplus_1.1-8         
##  [83] purrr_0.3.4                 RANN_2.6.1                 
##  [85] sparseMatrixStats_1.8.0     pbapply_1.5-0              
##  [87] future_1.25.0               nlme_3.1-157               
##  [89] mime_0.12                   formatR_1.12               
##  [91] compiler_4.2.0              rstudioapi_0.13            
##  [93] plotly_4.10.0               png_0.1-7                  
##  [95] spatstat.utils_2.3-1        tibble_3.1.7               
##  [97] bslib_0.3.1                 glmGamPoi_1.8.0            
##  [99] stringi_1.7.6               highr_0.9                  
## [101] RSpectra_0.16-1             desc_1.4.1                 
## [103] rgeos_0.5-9                 lattice_0.20-45            
## [105] Matrix_1.4-1                vctrs_0.4.1                
## [107] pillar_1.7.0                lifecycle_1.0.1            
## [109] spatstat.geom_2.4-0         lmtest_0.9-40              
## [111] jquerylib_0.1.4             RcppAnnoy_0.0.19           
## [113] bitops_1.0-7                data.table_1.14.2          
## [115] cowplot_1.1.1               irlba_2.3.5                
## [117] GenomicRanges_1.48.0        httpuv_1.6.5               
## [119] patchwork_1.1.1             R6_2.5.1                   
## [121] promises_1.2.0.1            KernSmooth_2.23-20         
## [123] gridExtra_2.3               IRanges_2.30.0             
## [125] parallelly_1.31.1           codetools_0.2-18           
## [127] MASS_7.3-57                 assertthat_0.2.1           
## [129] SummarizedExperiment_1.26.1 rprojroot_2.0.3            
## [131] withr_2.5.0                 sctransform_0.3.3          
## [133] GenomeInfoDbData_1.2.8      S4Vectors_0.34.0           
## [135] mgcv_1.8-40                 parallel_4.2.0             
## [137] grid_4.2.0                  rpart_4.1.16               
## [139] DelayedMatrixStats_1.18.0   rmarkdown_2.14             
## [141] MatrixGenerics_1.8.0        Rtsne_0.16                 
## [143] Biobase_2.56.0              shiny_1.7.1