Function that draws a volcano plot with DEGs. As input, it takes the output of DESeq2 and adding a DEG information column (Downregulated, Upregulated, NotDE). Columns: Geneid, baseMean, log2FoldChange, lfcSE, pvalue, padj, DEG. It also counts the number of up and downregulated genes and writes them in the plot. The points that are outside of the limits of the graph are drawn as triangles at the borders.

volcanoPlot(df, xlim = c(-10,10), ylim = c(0,30), pval = 0.05, log2FC = 1.5, main = NULL, mainSize = 9, sub = NULL, subSize = 8, labelSize = 7, labelColor = c("darkgreen", "red"), labelPos = 0, xlab = "log2(FC)", ylab = "-log10(pval)", axisLabelSize = 7, axisTextSize = 7, pointColor = c("darkgreen", "gray", "red"), legendTitle = FALSE, legendPos = "bottom", degsLabel=F, degsLabelNum=5)

Arguments

df

Dataframe. Output from DESeq2 converted to data frame. Columns: Geneid, baseMean, log2FoldChange, lfcSE, pvalue, padj, DEG (optional).

xlim

Numerical of length 2. The limits of the x axis where the log2FC is plotted. Default: c(-10,10).

ylim

Numerical of length 2. The limits of the y axis where the -log10(adj_pval) is plotted. Default: c(0,30).

pval

Numerical. p-value threshold used to call de DEGs. It is used to draw a dashed line in this value. Default: 0.05.

log2FC

Numerical. log2FC threshold (in absolute value) used to call the DEGs. It is used to draw two lines in this value (positive and negative). Default: 1.

main

Character. The title of the volcano plot. Default: NULL.

mainSize

Numerical. The size of the title. Default: 9.

sub

Character. The subtitle of the volcano plot. Default: NULL

labelSize

Numerical. The size of the numbers of up and downregulated genes. Default: 7.

labelColor

Character of length 2. Colors of the numbers of downregulated and upregulated genes. Default: c("darkgreen", "red").

labelPos

Numerical. Position of the numbers of up and downregulated genes along the y axis. Default: 0.

xlab

Character. label of the X axis. Default: "log2(FC)".

ylab

Character. Label of the Y axis. Default: "-log10(pval)".

axisLabelSize

Numerical. Size of the axis labels. Default: 7.

pointColor

Character of length 3. Colors of the downregulated, notDE and upregulated points. Default: c("darkgreen", "gray", "red")

legendTitle

Logical. If FALSE, the title of the legend is not plotted. Default: FALSE.

legendPos

Character. Position of the legend. One of: "bottom", "top", "right", "left", "none". Default: "bottom".

degsLabel

Logical or character. If TRUE, the number genes (defined in 'degsLabelNum') with highest log2FC in absolute value are labelled. If character, it has to contain the names of the genes that are wanted to appear in the plot. Default: FALSE.

degsLabelNum

Numerical. Number of most expressed genes to label in the plot. The double of this number will be labelled (once for DEGs with lowest p-value and once for the DEGs with highest log2fFC in absolute value). Default: 5.

degsLabelSize

Numerical. Size of the labels of the DEGs Default: 3.

gridLines

Logical of length 1. Whether to draw the panel grid major lines or not. Default: TRUE

subSize.

Numerical. The size of the subtitle. Default: 8.

axisText_Size

Numerical. Size of the text in the axis. Default: 7.

Author

amitjavilaventura & dfernandezperez