decoupler.pl.filter_by_expr#

decoupler.pl.filter_by_expr(adata, group=None, lib_size=None, min_count=10, min_total_count=15, large_n=10, min_prop=0.7, cmap='viridis', kw_histplot=None, **kwargs)#

Plot to help determining the thresholds of the decoupler.pp.filter_by_expr function.

Parameters:
adata AnnData

Annotated data matrix with observations (rows) and features (columns).

cmap str (default: 'viridis')

Colormap to use.

group str | None (default: None)

Name of the adata.obs column to group by. If None, it assumes that all samples belong to one group.

lib_size float | None (default: None)

Library size. If None, default to the sum of reads per sample.

min_count int (default: 10)

Minimum count requiered per gene for at least some samples.

min_total_count int (default: 15)

Minimum total count required per gene across all samples.

large_n int (default: 10)

Number of samples per group that is considered to be “large”.

min_prop float (default: 0.7)

Minimum proportion of samples in the smallest group that express the gene.

kw_histplot dict | None (default: None)

Keyword arguments passed to seaborn.histplot.

ax

An existing matplotlib.axes._axes.Axes instance to plot on. If None, a new figure and axes will be created.

figsize

Size of the figure in inches as (width, height).

dpi

Dots per inch for the figure resolution.

return_fig

If True, plotting methods should return the figure object instead of showing it.

save

If set, path to save the plot automatically to a file.

Return type:

None | Figure

Returns:

If return_fig=True, returns matplotlib.figure.Figure instance.

Example

import decoupler as dc

adata = dc.ds.hsctgfb()
dc.pl.filter_by_expr(adata)