pilotpy.tl.compute_diff_expressions

pilotpy.tl.compute_diff_expressions(adata, cell_type: str = None, proportions: DataFrame = None, selected_genes: list = None, font_size: int = 18, group1: str = 'Tumor 1', group2: str = 'Tumor 2', fc_thr=0.5, pval_thr=0.05, exp_thr=0.1, sample_col='sampleID', col_cell='cell_types', shrinkage=False, number_n=5, number_p=5, marker='o', color='w', markersize=8, font_weight_legend='normal', size_legend=12, figsize=(15, 15), dpi=100, **kwargs)

Computes pseudobulk differential expression analysis for a specific cell type using PyDESeq2 and generates a volcano plot.

Parameters

adataAnnData

Annotated data object containing single-cell gene expression and metadata.

cell_typestr, optional

The specific cell type (found in col_cell) to perform DE analysis on.

proportionspd.DataFrame, optional

Metadata table containing sample IDs and condition labels (Predicted_Labels).

selected_geneslist, optional

Subset of gene names to restrict the analysis to. If None, all filtered genes are used.

font_sizeint, optional

Base font size for the plot text and labels. Default is 18.

group1str, optional

The name of the first experimental group (e.g., ‘Tumor 1’).

group2str, optional

The name of the second experimental group (e.g., ‘Tumor 2’).

fc_thrfloat, optional

Log2 Fold Change threshold for significance in the volcano plot. Default is 0.5.

pval_thrfloat, optional

Adjusted p-value threshold for significance. Default is 0.05.

exp_thrfloat, optional

Expression threshold; filters genes expressed in fewer than this fraction of cells. Default is 0.1.

sample_colstr, optional

The column in adata.obs containing sample identifiers. Default is ‘sampleID’.

col_cellstr, optional

The column in adata.obs containing cell type annotations. Default is ‘cell_types’.

shrinkagebool, optional

If True, applies apeGLM log2 fold change shrinkage. Default is False.

number_nint, optional

Number of top down-regulated genes to label in the volcano plot. Default is 5.

number_pint, optional

Number of top up-regulated genes to label in the volcano plot. Default is 5.

markerstr, optional

Marker style for the scatter plot points. Default is ‘o’.

colorstr, optional

Edge color for the markers in the plot. Default is ‘w’.

markersizeint, optional

Size of the markers used in the legend. Default is 8.

font_weight_legendstr, optional

Font weight for the legend text. Default is ‘normal’.

size_legendint, optional

Font size for the legend text. Default is 12.

figsizetuple, optional

Width and height of the resulting figure in inches. Default is (15, 15).

dpiint, optional

Resolution of the saved figure in dots per inch. Default is 100.

**kwargsdict

Additional keyword arguments passed to internal functions.

Returns

None

The function saves a CSV of differential expression statistics and a PDF volcano plot to the ‘Results_PILOT’ directory.