opendvp.plotting.volcano#
- opendvp.plotting.volcano(adata, x='log2_FC', y='-log10(p_val_corr)_BH', significant=True, FDR=None, tag_top=None, group1=None, group2=None, return_fig=False, highlight_genes=None, show_highlighted_genes_names=True, ax=None, **kwargs)#
Plot a volcano plot from an AnnData object.
Parameters#
- adataAnnData
An AnnData object with statistical test results stored in
adata.var
.- xstr
Column name in
adata.var
for the x-axis (e.g., log2 fold change).- ystr
Column name in
adata.var
for the y-axis (e.g., -log10 p-value).- significantbool
Whether to highlight significant points based on FDR threshold.
- FDRfloat or None
Threshold for corrected p-value (e.g., 0.05). Required if
significant=True
.- tag_topint or None
Number of top hits (by
y
) to label with text, regardless of significance.- group1str or None
Name of the first group (used for x-axis label annotation).
- group2str or None
Name of the second group (used for x-axis label annotation).
- return_figbool
If True, returns the matplotlib
fig
object for further modification.- highlight_geneslist or None
List of gene names/IDs to highlight and label on the plot, if present in adata.var.index.
- show_highlighted_genes_namesbool
If True, shows names of highlighted genes on the plot.
- axmatplotlib.axes.Axes, optional
Axes object to plot on. If None, a new figure and axes are created.
- **kwargs
Additional keyword arguments passed to matplotlib scatter.
Returns:#
- figmatplotlib.figure.Figure or None
The
fig
object ifreturn_fig=True
, otherwise None.