# A plotting 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 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages( "ggplot2" ); library( ggplot2 ); # -------------------------------------------------------------------------- # If you don't have the scales package installed, uncomment the following line: # install.packages( "scales" ); library( scales ); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0007610","behavior", 0.089,-0.172,-7.373, 4.222,0.917,0.000), c("GO:0019915","lipid storage", 0.007, 1.227,-0.680, 3.134,0.970,0.000), c("GO:0019953","sexual reproduction", 0.079, 5.300, 5.181, 4.173,0.922,0.000), c("GO:0022610","biological adhesion", 2.091,-1.294, 1.422, 5.593,0.971,0.000), c("GO:0040034","regulation of development, heterochronic", 0.002, 5.850,-2.455, 2.610,0.633,0.000), c("GO:0042743","hydrogen peroxide metabolic process", 0.044, 1.069, 2.504, 3.921,0.946,0.000), c("GO:0065004","protein-DNA complex assembly", 0.153,-0.684,-2.171, 4.458,0.843,0.000), c("GO:0007155","cell adhesion", 0.622, 4.731,-5.361, 5.067,0.827,0.016), c("GO:0006690","icosanoid metabolic process", 0.012, 1.314, 6.757, 3.341,0.912,0.029), c("GO:0006022","aminoglycan metabolic process", 1.088,-5.008, 2.525, 5.310,0.889,0.036), c("GO:0016042","lipid catabolic process", 0.183,-1.072, 6.793, 4.536,0.874,0.090), c("GO:0006414","translational elongation", 0.839,-5.976, 0.089, 5.197,0.872,0.148), c("GO:0055114","oxidation-reduction process",16.017,-0.266, 5.379, 6.477,0.932,0.171), c("GO:0007631","feeding behavior", 0.011,-2.090,-6.391, 3.311,0.906,0.250), c("GO:0008380","RNA splicing", 0.164,-5.682,-0.605, 4.487,0.864,0.251), c("GO:0007219","Notch signaling pathway", 0.016, 0.877,-5.665, 3.490,0.747,0.256), c("GO:0006970","response to osmotic stress", 0.032,-1.422,-7.035, 3.776,0.907,0.267), c("GO:0006357","regulation of transcription from RNA polymerase II promoter", 0.359,-4.641,-1.444, 4.827,0.770,0.277), c("GO:0010033","response to organic substance", 0.351,-0.379,-6.824, 4.818,0.905,0.318), c("GO:0006575","cellular modified amino acid metabolic process", 0.958,-3.425, 4.435, 5.254,0.857,0.334), c("GO:0051173","positive regulation of nitrogen compound metabolic process", 0.310,-4.076,-2.925, 4.764,0.752,0.380), c("GO:0001573","ganglioside metabolic process", 0.001,-2.850, 5.826, 2.449,0.856,0.386), c("GO:0007565","female pregnancy", 0.012, 6.478, 2.720, 3.344,0.708,0.386), c("GO:0051253","negative regulation of RNA metabolic process", 0.438,-4.442,-1.790, 4.915,0.761,0.401), c("GO:0033559","unsaturated fatty acid metabolic process", 0.013,-1.313, 6.633, 3.376,0.868,0.440), c("GO:0060429","epithelium development", 0.082, 7.148,-1.926, 4.187,0.607,0.451), c("GO:0030878","thyroid gland development", 0.003, 6.971, 0.233, 2.691,0.587,0.479), c("GO:0008202","steroid metabolic process", 0.052,-2.038, 6.080, 3.985,0.864,0.485), c("GO:0045471","response to ethanol", 0.006,-0.754,-6.465, 3.082,0.916,0.516), c("GO:0006351","transcription, DNA-dependent", 9.954,-5.081, 0.139, 6.271,0.798,0.520), c("GO:0009880","embryonic pattern specification", 0.011, 6.943,-0.103, 3.318,0.546,0.522), c("GO:0048609","multicellular organismal reproductive process", 0.079, 6.552, 2.380, 4.168,0.679,0.526), c("GO:0045165","cell fate commitment", 0.039, 6.535,-2.541, 3.863,0.587,0.538), c("GO:0007548","sex differentiation", 0.040, 6.750, 0.941, 3.877,0.606,0.539), c("GO:0001890","placenta development", 0.017, 6.566,-0.093, 3.501,0.551,0.587), c("GO:0032504","multicellular organism reproduction", 0.084, 6.745, 2.547, 4.198,0.678,0.599), c("GO:0007389","pattern specification process", 0.068, 6.792,-0.531, 4.106,0.542,0.602), c("GO:0006631","fatty acid metabolic process", 0.841,-1.349, 6.310, 5.197,0.837,0.607), c("GO:0031497","chromatin assembly", 0.151, 0.794,-2.734, 4.451,0.683,0.609), c("GO:0048663","neuron fate commitment", 0.008, 6.521,-0.794, 3.180,0.542,0.636), c("GO:0001501","skeletal system development", 0.047, 6.748,-0.372, 3.946,0.537,0.643), c("GO:0009651","response to salt stress", 0.017,-1.195,-7.198, 3.500,0.909,0.670)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");