[R] Volcano Plot

Martin Morgan mtmorgan at fhcrc.org
Wed Feb 29 19:42:03 CET 2012


On 02/28/2012 08:13 AM, aishsk wrote:
> Hi I am using the ggplot2 package for the volcano plot and I am using the
> following code for the same:
>
> g = ggplot(data=data, aes(x=data[11], y=-log10(data[12]), colour=threshold))
> +
> +   geom_point(alpha=0.4, size=1.75) +
> +   opts(legend.position = "none") +
> +   xlim(c(-10, 10)) + ylim(c(0, 15)) +
> +   xlab("log2 fold change") + ylab("-log10 p-value")
>
> data[11] is a column of the fold change values and data[12] contains the P
> values and I am getting a following error:
>
> Error: geom_point requires the following missing aesthetics: x, y
>   What can be done for the same ?
> And if not what other package may I use for the same in which I don't have
> to use a lmfit model?

Have you tried, if 'data' is a data.frame, simply plot(data[[1]], 
-log10(data[[12]])) ?

Martin

> Thanks
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Volcano-Plot-tp4428622p4428622.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the R-help mailing list