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)
Dataframe. Output from DESeq2 converted to data frame. Columns: Geneid, baseMean, log2FoldChange, lfcSE, pvalue, padj, DEG (optional).
Numerical of length 2. The limits of the x axis where the log2FC is plotted. Default: c(-10,10).
Numerical of length 2. The limits of the y axis where the -log10(adj_pval) is plotted. Default: c(0,30).
Numerical. p-value threshold used to call de DEGs. It is used to draw a dashed line in this value. Default: 0.05.
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.
Character. The title of the volcano plot. Default: NULL.
Numerical. The size of the title. Default: 9.
Character. The subtitle of the volcano plot. Default: NULL
Numerical. The size of the numbers of up and downregulated genes. Default: 7.
Character of length 2. Colors of the numbers of downregulated and upregulated genes. Default: c("darkgreen", "red").
Numerical. Position of the numbers of up and downregulated genes along the y axis. Default: 0.
Character. label of the X axis. Default: "log2(FC)".
Character. Label of the Y axis. Default: "-log10(pval)".
Numerical. Size of the axis labels. Default: 7.
Character of length 3. Colors of the downregulated, notDE and upregulated points. Default: c("darkgreen", "gray", "red")
Logical. If FALSE, the title of the legend is not plotted. Default: FALSE.
Character. Position of the legend. One of: "bottom", "top", "right", "left", "none". Default: "bottom".
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.
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.
Numerical. Size of the labels of the DEGs Default: 3.
Logical of length 1. Whether to draw the panel grid major lines or not. Default: TRUE
Numerical. The size of the subtitle. Default: 8.
Numerical. Size of the text in the axis. Default: 7.