使用clusterprofile做聚类分析

library(clusterProfiler )

#cat test.txt

gene_symbol

EXOSC10
ARHGEF10L
VWA5B1
SRRM1
PTAFR
CSMD2
SH3GLB1
GBP6
ZNF326
AKNAD1
STRIP1
GOLPH3L
...............

a <- read.table("test.txt",colClasses = "character")
b <- a[,1]
eg = bitr(b, fromType="SYMBOL", toType="ENTREZID", annoDb="org.Hs.eg.db")
head(eg)
write.table(eg, file="test_id.txt")

idType("org.Hs.eg.db")
gene <- eg[,2]
head(gene)

ggo <- groupGO(gene = gene,
organism = "human",
ont = "BP",
level = 7,
readable = TRUE)
head(summary(ggo))
write.table(as.matrix(ggo@result), file="test_ggo.txt")
#导出ggo的结果


ego_cc <- enrichGO(gene = gene,
organism = "human",
ont = "CC",
pAdjustMethod = "BH",
minGSSize = 1,
pvalueCutoff = 1,
qvalueCutoff = 1,
readable = TRUE)
head(summary(ego))
write.table(as.matrix(ego_cc@result), file="test_cc.txt")


ego_BP <- enrichGO(gene = gene,
organism = "human",
ont = "BP",
pAdjustMethod = "BH",
minGSSize = 1,
pvalueCutoff = 1,
qvalueCutoff = 1,
readable = TRUE)
write.table(as.matrix(ego_BP@result), file="test_BP.txt")

ego_MF <- enrichGO(gene = gene,
organism = "human",
ont = "MF",
pAdjustMethod = "BH",
minGSSize = 1,
pvalueCutoff = 1,
qvalueCutoff = 1,
readable = TRUE)
write.table(as.matrix( ego_MF@result), file="test_MF.txt")

kk <- enrichKEGG(gene = gene,
organism="human",
pvalueCutoff = 1,
qvalueCutoff = 1,
minGSSize = 1,
readable = TRUE,
use_internal_data =FALSE)
write.table(as.matrix(kk@result), file="test_kk.txt")

# barplot(ggo, drop=TRUE, showCategory=24)
barplot(ego_cc, showCategory=24)
dotplot(ego_cc)
barplot(ego_BP, showCategory=24)
dotplot(ego_BP)
barplot(ego_MF, showCategory=24)
dotplot(ego_MF)

barplot(kk, drop=TRUE, showCategory=24)

dev.off()

转载于:https://www.cnblogs.com/qiniqnyang/p/5826925.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值