目录

富集网络图

使用的R包:aPEAR

代码

suppressMessages({
#library(devtools)
#install_github('ievaKer/aPEAR')
#library(plotly)
library(aPEAR)
#library(clusterProfiler)
library(argparser)})

argv <- arg_parser('')
argv <- add_argument(argv,"--enrich_result", help="")
argv <- add_argument(argv,"--minClusterSize", help="每个网络至少包含的通路数量", default= 5)
argv <- add_argument(argv,"--prefix", help="")
argv <- parse_args(argv)

enrich_result = argv$enrich_result
if (is.na(argv$minClusterSize)){
    minClusterSize <- 5
}else{
    minClusterSize = argv$minClusterSize
}

prefix = argv$prefix

k <- read.table(enrich_result, sep = '\t',header = T, quote = '')

P <- enrichmentNetwork(k, drawEllipses = F, fontSize = 4,repelLabels =F,
                       minClusterSize=minClusterSize,clustNameMethod='hits',simMethod = 'jaccard',
                       nodeSize='Count',colorBy = 'pvalue',colorType = 'pval')+
  scale_color_gradientn(colours = c("#B83D3D",'white','#1A5592'),
                        name = "pvalue")

pdf(file=paste(prefix, '.pdf',sep=''))
P
dev.off()
svg(filename=paste(prefix, '.svg',sep=''))
P
dev.off()
ggsave(file=paste(prefix, '.png',sep=''),type='cairo-png',plot=P)

示例图