• 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)
    
  • 相关阅读:
    c# 02-18 值类型 引用类型 字符串的不可变性 字符串的处理方法
    c#0218-命名空间
    c#学习0217
    BootStrap学习
    c#学习0216
    AngularJS学习
    java面试题之什么是死锁、活锁、饿死和竞态条件?
    java面试题之能创建volatile数组吗?
    java面试题之sleep()和wait()方法的区别
    java面试题之Thread的run()和start()方法有什么区别
  • 原文地址:https://www.cnblogs.com/xiaosagege/p/15771444.html
Copyright © 2020-2023  润新知