insitupy.plotting.volcano_plot#
- insitupy.plotting.volcano_plot(data, logfoldchanges_column='logfoldchanges', pval_column='neg_log10_pvals', significance_threshold=0.05, fold_change_threshold=1, title=None, adjust_labels=True, ax=None, savepath=None, save_only=False, dpi_save=300, show=True, label_top_n=20, figsize=(8, 6), config_table=None)#
Create a volcano plot from the DataFrame and label the top 20 most significant up and down-regulated genes. For the generation of the input data
insitupy.utils.deg.create_deg_dataframecan be used- Parameters:
data (pd.DataFrame) – DataFrame containing gene names, log fold changes, and p-values.
logfoldchanges_column (str) – Column name for log fold changes (default is ‘logfoldchanges’).
pval_column (str) – Column name for negative log10 p-values (default is ‘neg_log10_pvals’).
significance_threshold (float) – P-value threshold for significance (default is 0.05).
fold_change_threshold (float) – Log2 fold change threshold for up/down regulation (default is 1).
title (str) – Title of the plot (default is “Volcano Plot”).
adjust_labels (bool, optional) – If True, adjusts the labels to avoid overlap. Default is False.
savepath (Union[str, os.PathLike, Path], optional) – Path to save the plot (default is None).
save_only (bool) – If True, only save the plot without displaying it (default is False).
dpi_save (int) – Dots per inch (DPI) for saving the plot (default is 300).
label_top_n (int) – Number of top up- and downregulated genes to label in the plot (default is 20).
figsize (Tuple[int, int]) – Size of the figure in inches (default is (8, 6)).
- Returns:
None