all_times <- list() # store the time for each chunk knitr::knit_hooks$set(time_it = local({ now <- NULL function(before, options) { if (before) { now <<- Sys.time() } else { res <- difftime(Sys.time(), now, units = "secs") all_times[[options$label]] <<- res } } })) knitr::opts_chunk$set( tidy = TRUE, tidy.opts = list(width.cutoff = 95), message = FALSE, warning = FALSE, time_it = TRUE )
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)
The scMiko package was developed using the Seurat framework. Consequently, Seurat objects preprocessed using sctransform are expected in scMiko-implemented workflows.
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")
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-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.
The scMiko
package has been optimized for human and murine samples.
Session Info
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.