前言:GRN究竟 可以被用来做什么?在bulk GSVA学习时我也有过类似的困惑。在官方文档中,多次强调用GRN AUC去cluster,且效果比单纯基于表达量的降维聚类方法好,SCENIC不是文章做到最后充数的高级分析,而是发现 cell type-specific GRN, 后续聚类发现亚型的利器。
SCENIC in R有两个教程,第一个主要是简介、安装与读入,第二个是pipeline。
SCENIC的输入文件比较简单,scRNA的表达矩阵,列名细胞,行名gene symbol。在数据格式的问题上,作者比较自信,无论raw count、Seurat标准化还是TPM标准化,得到的结果都robust。
SCENIC依赖于三个R包以进行四个步骤:
(1)GENIE3 infers the co-expression network (faster alternative: GRNBoost2).但引入了较多假阳性,需要交到第二步进一步验证筛选。
(2)RcisTarget for the analysis of transcription factor binding motifs.个人认为应R-cis-Target比较合适。
(3)AUCell to identify cells with active gene sets (gene network) in scRNA. 这个AUCell和Seurat里的某个功能、bulk里的GSVA很像,用gene set打分。
(4)根据AUCell结果进行细胞聚类
- 安装包
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::version()
BiocManager::install(c("AUCell", "RcisTarget"))
BiocManager::install(c("GENIE3"))
BiocManager::install(c("zoo", "mixtools", "rbokeh"))
BiocManager::install(c("DT", "NMF", "ComplexHeatmap", "R2HTML", "Rtsne"))
BiocManager::install(c("doMC", "doRNG"))
if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
devtools::install_github("aertslab/SCopeLoomR", build_vignettes = TRUE)
if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
devtools::install_github("aertslab/SCENIC")
packageVersion("SCENIC")
- 下载物种特异性数据库
#人
dbFiles <- c("https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-500bp-upstream-7species.mc9nr.feather",
"https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-10kb-7species.mc9nr.feather")
# mc9nr: Motif collection version 9: 24k motifs
#mus musculus
dbFiles <- c("https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-500bp-upstream-7species.mc9nr.feather",
"https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-10kb-7species.mc9nr.feather")
# mc9nr: Motif collection version 9: 24k motifs
- 输入数据格式
输入数据为表达矩阵,行名gene symbol
(1)从GEO数据库下载
###下载数据
if (!requireNamespace("GEOquery", quietly = TRUE)) BiocManager::install("GEOquery")
library(GEOquery)
geoFile <- getGEOSuppFiles("GSE60361", makeDirectory=FALSE)
gzFile <- grep("Expression", basename(rownames(geoFile)), value=TRUE)
txtFile <- gsub(".gz", "", gzFile)
gunzip(gzFile, destname=txtFile, remove=TRUE)
library(data.table)
geoData <- fread(txtFile, sep="\t")
geneNames <- unname(unlist(geoData[,1, with=FALSE]))
exprMatrix <- as.matrix(geoData[,-1, with=FALSE])
rm(geoData)
dim(exprMatrix)
rownames(exprMatrix) <- geneNames
exprMatrix <- exprMatrix[unique(rownames(exprMatrix)),]
exprMatrix[1:5,1:4]
# Remove file downloaded:
file.remove(txtFile)
###细胞分组信息,直接包内下载省事
cellLabels <- paste(file.path(system.file('examples', package='AUCel