GO富集分析柱状图
target_gene_id <- unique(read.delim("miRNA-gene interactions.txt")$EntrezID)
# BiocInstaller::biocLite("clusterProfiler")
# BiocInstaller::biocLite("org.Hs.eg.db") display_number = c(, , )
## GO enrichment with clusterProfiler
library(clusterProfiler)
ego_MF <- enrichGO(OrgDb="org.Hs.eg.db",
gene = target_gene_id,
pvalueCutoff = 0.05,
ont = "MF",
readable=TRUE)
ego_result_MF <- as.data.frame(ego_MF)[:display_number[], ]
# ego_result_MF <- ego_result_MF[order(ego_result_MF$Count),] ego_CC <- enrichGO(OrgDb="org.Hs.eg.db",
gene = target_gene_id,
pvalueCutoff = 0.05,
ont = "CC",
readable=TRUE)
ego_result_CC <- as.data.frame(ego_CC)[:display_number[], ]
# ego_result_CC <- ego_result_CC[order(ego_result_CC$Count),] ego_BP <- enrichGO(OrgDb="org.Hs.eg.db",
gene = target_gene_id,
pvalueCutoff = 0.05,
ont = "BP",
readable=TRUE)
ego_result_BP <- na.omit(as.data.frame(ego_BP)[:display_number[], ])
# ego_result_BP <- ego_result_BP[order(ego_result_BP$Count),] go_enrich_df <- data.frame(ID=c(ego_result_BP$ID, ego_result_CC$ID, ego_result_MF$ID),
Description=c(ego_result_BP$Description, ego_result_CC$Description, ego_result_MF$Description),
GeneNumber=c(ego_result_BP$Count, ego_result_CC$Count, ego_result_MF$Count),
type=factor(c(rep("biological process", display_number[]), rep("cellular component", display_number[]),
rep("molecular function", display_number[])), levels=c("molecular function", "cellular component", "biological process"))) ## numbers as data on x axis
go_enrich_df$number <- factor(rev(:nrow(go_enrich_df)))
## shorten the names of GO terms
shorten_names <- function(x, n_word=, n_char=){
if (length(strsplit(x, " ")[[]]) > n_word || (nchar(x) > ))
{
if (nchar(x) > ) x <- substr(x, , )
x <- paste(paste(strsplit(x, " ")[[]][:min(length(strsplit(x," ")[[]]), n_word)],
collapse=" "), "...", sep="")
return(x)
}
else
{
return(x)
}
} labels=(sapply(
levels(go_enrich_df$Description)[as.numeric(go_enrich_df$Description)],
shorten_names))
names(labels) = rev(:nrow(go_enrich_df)) ## colors for bar // green, blue, orange
CPCOLS <- c("#8DA1CB", "#FD8D62", "#66C3A5")
library(ggplot2)
p <- ggplot(data=go_enrich_df, aes(x=number, y=GeneNumber, fill=type)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual(values = CPCOLS) + theme_bw() +
scale_x_discrete(labels=labels) +
xlab("GO term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "The Most Enriched GO Terms") p pdf("go_enrichment_of_miRNA_targets.pdf")
p
dev.off() svg("go_enrichment_of_miRNA_targets.svg")
p
dev.off()
GO富集分析柱状图的更多相关文章
- 基因探针富集分析(GSEA)& GO & pathway
http://blog.sina.com.cn/s/blog_4c1f21000100utyx.html GO是Gene Ontology的简称,是生物学家为了衡量基因的功能而而发起的一个项目,从分子 ...
- GO富集分析示例【华为云技术分享】
版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/devcloud/article/detai ...
- DAVID 进行 GO/KEGG 功能富集分析
何为功能富集分析? 功能富集分析是将基因或者蛋白列表分成多个部分,即将一堆基因进行分类,而这里的分类标准往往是按照基因的功能来限定的.换句话说,就是把一个基因列表中,具有相似功能的基因放到一起,并和生 ...
- 利用GSEA对基因表达数据做富集分析
image Gene Set Enrichment Analysis (GSEA) is a computational method that determines whether an a p ...
- R: 修改镜像、bioconductor安装及go基因富集分析
1.安装bioconductor及go分析涉及的相关包 source("http://bioconductor.org/biocLite.R") options(BioC_mirr ...
- GO富集分析
GO的主要用途之一是对基因组进行富集分析.例如,给定一组在特定条件下上调的基因,富集分析将使用该基因组的注释发现哪些GO术语被过度表示(或未充分表示). 富集分析工具 用户可以直接从GOC网站的 ...
- OS Tools-GO富集分析工具的使用与解读详细教程
我们的云平台上的GO富集分析工具,需要输入的文件表格和参数很简单,但很多同学都不明白其中的原理与结果解读,这个帖子就跟大家详细解释~ 一.GO富集介绍: Gene Ontology(简称G ...
- webgestalt 通路富集分析
http://www.webgestalt.org/ 通路富集分析 参考 http://www.sci666.com.cn/9596.html
- GSEA 基因集富集分析
http://software.broadinstitute.org/gsea/index.jsp GSEA(Gene Set Enrichment Analysis)是一种生物信息学的计算方法,用于 ...
随机推荐
- Python学习---django下的Session操作 180205
和Cookie一样,都是用来进行用户认证.不同的是,Cookie可以吧明文/密文的信息都会KV返回给客户段,但是session可以吧用户的Value[敏感信息]保存在服务器端,安全. Django中默 ...
- PHP面试常用算法(推荐)
一.冒泡排序 基本思想: 对需要排序的数组从后往前(逆序)进行多遍的扫描,当发现相邻的两个数值的次序与排序要求的规则不一致时,就将这两个数值进行交换.这样比较小(大)的数值就将逐渐从后面向前面移动. ...
- OC继承
1.成员访问类型 private:私有成员,不能被外部函数访问(使用),也不能被子类继承: protected:保护成员,不能被外部函数访问,可以被子类继承: public:公有成员,可以被外部函数访 ...
- zeromq 笔记
一. 当执行zmq_bind后会进入mute state,直到有进入或者出去的连接发生才会进入ready state 在mute state状态下会根据不同的套接字类型决定是丢弃消息还是阻塞 可参考z ...
- BZOJ 1008 越狱 组合数学
题目链接: https://www.lydsy.com/JudgeOnline/problem.php?id=1008 题目大意: 监狱有连续编号为1...N的N个房间,每个房间关押一个犯人,有M种宗 ...
- BZOJ1880:[SDOI2009]Elaxia的路线(最短路,拓扑排序)
Description 最近,Elaxia和w**的关系特别好,他们很想整天在一起,但是大学的学习太紧张了,他们 必须合理地安排两个人在一起的时间.Elaxia和w**每天都要奔波于宿舍和实验室之间, ...
- DP入门——01背包 & 完全背包
01背包: 采药: https://www.luogu.org/problemnew/show/P1048 #include <iostream> #include <algorit ...
- Sublime Text 3中文乱码问题解决
Sublime Text 3是我MacBook Pro最喜欢的代码编辑器,没有之一,因为她的性感高亮代码配色,更因为它的小巧,但是它默认不支持GBK的编码格式,因此打开GBK的代码文件,如果里面有中文 ...
- ES6标准入门 字符串的扩展
1:模板字符串与模板引擎 https://blog.csdn.net/crper/article/details/52940625 es6模板字符串中标签模板作为参数时产生空元素的问题 https:/ ...
- 【原创】纯CSS画黄金梅丽号!
代码如下 <!DOCTYPE html> <!-- saved from url=(0055)http://jadyoap.bj.bcebos.com/ife%2FcssCatAni ...