Wednesday, May 28, 2014

Using Volcano Plots in R to Visualize Microarray and RNA-seq Results

I've been asked a few times how to make a so-called volcano plot from gene expression results. A volcano plot typically plots some measure of effect on the x-axis (typically the fold change) and the statistical significance on the y-axis (typically the -log10 of the p-value). Genes that are highly dysregulated are farther to the left and right sides, while highly significant changes appear higher on the plot.

I've analyzed some data from GEO (GSE52202) using RNA-seq to study gene expression in motor neurons differentiated from induced pluripotent stem cells (iPSCs) derived from ALS patients carrying the C9ORF72 repeat expansion. I aligned the data, counted with featureCounts, and analyzed with DESeq2. I uploaded the results to this GitHub Gist.

Here's how you can use R to create a simple volcano plot. First, download the results file here and save it as a text file called results.txt.

After reading in the data from GitHub the next section creates a basic volcano plot. A few more lines color the points based on their fold change and statistical significance. Finally, if you have the calibrate package installed, the last line labels a few genes of interest.




9 comments:

  1. Hi,

    thanks for sharing this ! It is very informative.

    I am nonetheless bothered by the overlapping gene labels. Do you know how to solve this issue ?

    thanks for your help !

    Julien

    ReplyDelete
  2. You might take a look at Rcharts http://rcharts.io/

    ReplyDelete
  3. When I ran this command in R:
    res <- read.gist("806e31fce55a8b7175af", header=TRUE)

    it says: no "read.gist" function. What should I do? Thanks!

    ReplyDelete
    Replies
    1. Ah. I removed the read.gist function from the package for some compatibility issues. I updated the text in the blog post.

      Delete
  4. Could you please help me? I would like to add to the graph cut-off lines.

    Thank you,en-joy

    ReplyDelete
  5. See ?abline

    https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/abline.html

    ReplyDelete
  6. Hello,
    This is very informative and useful. However, get this error whenever I run,
    >bwadeseqres <- read.table("examplefile.txt", header=TRUE)
    Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
    line 102 did not have 5 elements
    > head(bwadeseqres)
    with(bwadeseqres, plot(log2FoldChange, -log10(pvalue), pch=20, main="Volcano plot", xlim=c(-2.5,2)))
    Error in plot(log2FoldChange, -log10(pvalue), pch = 20, main = "Volcano plot", :
    object 'log2FoldChange' not found

    Kindly help!

    ReplyDelete
  7. Hi, thanks for the post. It was very useful and works perfect. Do you know a way to increase the size of the dots?
    Thanks

    ReplyDelete

Note: Only a member of this blog may post a comment.

Creative Commons License
Getting Genetics Done by Stephen Turner is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.