delnx.pl.volcanoplotΒΆ
- delnx.pl.volcanoplot(df, x='log2fc', y='-log10(pval)', effect_key='log2fc', pval_key='pval', feature_key='feature', effect_thresh=0.5, pval_thresh=0.01, thresh=None, label_top=0, color_legend_title=None, ax=None, figsize=(8, 6), show=True, save=None, return_fig=False)[source]ΒΆ
Create a volcano plot using matplotlib. Labels significant genes based on thresholds or uses βsignificantβ column if present.
- Parameters:
df (
DataFrame) β DataFrame containing differential expression results.x (
str(default:'log2fc')) β Column name for x-axis (effect size).y (
str(default:'-log10(pval)')) β Column name for y-axis (significance).effect_key (
str(default:'log2fc')) β Column with effect size values for DE analysis.pval_key (
str(default:'pval')) β Column with p-values for DE analysis.feature_key (
str(default:'feature')) β Column containing gene names for labeling.effect_thresh (
float(default:0.5)) β Threshold for absolute effect size.pval_thresh (
float(default:0.01)) β Threshold for significance.thresh (
dict[str,float] |None(default:None)) β Dictionary mapping axis names to threshold values for plot lines, e.g. {βlog2fcβ: 1.0, β-log10(pval)β: 1.3}. If None, uses effect_thresh and -log10(pval_thresh).label_top (
int(default:0)) β If > 0, label top N up/down genes by effect size.color_legend_title (
str|None(default:None)) β Title for the legend. Default: β-log10(p-value)β.ax (
Axes|None(default:None)) β If provided, use this Axes for plotting instead of creating a new one. If None, a new Axes will be created.figsize (
tuple[float,float] (default:(8, 6))) β Size of the figure in inches.show (
bool|None(default:True)) β Whether to display the figure interactively.save (
str|bool|None(default:None)) β If str, path to save the image. If True, uses default name.return_fig (
bool(default:False)) β Whether to return the matplotlib Figure and Axes.
- Returns:
VolcanoPlot or tuple[Figure, Axes] or None