pegasus.volcano¶
- pegasus.volcano(data, cluster_id, de_key='de_res', de_test='mwu', qval_threshold=0.05, log2fc_threshold=1.0, top_n=20, panel_size=(6, 4), return_fig=False, dpi=300.0)[source]¶
Generate Volcano plots (-log10 p value vs. log2 fold change) for visualizing DE results.
- Parameters
data (
MultimodalData,UnimodalData, oranndata.AnnDataobject.) – Single cell expression data.cluster_id (
str) –- Cluster ID for the cluster we want to show DE results. There are two cases:
If
conditionisNoneinpg.de_analysis: Just specify one cluster label in the cluster attribute used inpg.de_analysis.If
conditionis notNoneinpg.de_analysis: Specify cluster ID in this format: “cluster_label:cond_level”, where cluster_label is the cluster label, and cond_level is the condition ID. And this shows result of cells within the cluster under the specific condition.
de_key (
str, optional, default:de_res) – The varm keyword for DE results. data.varm[de_key] should store the full DE result table.de_test (
str, optional, default:mwu) – Which DE test results to show. Use MWU test result by default.qval_threshold (
float, optional, default: 0.05.) – Selected FDR rate. A horizontal line indicating this rate will be shown in the figure.log2fc_threshold (
float, optional, default: 1.0) – Log2 fold change threshold to highlight biologically interesting genes. Two vertical lines representing negative and positive log2 fold change will be shown.top_n (
int, optional, default:20) – Number of top DE genes to show names. Genes are ranked by Log2 fold change.panel_size (
Tuple[float, float], optional, default:(6, 4)) – The size (width, height) in inches of figure.return_fig (
bool, optional, default:False) – Return aFigureobject ifTrue; returnNoneotherwise.dpi (
float, optional, default:300.0) – The resolution in dots per inch.
- Returns
A
matplotlib.figure.Figureobject containing the dot plot ifreturn_fig == True- Return type
Figureobject
Examples
>>> pg.volcano(data, cluster_id = '1', dpi=200)