opendvp.pl.volcano#
- volcano(adata, x='mean_diff', y='-log10_p_corr', significant=False, FDR=None, significant_metric='p_corr', tag_top=None, group1=None, group2=None, return_fig=False, ax=None, highlight_genes=None, show_highlighted_genes_names=True, **kwargs)#
Plot a volcano plot from an AnnData object.
- Parameters:
adata (anndata.AnnData) – An AnnData object with statistical test results stored in
adata.var.x (str) – Column name in
adata.varfor the x-axis (e.g., log2 fold change).y (str) – Column name in
adata.varfor the y-axis (e.g., -log10 p-value).significant (bool) – Whether to highlight significant points based on FDR threshold.
FDR (float or None) – Threshold for corrected p-value (e.g., 0.05). Required if
significant=True.tag_top (int or None) – Number of top hits (by
y) to label with text, regardless of significance.group1 (str or None) – Name of the first group (used for x-axis label annotation).
group2 (str or None) – Name of the second group (used for x-axis label annotation).
return_fig (bool) – If True, returns the matplotlib
figobject for further modification.highlight_genes (list or None) – List of gene names/IDs to highlight and label on the plot, if present in adata.var.index.
show_highlighted_genes_names (bool) – If True, shows names of highlighted genes on the plot.
ax (matplotlib.axes.Axes, optional) – Axes object to plot on. If None, a new figure and axes are created.
**kwargs (
Mapping[str,Any]) – Additional keyword arguments passed to matplotlib scatter.
- Returns:
fig – The
figobject ifreturn_fig=True, otherwise None.- Return type:
matplotlib.figure.Figure or None