scFates.pp.filter_cells

Contents

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 default: 'cpu'

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

p_level default: None

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

subset default: True

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

plot default: False

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

copy default: False

Return a copy instead of writing to adata.

Returns:

adata : anndata.AnnData 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.