Packages For Visualization Of Biological Data In R
4
10
Entering edit mode
12.7 years ago

A common task in bioinformatics analysis is the visualization of data, in particular creating figures for manuscripts. I have found R to be incredibly powerful for this task. However, the figures created using many base plotting functions are somewhat 'plain' for publication purposes. This often necessitates additional modification and annotation in Illustrator, Inkscape, etc.

It seems that virtually anything is possible but I'm interested in recommendations for packages/libraries that will help me create richer figures entirely within R.

If you want some specific examples of issues that I have found challenging, these include things like:

  1. legend creation
  2. creation of multi-panel figures with custom margins
  3. addition of unusual 'symbols' to plots (e.g. greek letters, etc.)
  4. use of transparency
  5. more control of fonts

I realize this is a broad question but I am keen to learn about any tricks that will help me push my figures closer to publication quality in R and minimize manual post processing.

r visualization • 16k views
ADD COMMENT
1
Entering edit mode
ADD REPLY
1
Entering edit mode

If you want other software or language environments too in addition to R, see the post: http://biostar.stackexchange.com/questions/18390/best-graphics-gallery-or-blogs-for-bioinformatics-use

ADD REPLY
0
Entering edit mode

good survey/question. It seems we all have the same ones ;-)

ADD REPLY
12
Entering edit mode
12.7 years ago
Gjain 5.8k

Along with the useful libraries and tools mentioned, there are few more that I find useful. Some of them are:

  • Lattice: Multivariate Data Visualization with R > Lattice brings the proven design of Trellis graphics (originally developed for S by William S. Cleveland and colleagues at Bell Labs) to R, considerably expanding its capabilities in the process. Lattice is a powerful and elegant high level data visualization system that is sufficient for most everyday graphics needs, yet flexible enough to be easily extended to handle demands of cutting edge research.
  • Data visualization (in R)
  • Data analysis and visualisations with googleVis and R
  • GenomeGraphs: integrated genomic data visualization with R:

    GenomeGraphs, as an add-on software package for the statistical programming environment R, to facilitate integrated visualization of genomic datasets. GenomeGraphs uses the biomaRt package to perform on-line annotation queries to Ensembl and translates these to gene/transcript structures in viewports of the grid graphics package.

    It generates graphs like: alt text

I hope this helps.

ADD COMMENT
0
Entering edit mode

Hej, I'm wondering how to change the labels of the y-axis in this kind of plot? I mean the numeric labels.

makeGenericArray(intensity, start,end,dp=DisplayPars(size=x,color="x"))

ADD REPLY
9
Entering edit mode
12.7 years ago

Here are some of the things I have found to be useful so far:

  • The R Graph Gallery - a great place to go for inspiration.
  • Bioconductor - often the visualization tools in here are quite specific to a particular type of analysis and can be confusing to customize if you are not getting exactly what you need.
  • ggplot2 - Has a nice tutorial with some pretty examples
  • plotrix - I have not found much in the way of tutorials or examples but it seems promising. To help visualize the kinds of things you get, I created a PDF (PDF portfolio) that contains examples of almost all of the 100+ functions of this package

Plotrix has some nice functions for dealing with legends and labeling of plots but I still could use some advice for the issues I listed in the question.

Any other general packages that I am missing? And specific solutions to my example issues in the question.

ADD COMMENT
0
Entering edit mode

For "good looking" plots, ggplot2 is pretty much all you need.

ADD REPLY
0
Entering edit mode

the plotrix portfolio is very helpful!

ADD REPLY
7
Entering edit mode
12.7 years ago

If you're looking to plot data along a genome, you should check out these two new bioconductor packages

  • Gviz. The plots this thing generates are really beautiful -- have fun browsing the vignette.
  • ggbio. This seems a bit more utilitarian, but also quite nice.

I'm linking to the development versions, because Gviz is only available there for now (soon to be released).

ADD COMMENT
0
Entering edit mode

+1 for Gviz, it looks like a successor to GenomeGraphs. The plots look very professional (more than GenomeGraphs) and publication ready. I will definitely switch to Gviz for visualizing genomic features for papers.

ADD REPLY
1
Entering edit mode
12.7 years ago

For "2. creation of multi-panel figures with custom margins" its definitely worth learning to use layout() which seems more powerful than the standard par(mfrow/mfcol) approach. See tutorials here and here. You can arrange figures in almost any layout. The only issue I have had is how to incorporate figures from functions like heatmap.2 which use layout internally onto a multi-plot layout. I.e., Can you have a layout within a layout?

ADD COMMENT

Login before adding your answer.

Traffic: 1679 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6