snapatac2.pp.filter_cells#
- snapatac2.pp.filter_cells(data, min_counts=1000, min_tsse=5.0, max_counts=None, max_tsse=None, inplace=True, n_jobs=8)[source]#
Filter cell outliers based on counts and numbers of genes expressed. For instance, only keep cells with at least
min_countscounts ormin_tsseTSS enrichment scores. This is to filter measurement outliers, i.e. “unreliable” observations.- Parameters:
data (
AnnData|list[AnnData]) – The (annotated) data matrix of shapen_obsxn_vars. Rows correspond to cells and columns to regions.datacan also be a list of AnnData objects. In this case, the function will be applied to each AnnData object in parallel.min_counts (
int|None) – Minimum number of counts required for a cell to pass filtering.min_tsse (
float|None) – Minimum TSS enrichemnt score required for a cell to pass filtering.max_counts (
int|None) – Maximum number of counts required for a cell to pass filtering.max_tsse (
float|None) – Maximum TSS enrichment score expressed required for a cell to pass filtering.inplace (
bool) – Perform computation inplace or return result.n_jobs (
int) – Number of parallel jobs to use whendatais a list.
- Returns:
If
inplace = True, directly subsets the data matrix. Otherwise return indices of cells that pass the filtering.- Return type:
np.ndarray | None