# A treemap R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # author: Anton Kratz , RIKEN Omics Science Center, Functional Genomics Technology Team, Japan # created: Fri, Nov 02, 2012 7:25:52 PM # last change: Fri, Nov 09, 2012 3:20:01 PM # ----------------------------------------------------------------------------- # If you don't have the treemap package installed, uncomment the following line: # install.packages( "treemap" ); library(treemap) # treemap package by Martijn Tennekes # Set the working directory if necessary # setwd("C:/Users/username/workingdir"); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","freqInDbPercent","uniqueness","dispensability","representative"); revigo.data <- rbind(c("GO:0007610","behavior",0.089,0.917,0.000,"behavior"), c("GO:0007631","feeding behavior",0.011,0.906,0.250,"behavior"), c("GO:0009651","response to salt stress",0.017,0.909,0.670,"behavior"), c("GO:0006970","response to osmotic stress",0.032,0.907,0.267,"behavior"), c("GO:0007219","Notch signaling pathway",0.016,0.747,0.256,"behavior"), c("GO:0010033","response to organic substance",0.351,0.905,0.318,"behavior"), c("GO:0045471","response to ethanol",0.006,0.916,0.516,"behavior"), c("GO:0019915","lipid storage",0.007,0.970,0.000,"lipid storage"), c("GO:0019953","sexual reproduction",0.079,0.922,0.000,"sexual reproduction"), c("GO:0032504","multicellular organism reproduction",0.084,0.678,0.599,"sexual reproduction"), c("GO:0007565","female pregnancy",0.012,0.708,0.386,"sexual reproduction"), c("GO:0048609","multicellular organismal reproductive process",0.079,0.679,0.526,"sexual reproduction"), c("GO:0022610","biological adhesion",2.091,0.971,0.000,"biological adhesion"), c("GO:0040034","regulation of development, heterochronic",0.002,0.633,0.000,"regulation of development, heterochronic"), c("GO:0045165","cell fate commitment",0.039,0.587,0.538,"regulation of development, heterochronic"), c("GO:0001501","skeletal system development",0.047,0.537,0.643,"regulation of development, heterochronic"), c("GO:0007389","pattern specification process",0.068,0.542,0.602,"regulation of development, heterochronic"), c("GO:0009880","embryonic pattern specification",0.011,0.546,0.522,"regulation of development, heterochronic"), c("GO:0060429","epithelium development",0.082,0.607,0.451,"regulation of development, heterochronic"), c("GO:0048663","neuron fate commitment",0.008,0.542,0.636,"regulation of development, heterochronic"), c("GO:0030878","thyroid gland development",0.003,0.587,0.479,"regulation of development, heterochronic"), c("GO:0007548","sex differentiation",0.040,0.606,0.539,"regulation of development, heterochronic"), c("GO:0001890","placenta development",0.017,0.551,0.587,"regulation of development, heterochronic"), c("GO:0042743","hydrogen peroxide metabolic process",0.044,0.946,0.000,"hydrogen peroxide metabolism"), c("GO:0065004","protein-DNA complex assembly",0.153,0.843,0.000,"protein-DNA complex assembly"), c("GO:0031497","chromatin assembly",0.151,0.683,0.609,"protein-DNA complex assembly"), c("GO:0007155","cell adhesion",0.622,0.827,0.016,"cell adhesion"), c("GO:0006690","icosanoid metabolic process",0.012,0.912,0.029,"icosanoid metabolism"), c("GO:0006575","cellular modified amino acid metabolic process",0.958,0.857,0.334,"icosanoid metabolism"), c("GO:0006022","aminoglycan metabolic process",1.088,0.889,0.036,"aminoglycan metabolism"), c("GO:0006414","translational elongation",0.839,0.872,0.148,"aminoglycan metabolism"), c("GO:0008380","RNA splicing",0.164,0.864,0.251,"aminoglycan metabolism"), c("GO:0051253","negative regulation of RNA metabolic process",0.438,0.761,0.401,"aminoglycan metabolism"), c("GO:0006357","regulation of transcription from RNA polymerase II promoter",0.359,0.770,0.277,"aminoglycan metabolism"), c("GO:0051173","positive regulation of nitrogen compound metabolic process",0.310,0.752,0.380,"aminoglycan metabolism"), c("GO:0006351","transcription, DNA-dependent",9.954,0.798,0.520,"aminoglycan metabolism"), c("GO:0016042","lipid catabolic process",0.183,0.874,0.090,"lipid catabolism"), c("GO:0008202","steroid metabolic process",0.052,0.864,0.485,"lipid catabolism"), c("GO:0001573","ganglioside metabolic process",0.001,0.856,0.386,"lipid catabolism"), c("GO:0033559","unsaturated fatty acid metabolic process",0.013,0.868,0.440,"lipid catabolism"), c("GO:0006631","fatty acid metabolic process",0.841,0.837,0.607,"lipid catabolism"), c("GO:0055114","oxidation-reduction process",16.017,0.932,0.171,"lipid catabolism")); stuff <- data.frame(revigo.data); names(stuff) <- revigo.names; stuff$abslog10pvalue <- as.numeric( as.character(stuff$abslog10pvalue) ); stuff$freqInDbPercent <- as.numeric( as.character(stuff$freqInDbPercent) ); stuff$uniqueness <- as.numeric( as.character(stuff$uniqueness) ); stuff$dispensability <- as.numeric( as.character(stuff$dispensability) ); # by default, outputs to a PDF file pdf( file="revigo_treemap.pdf", width=16, height=9 ) # width and height are in inches # check the tmPlot command documentation for all possible parameters - there are a lot more tmPlot( stuff, index = c("representative","description"), vSize = "abslog10pvalue", type = "categorical", vColor = "representative", title = "REVIGO Gene Ontology treemap", inflate.labels = FALSE, # set this to TRUE for space-filling group labels - good for posters lowerbound.cex.labels = 0, # try to draw as many labels as possible (still, some small squares may not get a label) bg.labels = "#CCCCCCAA", # define background color of group labels # "#CCCCCC00" is fully transparent, "#CCCCCCAA" is semi-transparent grey, NA is opaque position.legend = "none" ) dev.off()