軌跡分析系列:
- 單細(xì)胞之軌跡分析-1:RNA velocity
- 單細(xì)胞之軌跡分析-2:monocle2 原理解讀+實(shí)操
- 單細(xì)胞之軌跡分析-3:monocle3
- 單細(xì)胞之軌跡分析-4:scVelo
- 單細(xì)胞之軌跡分析-5:slingshot
1. 載入數(shù)據(jù)集垛孔,轉(zhuǎn)換成Seurat對(duì)象
練習(xí)數(shù)據(jù)下載:SCG71.loom
library(Seurat)
library(velocyto.R)
library(SeuratWrappers)
ldat <- ReadVelocity(file = "SCG71.loom")
bm <- as.Seurat(x = ldat)
View(bm)
2. 整合降維聚類(lèi)
bm <-SCTransform(object = bm, assay = "spliced") %>% RunPCA(verbose = FALSE) %>%
FindNeighbors(dims = 1:20) %>% FindClusters() %>% RunUMAP(dims = 1:20)
# 降維聚類(lèi)分群都是基于"spliced"這個(gè)assay做的
DimPlot(bm)
3. 速率分析及可視化
bm <- RunVelocity(object = bm, deltaT = 1, kCells = 25, fit.quantile = 0.02)
這一步的結(jié)果存在bm@tools
里
ident.colors <- (scales::hue_pal())(n = length(x = levels(x = bm)))
names(x = ident.colors) <- levels(x = bm)
cell.colors <- ident.colors[Idents(object = bm)]
names(x = cell.colors) <- colnames(x = bm)
show.velocity.on.embedding.cor(emb = Embeddings(object = bm, reduction = "umap"), vel = Tool(object = bm,
slot = "RunVelocity"), n = 200, scale = "sqrt", cell.colors = ac(x = cell.colors, alpha = 0.5),
cex = 0.8, arrow.scale = 3, show.grid.flow = TRUE, min.grid.cell.mass = 0.5, grid.n = 40, arrow.lwd = 1,
do.par = FALSE, cell.border.alpha = 0.1)