scFates.pp.filter_cells

scFates.pp.filter_cells(adata, device='cpu', p_level=None, subset=True, plot=False, copy=False)

Filter cells using on gene/molecule relationship.

Code has been translated from pagoda2 R function gene.vs.molecule.cell.filter.

Parameters
adata : AnnData

Annotated data matrix.

device

Run gene and molecule counting on either cpu or on gpu.

p_level

Statistical confidence level for deviation from the main trend, used for cell filtering (default=min(1e-3,1/adata.shape[0]))

subset

if False, add a column outlier in adata.obs, otherwise subset the adata.

plot

Plot the molecule distribution and the gene/molecule dependency fit.

copy

Return a copy instead of writing to adata.

Returns

adata – if copy=True and subset=True it returns subsetted (removing outliers) or else add fields to adata:

.obs[‘outlier’]

whether a cell is an outlier.

Return type

anndata.AnnData