knitr::opts_chunk$set( eval = FALSE, collapse = TRUE, comment = "#>", dpi = 900, fig.path = "man/figures/README-", out.width = "100%" )
This package includes a set of Shiny apps for exploring single cell RNA datasets processed with Seurat
A demo using a human gene transcript dataset from Shayler et al. (link) is available here
There are also convenient functions for:
[!WARNING] seuratTools was designed for full-length smart-seq based single cell data. Default settings may not be appropriate for droplet (10x) data, though most can be adjusted. Keep in mind best practices regarding normalization, dimensional reduction, etc. when using.
You can install the released version of seuratTools from github with:
You can install seuratTools locally using the following steps:
install.packages("devtools") devtools::install_github("whtns/seuratTools") seuratTools::create_project_db()
You can also customize the location of the app using these steps:
devtools::install_github("whtns/seuratTools") seuratTools::create_project_db(destdir = "/your/path/to/app")
First, load seuratTools and all other packages required
library(seuratTools) library(Seurat) library(tidyverse) library(ggraph)
seuratTools provides a single command to:
construct a Seurat object
filter genes by minimum expression and ubiquity
normalize and scale expression by any of several methods packaged in Seurat
By default clustering will be run at ten different resolutions between 0.2 and 2.0. Any resolution can be specified by providing the resolution argument as a numeric vector.
clustered_seu <- clustering_workflow(human_gene_transcript_seu, experiment_name = "seurat_hu_trans", organism = "human" )
minimalSeuratApp(human_gene_transcript_seu)
We start with a gene by cell matrix of count/UMI values and a table of cell metadata
human_count[1:5, 1:5] head(human_meta)
knitr::kable(human_count[1:5, 1:5]) knitr::kable(head(human_meta))
We can then create a seurat object in the usual manner using CreatSeuratObject
function
myseu <- CreateSeuratObject(human_count, assay = "gene", meta.data = human_meta)
seuratTools includes a handy function to preprocess the data that handles normalization and scaling required for downstream analysis. If needed, parameters can be specified by the user.
myseu <- seurat_preprocess(myseu)
This single function includes seurat sub-functions that normalizes, identifies highly variable features and scales the data
seuratTools also implements a standardized dimension reduction step to select variable features at a user-specified threshold and perform PCA, tSNE, and UMAP. The default assay the dimension reduction is being run on is "gene".
myseu <- seurat_reduce_dimensions(myseu, assay = "RNA")
Clustering analysis is performed via Louvain(default) or alternative algorithms available in Seurat. Clustering is performed at a range of resolutions with default value ranging from 0.2 to 2 and pca reduction
seu <- seurat_cluster(seu = Dim_Red_seu, resolution = seq(0.2, 2, by = 0.2))
This function produces clustering analysis via two steps performed using two different sub-functions
seuratTools includes a function, SplitObject
, which is capable of splitting the dataset into subsets based on a single attribute indicated by the split.by argument
split_human <- SplitObject(human_gene_transcript_seu, split.by = "dataset")
In this example the split_human
object consists of a list of subsetted objects which are split based on batch
When joint analysis of 2 or more datasets is to be performed integration_workflow
function can be used, which takes in a list of seurat objects as input and returns an integrated seurat object
integrated_seu <- integration_workflow(split_human)
Misc(integrated_seu, "experiment") %>% tibble::enframe() %>% knitr::kable()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.