运行以下命令时:
ego.down <- enrichGO(gene = down$newid,
universe = bg.list$newid,
OrgDb = org.Hs.eg.db,
keyType = 'ENSEMBL',
ont = "BP", # biological process, change this to "MF" for molecular function, or "CC" for cellular components
pAdjustMethod = "BH",
pvalueCutoff = 0.01,
qvalueCutoff = 0.05,
readable = TRUE)
dotplot(ego.down,showCategory=20,x="GeneRatio",font.size=13) + ggtitle("GO (BP) terms of down-regulated genes")+
scale_y_discrete(labels=function(x) str_wrap(x,width = 40)) +
theme(plot.title = element_text(size=16,face = "bold",hjust = .5),
legend.title = element_text(size=15),
legend.text = element_text(size=14))
出现报错:
Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : replacement has length zero
检查了一下,发现是阈值设的太高,把阈值调低即可:
pvalueCutoff = 0.01,
qvalueCutoff = 0.05,
把上面的改为:
pvalueCutoff = 0.2,
qvalueCutoff = 0.2,