volcanoPlot | R Documentation |
Volcano plot
volcanoPlot(
data,
log2FoldChange = "log2FoldChange",
padj = "padj",
colour = "red",
saveplot = NULL,
size = 1,
padjLimit = 10,
width = 13.5,
height = 15,
...
)
data |
A dataframe. |
log2FoldChange |
Specify the columns containing log2 fold change. Default "log2FoldChange" (suitable for DESeq2 result) |
padj |
Specify the columns containing adjusted p-value. Default "padj" (suitable for DESeq2 result) |
colour |
Specify colour variable. Normally the columns containing labels to indicate if the genes are up-regulated or down-regulated or no significant difference. |
saveplot |
Save plot to given file "a.pdf", "b.png". |
size |
A number of one column name to specify point size. |
padjLimit |
Max allowed negative log10 transformed padj. Default 10. |
width |
Picture width in "cm". |
height |
Picture height in "cm". |
... |
Additional parameters given to |
A ggplot2 object.
### Generate test data
res_output <- data.frame(log2FoldChange=rnorm(3000), row.names=paste0("ImageGP",1:3000))
res_output$padj <- 20 ^ (-1*(res_output$log2FoldChange^2))
padj = 0.05
log2FC = 1
res_output$level <- ifelse(res_output$padj<=padj,
ifelse(res_output$log2FoldChange>=log2FC,
paste("groupA","UP"),
ifelse(res_output$log2FoldChange<=(-1)*(log2FC),
paste("groupB","UP"), "NoDiff")) , "NoDiff")
head(res_output)
volcanoPlot(res_output, colour="level")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.