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()
