1.安装RcisTarget所需要的程序包
BiocManager::install(c("AUCell", "RcisTarget"))
另外,可以安装一些其他程序包用来R进行cisTarget的交互式展示:
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
# To support paralell execution:
BiocManager::install(c("doMC", "doRNG"))
# For the examples in the follow-up section of the tutorial:
BiocManager::install(c("DT", "visNetwork"))
下载RcisTarget使用所需的数据库,包括两种数据库:
每对基因基序的得分可以用不同的参数来进行。因此,我们提供多个数据库(motif-rankings),根据以下几种可能性:
具体的数据库在:https://resources.aertslab.org/cistarget/ 可以直接下载,也可以通过以下链接下载
featherURL <- "https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-10kb-7species.mc9nr.feather"
download.file(featherURL, destfile=basename(featherURL))
RcisTarget进行的所有计算均基于motif。但是,大多数用户对可能调节gene list的TF感兴趣。因此需要提供motif与转录因子的相关联的文件。 对于“ mc9nr”版本中的motif 注释,已包含在RcisTarget软件包中,并且可以使用以下命令加载:
# mouse:
# data(motifAnnotations_mgi)
# human:
data(motifAnnotations_hgnc)
对于其他版本的motif,可以使用importAnnotations
从源文件导入。
library(RcisTarget)
# Load gene sets to analyze.
geneList1 <- read.table(file.path(system.file('examples', package='RcisTarget'), "hypoxiaGeneSet.txt"), stringsAsFactors=FALSE)[,1]
head(geneList1)
#> head(geneList1)
#>"ADM" "ADORA2B" "AHNAK2" "AK4" "AKAP12" "ALDOC"
geneLists <- list(geneListName=geneList1)
# Select motif database to use (i.e. organism and distance around TSS)
data(motifAnnotations_hgnc)
#Import the motif databases for RcisTarget.
#featherURL <- "https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-10kb-7species.mc9nr.feather"
#download.file(featherURL, destfile=basename(featherURL))
motifRankings <- importRankings("hg19-tss-centered-10kb-7species.mc9nr.feather")
# Motif enrichment analysis:
motifEnrichmentTable_wGenes <- cisTarget(geneLists, motifRankings,
motifAnnot=motifAnnotations_hgnc)
RcisTarget的最终输出的data.table包含有关motif 富集的以下信息:
geneSet:基因集的名称 motif:motif的ID NES:基因集中基序的标准化富集得分 AUC:曲线下的面积(用于计算NES) TFinDB:指示突出显示的TF是包含在高置信度注释(两个星号)还是低置信度注释(一个星号)中。 TF_highConf:根据'motifAnnot_highConfCat'注释到基序的转录因子。 TF_lowConf:根据'motifAnnot_lowConfCat'注释到主题的转录因子。 erichedGenes:在给定motif上排名较高的基因。 nErnGenes:高度排名的基因数量 rankAtMax:在最大富集时的排名,用于确定富集的基因数。
motifEnrichmentTable_wGenes_wLogo <- addLogo(motifEnrichmentTable_wGenes)
resultsSubset <- motifEnrichmentTable_wGenes_wLogo[1:10,]
library(DT)
datatable(resultsSubset[,-c("enrichedGenes", "TF_lowConf"), with=FALSE],
escape = FALSE, # To show the logo
filter="top", options=list(pageLength=5))
参考:https://bioconductor.org/packages/devel/bioc/vignettes/RcisTarget/inst/doc/RcisTarget.html