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富集分析柱状图的更多相关文章

  1. 基因探针富集分析(GSEA)& GO & pathway

    http://blog.sina.com.cn/s/blog_4c1f21000100utyx.html GO是Gene Ontology的简称,是生物学家为了衡量基因的功能而而发起的一个项目,从分子 ...

  2. GO富集分析示例【华为云技术分享】

    版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/devcloud/article/detai ...

  3. DAVID 进行 GO/KEGG 功能富集分析

    何为功能富集分析? 功能富集分析是将基因或者蛋白列表分成多个部分,即将一堆基因进行分类,而这里的分类标准往往是按照基因的功能来限定的.换句话说,就是把一个基因列表中,具有相似功能的基因放到一起,并和生 ...

  4. 利用GSEA对基因表达数据做富集分析

      image Gene Set Enrichment Analysis (GSEA) is a computational method that determines whether an a p ...

  5. R: 修改镜像、bioconductor安装及go基因富集分析

    1.安装bioconductor及go分析涉及的相关包 source("http://bioconductor.org/biocLite.R") options(BioC_mirr ...

  6. GO富集分析

    GO的主要用途之一是对基因组进行富集分析.例如,给定一组在特定条件下上调的基因,富集分析将使用该基因组的注释发现哪些GO术语被过度表示(或未充分表示). 富集分析工具    用户可以直接从GOC网站的 ...

  7. OS Tools-GO富集分析工具的使用与解读详细教程

    我们的云平台上的GO富集分析工具,需要输入的文件表格和参数很简单,但很多同学都不明白其中的原理与结果解读,这个帖子就跟大家详细解释~ 一.GO富集介绍:       Gene Ontology(简称G ...

  8. webgestalt 通路富集分析

    http://www.webgestalt.org/ 通路富集分析 参考 http://www.sci666.com.cn/9596.html

  9. GSEA 基因集富集分析

    http://software.broadinstitute.org/gsea/index.jsp GSEA(Gene Set Enrichment Analysis)是一种生物信息学的计算方法,用于 ...

随机推荐

  1. LAMP配置NFS页面共享,autofs实现挂载,DNS实现名称解析,纯手动操作

    0.实验架构: 共6台服务器 分工如下: 服务器 职责 IP地址 Centos版本 描述 A DNS 172.18.7.70 7 B Apache 172.18.7.71 7 httpd+php-fp ...

  2. 聊聊host中ip/域名映射记录的解析规则

    今天宝叔突然在群里发了个问题; host做如下配置,a.com会指向哪里?或者说ping一下a.com结果会是什么? 127.0.0.1 a.com 192.168.4.106 a.com 192.1 ...

  3. arc093F Dark Horse

    我们可以假设1的位置在1,并且依次与右边的区间合并.答案最后乘上2^n即可. 那么需要考虑1所在的区间与另一个区间合并时,另一个区间的最小值不能为特殊的. 直接求解很难,考虑容斥,钦定在哪几个位置必定 ...

  4. PaaS平台– Google App Engine的开源实现AppScale环境搭建

    搭建好开发环境介绍: 硬件平台:HP Z800 工作站  内存:24GB      硬盘:1TB 虚拟化环境:XenServer 6.2.0 VM1:Ubuntu 12.04 amd64 server ...

  5. 1588. [HNOI2002]营业额统计【平衡树-splay 或 线段树】

    Description 营业额统计 Tiger最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况. Tiger拿出了公司的账本,账本上记录了公司成立以来每 ...

  6. 5 个强大的 HTML5 API

    HTML5提供了一些非常强大的JavaScript和HTML API,来帮助开发者构建精彩的桌面和移动应用程序.本文将介绍5个新型的API,希望对你的开发工作有所帮助. 1.  全屏API(Fulls ...

  7. mysql5.6编译安装

    1.安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl -y yum -y install wget gcc-c++ ncurses nc ...

  8. java 常用类2

    1.1 日期时间类 时间戳(timestamp):距离特定时间的时间间隔. 计算机时间戳是指距离历元(1970-01-01 00:00:00:000)的时间间隔(ms). 计算机中时间2019-04- ...

  9. Redis(三)内存模型

    本文转载自编程迷思,原文链接 深入学习Redis(1):Redis内存模型 前言 Redis是目前最火爆的内存数据库之一,通过在内存中读写数据,大大提高了读写速度,可以说Redis是实现网站高并发不可 ...

  10. wordpress安装(ubuntu+nginx+php+mariadb)

    一.   环境 ubuntu12.04.4 nginx 1.6.0 mariadb 10.0 更新系统补丁 sudo apt-get update sudo apt-get dist-upgrade ...