c2v.pl.volcano

Contents

c2v.pl.volcano#

c2v.pl.volcano(pvals=None, logfcs=None, names=None, adj_p=False, lg_p=True, ax=None, return_fig=False, draw_p_threshold=True, pval_threshold=0.05, draw_logfc_threshold=True, logfc_threshold=1.0, n_highlite=5, highlite_names=None, background_scatter_kws=None, lines_kws=None, scatters_kws=None, pval_line_kws=None, pval_scatter_kws=None, logfc_scatter_kws=None, logfc_scatter_kws_left=None, logfc_scatter_kws_right=None, logfc_line_kws=None, logfc_line_kws_left=None, logfc_line_kws_right=None, pval_logfc_scatter_kws=None, pval_logfc_scatter_kws_left=None, pval_logfc_scatter_kws_right=None, highlite_scatter_kws=None, highlite_scatter_kws_right=None, highlite_scatter_kws_left=None, text_kws=None, text_kws_right=None, text_kws_left=None, xlim=None, ylim=None, title='Volcano plot', xlabel=None, ylabel=None, grid=True, rasterize=True, show=True, figsize=None)#

Draw a volcano using provided p-values and logFCs.

Parameters:
pvals pd.Series | list

P-values for each gene.

logfcs pd.Series | list

Log2 fold changes for each gene.

names pd.Series | list | None, optional

Gene names corresponding to p-values and logFCs. If None, indices are used (if provided). If not provided, no gene names are shown. Default is None.

adj_p bool, optional

Whether p-values are adjusted (used to label the Y-axis). Default is False.

lg_p bool, optional

Whether to use -log10(p) scale. If False, the function expects -log10(p) in pvals. Default is True.

ax matplotlib.axes.Axes | None, optional

Axes to draw the volcano on. Default is None.

return_fig bool, optional

Whether to return the figure. Default is False.

draw_p_threshold bool, optional

Whether to draw the p-value threshold line. Default is True.

pval_threshold float | None, optional

P-value threshold for significance. Default is 0.05.

draw_logfc_threshold bool, optional

Whether to draw the logFC threshold lines. Default is True.

logfc_threshold float | None, optional

Log2 fold change threshold for significance. Default is 1.0.

n_highlite int, optional

Number of top genes to highlight from each side. Default is 5.

highlite_names list | None, optional

List of gene names to highlight in addition to top-DE genes. Default is None.

background_scatter_kws dict | None, optional

Keyword arguments for background (p > pval_threshold and |logFC| < logfc_threshold) scatter plot. Default is None.

lines_kws dict | None, optional

Keyword arguments for all lines. Default is None.

scatters_kws dict | None, optional

Keyword arguments for all scatters. Default is None.

pval_line_kws dict | None, optional

Keyword arguments for p-value threshold line. Default is None.

pval_scatter_kws dict | None, optional

Keyword arguments for p-value threshold scatter. Default is None.

logfc_scatter_kws dict | None, optional

Keyword arguments for logFC threshold scatter. Default is None.

logfc_scatter_kws_left dict | None, optional

Keyword arguments for logFC threshold scatter on the left side. Default is None.

logfc_scatter_kws_right dict | None, optional

Keyword arguments for logFC threshold scatter on the right side. Default is None.

logfc_line_kws dict | None, optional

Keyword arguments for logFC threshold line. Default is None.

logfc_line_kws_left dict | None, optional

Keyword arguments for logFC threshold line on the left side. Default is None.

logfc_line_kws_right dict | None, optional

Keyword arguments for logFC threshold line on the right side. Default is None.

pval_logfc_scatter_kws dict | None, optional

Keyword arguments for p-value and logFC threshold scatter. Default is None.

pval_logfc_scatter_kws_left dict | None, optional

Keyword arguments for p-value and logFC threshold scatter on the left side. Default is None.

pval_logfc_scatter_kws_right dict | None, optional

Keyword arguments for p-value and logFC threshold scatter on the right side. Default is None.

highlite_scatter_kws dict | None, optional

Keyword arguments for highlite scatter plot. Default is None.

highlite_scatter_kws_right dict | None, optional

Keyword arguments for highlite scatter plot on the right side. Default is None.

highlite_scatter_kws_left dict | None, optional

Keyword arguments for highlite scatter plot on the left side. Default is None.

text_kws dict | None, optional

Keyword arguments for text. Default is None.

text_kws_right dict | None, optional

Keyword arguments for text on the right side. Default is None.

text_kws_left dict | None, optional

Keyword arguments for text on the left side. Default is None.

xlim tuple[float, float] | None, optional

x-axis limits. Default is None.

ylim tuple[float, float] | None, optional

y-axis limits. Default is None.

title str | None, optional

Title of the plot. Default is None.

xlabel str | None, optional

x-axis label. Default is None.

ylabel str | None, optional

y-axis label. Default is None.

grid bool, optional

Whether to draw grid lines. Default is True.

rasterize bool, optional

Whether to rasterize the plot. Default is True.

show bool, optional

Whether to show the plot. Default is True.

figsize tuple[float, float] | None, optional

Figure size. Default is None.

Return type:

Figure | Axes | None

Returns:

fig : matplotlib.figure.Figure Figure object if return_fig is True.