富集分析流星图?

引言


浅浅画个富集流星图?
plot now

富集分析:
library(clusterProfiler)
library(dplyr)

data(geneList, package=”DOSE”)
gene <- names(geneList)[abs(geneList) > 2]

eego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = “ALL”, pAdjustMethod = “BH”, pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) 数据处理: df <- data.frame(eego) %>%
group_by(ONTOLOGY) %>%
slice_head(n = 6) %>%
arrange(desc(pvalue))

ratio <- lapply(df$GeneRatio,function(x){as.numeric(eval(parse(text = x)))}) %>% unlist()
df$ratio <- ratio

df$Description <- factor(df$Description,levels = df$Description)
画!
ggplot(df) +
ggforce::geom_link(aes(x = 0,y = Description,
xend = -log10(pvalue),yend = Description,
alpha = stat(index),
color = ONTOLOGY,
size = after_stat(index)),
n = 500,
# color = “#FF0033”,
show.legend = F) +
geom_point(aes(x = -log10(pvalue),y = Description),
color = “black”,
fill = “white”,size = 6,shape = 21) +
geom_line(aes(x = ratio*100,y = Description,group = 1),
orientation = “y”,linewidth = 1,color = “#FFCC00”) +
scale_x_continuous(sec.axis = sec_axis(~./100,
labels = scales::label_percent(),
name = “Percent of geneRatio”)) +
theme_bw() +
theme(panel.grid = element_blank(),
strip.text = element_text(face = “bold.italic”),
axis.text = element_text(color = “black”)) +
ylab(“”) + xlab(“-log10 Pvalue”) +
facet_wrap(~ONTOLOGY,scales = “free”,ncol = 1) +
scale_color_brewer(palette = “Set1”)

学废了。
结尾


路漫漫其修远兮,吾将上下而求索。
欢迎加入生信交流群。加我微信我也拉你进 微信群聊 老俊俊生信交流群 (微信交流群需收取 20 元入群费用,一旦交费,拒不退还!(防止骗子和便于管理)) 。QQ 群可免费加入, 记得进群按格式修改备注哦。

声明:文中观点不代表本站立场。本文传送门:https://eyangzhen.com/416922.html

(0)
联系我们
联系我们
分享本页
返回顶部