volcanoplot | R Documentation |
Once the differential analysis has been performed, it is possible to visualize the volcano plots employing this function.
The volcano plot is generated by the employment of ggplot2, setting xlimit and ylimit based on the data. If there are genes with pvalue equal to infinity, those are forced to the maximum value of the pvalue. If 'my_comparison' paramater is not provided (default: NULL), the function will extract the name of the first subfolder inside "results/" and use it. The volcano plots are saved in the a subfolder for each comparison (Figure 1).
volcanoplot( res, my_comparison = NULL, highlight_genes = NULL, log2FC_thresh = 0, padj_thresh = 0.05, del_csv = ",", where_results = "./", outfolder = "results/" )
res |
DESeq2 results table. Accepts both a file (.tsv, .csv, tab-separated .txt) or a dataframe (see example below). Requires 'log2FoldChange' and 'padj' columns. |
my_comparison |
The comparison to plot (control_vs_treatment, a_vs_b, ...). |
highlight_genes |
A (optional) list of genes the user would like to highlight (label) in the volcano plot. It accepts a dataframe, a character vector or a path to a file in .txt format. |
log2FC_thresh |
Threshold value for log2(Fold Change) to highlight genes as differentially expressed (default = 0). |
padj_thresh |
Threshold value for adjusted p-value to highlight genes as significant (default = 0.05). |
del_csv |
Specify the delimiter of the .csv file (default = ","). This is because opening .csv files with Excel messes up the format and changes the delimiter to ";". |
where_results |
Specify the folder in which you want to save outputs. (Default = "./"). Note: if you are working with R Notebooks the default working directory (if not specified) is the folder in which the .Rmd is saved. |
outfolder |
The name to assign to the folder for output saving. (Default = "results/"). NOTE: please add "/" at the end. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.