說在前面
單細胞數(shù)據(jù)分析發(fā)展到現(xiàn)在越來越平民化了,如今對于很多小伙伴來說必峰,入門單細胞數(shù)據(jù)分析要比幾年前簡單多了洪唐,這主要得利于很多輕便而且一站式的單細胞數(shù)據(jù)分析軟件的使用,其中最有名的就是基于R語言的Seurat和基于Python的Scanpy了吼蚁。
今天小編介紹的這款Scillus軟件就是Seurat的一個wrapper凭需,使用它可以做到和Seurat無縫銜接,并且也有自己獨特的分析函數(shù)肝匆,可謂是單細胞數(shù)據(jù)分析的必備神器粒蜈!而且,最重要的是使用這個軟件可以輕松克服沒有辦法在一個圖中添加更多組條來為不同的數(shù)據(jù)著色的問題旗国,而且出圖十分美觀枯怖。
下面我們來使用代碼進行實操演示。能曾。度硝。
代碼實現(xiàn)
devtools::install_github("xmc811/Scillus", ref = "development")
library(Scillus)
library(tidyverse)
library(Seurat)
library(magrittr)
library(tidyverse)
library('magrittr')
library(R.utils)
a <- list.files("GSE128531_RAW", full.names = TRUE)
m <- tibble(file = a,
sample = stringr::str_remove(basename(a), ".csv.gz"),
group = rep(c("CTCL", "Normal"), each = 3))
pal <- tibble(var = c("sample", "group","seurat_clusters"),
pal = c("Set2","Set1","Paired")) #配色
scRNA <- load_scfile(m)
讀取完數(shù)據(jù),下面進行數(shù)據(jù)質(zhì)控寿冕。蕊程。。
plot_qc(scRNA, metrics = "percent.mt")
plot_qc(scRNA, metrics = "nFeature_RNA")
plot_qc(scRNA, metrics = "nCount_RNA")
plot_qc(scRNA, metrics = "nCount_RNA", plot_type = "density") + scale_x_log10()
plot_qc(scRNA, metrics = "percent.mt", group_by = "group", pal_setup = c("purple","yellow"))
scRNA_f <- filter_scdata(scRNA, subset = nFeature_RNA > 500 & percent.mt < 10)
scRNA_f %<>%
purrr::map(.f = NormalizeData) %>%
purrr::map(.f = FindVariableFeatures) %>%
purrr::map(.f = CellCycleScoring,
s.features = cc.genes$s.genes,
g2m.features = cc.genes$g2m.genes)
scRNA_int <- IntegrateData(anchorset = FindIntegrationAnchors(object.list = scRNA_f, dims = 1:30, k.filter = 50), dims = 1:30)
scRNA_int %<>%
ScaleData(vars.to.regress = c("nCount_RNA", "percent.mt", "S.Score", "G2M.Score"))
scRNA_int %<>%
RunPCA(npcs = 50, verbose = TRUE)
scRNA_int %<>%
RunUMAP(reduction = "pca", dims = 1:20, n.neighbors = 30) %>%
FindNeighbors(reduction = "pca", dims = 1:20) %>%
FindClusters(resolution = 0.3)
m %<>%mutate(group = factor(group, levels = c("Normal", "CTCL")))
scRNA_int %<>%refactor_seurat(metadata = m)
plot_scdata(scRNA_int, pal_setup = pal)
plot_scdata(scRNA_int, color_by = "group", pal_setup = pal)
plot_scdata(scRNA_int, split_by = "sample", pal_setup = pal)
plot_scdata(scRNA_int, pal_setup = "Dark2")
plot_stat(scRNA_int, plot_type = "prop_multi", pal_setup = "Set3")
image.png
image.png
image.png
image.png
Seurat做出的熱圖其實是很丑的驼唱,而用Scillus就很好的解決了這個問題藻茂,美美噠。
markers <- FindAllMarkers(scRNA_int, logfc.threshold = 0.1, min.pct = 0, only.pos = T)
plot_heatmap(dataset = scRNA_int,
markers = markers,
sort_var = c("seurat_clusters","sample"),
anno_var = c("seurat_clusters","sample","percent.mt","S.Score","G2M.Score"),
anno_colors = list("Set2", # RColorBrewer palette
c("red","orange","yellow","purple","blue","green"), # color vector
"Reds",
c("blue","white","red"), # Three-color gradient
"Greens"))
image.png
Scillus最有特色的一點是可以一站式進行功能分析曙蒸,包括ORA和GSEA.
plot_all_cluster_go(markers, org = "human", ont = "CC")
de <- find_diff_genes(dataset = scRNA_int,
clusters = as.character(0:7),
comparison = c("group", "CTCL", "Normal"),
logfc.threshold = 0, # threshold of 0 is used for GSEA
min.cells.group = 1) # To include clusters with only 1 cell
gsea_res <- test_GSEA(de,
pathway = pathways.hallmark)
plot_GSEA(gsea_res, p_cutoff = 0.1, colors = c("#0570b0", "grey", "#d7301f"))
image.png
image.png
小結(jié)
Scillus的功能其實是很多的捌治,也能畫很多圖,這里Immugent只介紹了一部分纽窟,大家可以進官網(wǎng)進行系統(tǒng)學習(Scillus https://scillus.netlify.app/)肖油。
不過Immugent一直沒搞明白這個包好像沒有自己的函數(shù),都是調(diào)用的別的軟件臂港,因此也沒有發(fā)表相應(yīng)的文章森枪。Whatever视搏,好用就行,小伙伴趕緊用起來哇县袱!