scmorph.pp.select_features

scmorph.pp.select_features#

scmorph.pp.select_features(adata, method='pearson', cor_cutoff=0.9, fraction=None, n_obs=None, copy=False)[source]#

Feature selection

Select features by feature correlations. Allows measuring correlation on a subset of cells to speed up computations. See fraction and n_obs for details.

Parameters:
adata AnnData

The (annotated) data matrix of shape n_obs × n_vars. Rows correspond to cells and columns to genes.

method str (default: 'pearson')

Which correlation coefficient to use for filtering. One of “pearson”, “spearman” and “chatterjee” ([[Lin and Han, 2021]]_)

cor_cutoff float (default: 0.9)

Cutoff beyond which features with a correlation coefficient higher than it are removed. Must be between 0 and 1.

fraction float | None (default: None)

Subsample to this fraction of the number of observations.

n_obs int | None (default: None)

Subsample to this number of observations.

copy bool (default: False)

Whether to return a copy or modify adata inplace (i.e. operate inplace)

Return type:

AnnData | None

Returns:

adata Feature correlations saved in .varm slot and feature selection saved in .var slot.