Draw GO bubble Picture with results of dataframe format of clusterProfiler (根据clusterProfiler的dataframe结果,绘制气泡图)

library(ggplot2)
options(stringsAsFactors=F)
dz <- read.table("test.txt",sep="\t",header=T,check.names=F)
head(dz)

n <- 1
for (i in (dz$GeneRatio)){
    j=strsplit(i,'\\/')
    dd <- unlist(j)
    value <- (as.numeric(dd[1])/as.numeric(dd[2]))
    dz$GeneRatio[n] <- sprintf("%.2f",value)
    n=n+1
    }


pp <- ggplot(dz,aes(GeneRatio,Description))
pp <- pp + geom_point()
pbubble <- pp + geom_point(aes(size=Count,color=qvalue))
tiff(file="GO_dotplot_new.tiff",width=25,height=30,units="cm",compression="lzw",bg="white",res=600)
pbubble + scale_colour_gradient(low="green",high="red") + labs(color=expression(qvalue),size="Count",x="GeneRatio",y="GO results",title="Results of GO enrichment analysis") + facet_grid(ONTOLOGY~.,scale="free")
dev.off()

此条目发表在R分类目录。将固定链接加入收藏夹。

发表评论

邮箱地址不会被公开。 必填项已用*标注

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

Protected with IP Blacklist CloudIP Blacklist Cloud