zoukankan      html  css  js  c++  java
  • GO富集图

    library(readxl)
    library('ggplot2')
    #pathway=read_xlsx('BSR_down.xlsx')
    pathway=read_xlsx('BSR-down.xlsx')
    dir()
    Class<-pathway$GO
    p = ggplot(pathway,aes(-1*log10(Pvalue),Pathway,shape=Class))
    p=p + geom_point()
    # 修稿点的大小
    p=p + geom_point(aes(size=Count))
    # 展示三维数据
    pbubble = p+ geom_point(aes(size=Count,color=-1*log10(Pvalue)))
    # 设置渐变色
    pr = pbubble+scale_color_gradient(low="green",high = "red")
    # 绘制p气泡图
    pr = pr+labs(color=expression(-log[10](Pvalue)),size="Count",
                 x="-log10(Pvalue)",y="Pathway name",title="Pathway enrichment")
    pr + theme_bw()
    ggsave("MSLT_down.pdf")# 保存为pdf格式
    ggsave("MSLT_down.png",width=4,height=4)
    

    数据类型

    GO Pathway Pvalue Count
    Cellular component photosystem II 8.89E-09 17
    Cellular component photosystem 2.65E-08 18
    Cellular component photosystem I 9.43E-08 12
    Cellular component photosynthetic membrane 1.70548E-06 28
    library(readxl)
    library('ggplot2')
    library(eoffice)
    #pathway=read_xlsx('BSR_down.xlsx')
    pathway=read_xlsx('GO_MSLT.xlsx',sheet = 2)
    dir()
    Class<-pathway$GO
    p = ggplot(pathway,aes(-1*log10(Pvalue),Pathway))
    p=p + geom_point()
    # 修稿点的大小
    p=p + geom_point(aes(size=Count))
    # 展示三维数据
    p= p+ geom_point(aes(size=Count))
    # 设置渐变色
    #p = p+scale_color_gradient(low="green",high = "red")
    # 绘制p气泡图
    p = p+labs(color=expression(-log[10](Pvalue)),size="Count",
                 x="-log10(Pvalue)",y="Pathway",title="Pathway enrichment")
    p + theme_bw()+theme(axis.text.x = element_text(size = 14,colour = "black",face = "bold",family = "serif"))+
      theme(axis.text.y = element_text(size = 14,colour = "black",face = "bold",family = "serif"))+
      theme(axis.title.x = element_text(size = 14,face = "bold",family = "serif"))+
      theme(axis.title.y = element_text(size = 14,face = "bold",family = "serif"))
    
    #toffice(figure = p,format = "pptx",title=a,filename = "go.pptx",height = 7.5,width =8.5,append = TRUE)
    
    #ggsave("MSLT_down.pdf")# 保存为pdf格式
    ggsave("MSLT_up.png",width=6,height=5)
    
  • 相关阅读:
    windows2003 系统定时关机
    利用批处理轻松压缩文件
    JavaScript中的常用算法和函数
    ASP.NET Session丢失问题原因及解决方案
    JavaScript文字自动排版
    js图片自动滚动并带翻页的功能
    IE下不显示自定义错误页面
    ArcObject 实现拓扑创建和检查
    ArcGIS Server 的默认设置
    ArcObject 要素删除
  • 原文地址:https://www.cnblogs.com/xiaosagege/p/15771444.html
Copyright © 2011-2022 走看看