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
fractionandn_obsfor 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
fractionof 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
adatainplace (i.e. operate inplace)
- adata
- Return type:
AnnData|None- Returns:
Feature correlations saved in
.varmslot and feature selection saved in.varslot.