R语言shiny如何实现简单的GO富集分析
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,这篇文章主要介绍"R语言shiny如何实现简单的GO富集分析",在日常操作中,相信很多人在R语言shiny如何实现简单的GO富集分析问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对
千家信息网最后更新 2025年12月02日R语言shiny如何实现简单的GO富集分析image.png 用于做测试的 id (人)
image.png 
image.png
这篇文章主要介绍"R语言shiny如何实现简单的GO富集分析",在日常操作中,相信很多人在R语言shiny如何实现简单的GO富集分析问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"R语言shiny如何实现简单的GO富集分析"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
模仿的是 https://github.com/sk-sahu/sig-bio-shiny
基本功能是用户输入
gene id pvalue qvalue
然后分别把
BP CC MF
以表格输出,
汇总结果下载(压缩文件) go富集结果的dotplot
代码中 cc和mf结果表格输出的逻辑没有写,和bp是完全一样的
library(shiny)
ui<-navbarPage("Pomegranate",
tabPanel("Gene Ontology",
sidebarLayout(sidebarPanel(width=2,
textAreaInput("text_area_list",
label = "Please input protein id, one per line",
height = "200px",
width="180px",
value="Pg00001\nPg00002"),
selectInput("id_type",label = "Input gene-id Type",
selected = "ensembl",
choices = c('ensembl','refseq','entrezid')),
helpText("Please"),
numericInput('pval_cutoff',label="pvalue-Cutoff",
value = 1,min=0.001,max=1,step=0.001),
numericInput("qval_cutoff",label="qvalue-Cutoff",
value=1,min=0.001,max=1,step=0.001),
actionButton('submit',label = 'Submit',
icon=icon('angle-double-right')),
tags$hr()),
mainPanel(helpText("ABC"),
downloadButton('download_plot',label = "Download results plot"),
downloadButton('download_table',label="Download result table"),
textOutput("gene_number_info"),
tags$br(),
tags$br(),
tabsetPanel(
tabPanel("Biological Process",DT::dataTableOutput(outputId="table_go_bp")),
tabPanel("Cellular Component",DT::dataTableOutput(outputId = "table_go_cc")),
tabPanel("Molecular Functions",DT::dataTableOutput(outputId = 'table_go_mf')),
tabPanel("dotplot",plotOutput('dot_plot_go'))
)))))
server<-function(input,output){
observeEvent(input$submit,{
withProgress(message = 'Steps:',value=0,{
incProgress(1/7,detail = "A")
text_area_input<-input$text_area_list
print(text_area_input)
df<-as.data.frame(matrix(unlist(stringr::str_split(text_area_input,"\n")),ncol=1))
colnames(df)<-"protein_id"
print(dim(df))
input_gene_number<-dim(df)[1]
output$gene_number_info<-renderText({
paste("Done!","Total Number of Input genes:",input_gene_number,sep="\n")
})
incProgress(2/7,detail = "B")
library(clusterProfiler)
enrichGO_res<-enrichGO(gene=df$protein_id,
OrgDb = 'org.Hs.eg.db',
ont="all",
pvalueCutoff = input$pval_cutoff,
qvalueCutoff = input$qval_cutoff)
go_enricher_res<-enrichGO_res@result
go_bp<-go_enricher_res[go_enricher_res$ONTOLOGY == "BP",]
output$table_go_bp<-DT::renderDataTable({
go_bp
})
incProgress(3/7,detail="plot")
output$dot_plot_go<-renderPlot({
p1<-dotplot(enrichGO_res)
print(p1)
})
incProgress(4/7,detail = "OK")
go_plot_download<-reactive({
dotplot(enrichGO_res)
}
)
output$download_plot<-downloadHandler(
filename = function(){
paste("go_dot_plot.png",sep='')
},
content = function(file){
ggplot2::ggsave(file,plot=go_plot_download(),device = 'png',width=12,height = 10)
}
)
output$download_table<-downloadHandler(
filename = function(){
paste0("ABC.zip")
},
content = function(file){
fs<-c('go_results.tsv')
write.table(go_enricher_res,file="go_results.tsv",sep="\t",row.names = F)
zip(zipfile = file,files=fs)
},
contentType = "application/zip"
)
})
})
}
shinyApp(ui,server)
界面是这样子的4312
8318
10874
55143
55388
991
6280
2305
9493
1062
3868
4605
9833
9133
6279
10403
8685
597
7153
23397
6278
79733
259266
1381
3627
27074
6241
55165
9787
7368
11065
55355
9582
220134
55872
51203
3669
83461
22974
10460
10563
4751
6373
8140
79019
820
10635
1844
4283
27299
结果

到此,关于"R语言shiny如何实现简单的GO富集分析"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
富集
语言
分析
结果
学习
代码
更多
表格
帮助
输出
实用
接下来
功能
文件
文章
方法
样子
理论
用户
界面
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数据库查询语句范围查找
数据库怎么备份到磁带上
工业网络技术感受
网络安全罚款条例
收购小软件开发工作室价格
世邦对讲服务器配置
啥是网络安全演练
软件开发 简历 模板
网络安全空间学什么待遇如何
fm2022国足数据库
老帕萨特氧传感器数据库
视频自动制作软件开发
常州网络安全教育平台
服务器提示安全密码
解析标签数据添加到数据库
湖南华为服务器虚拟化费用
ps4哪个服务器好
维护政治网络安全的重要意义
天涯数据库技术学校
wamp和数据库乱码
软件开发的电子印章从哪儿来
网络安全一年能挣多少钱
怀仁市公安局网络安全大队长
怎么测试软件开发
数据库管理方式的缺点
新技术方向及其网络安全问题
宜丰软件开发
网络安全公钥作用
于细微之处抓网络安全
商务软件开发考核