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_counts
counts ormin_tsse
TSS enrichment scores. This is to filter measurement outliers, i.e. “unreliable” observations.- Parameters:
data (
AnnData
|list
[AnnData
]) – The (annotated) data matrix of shapen_obs
xn_vars
. Rows correspond to cells and columns to regions.data
can 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 (
Optional
[int
]) – Maximum number of counts required for a cell to pass filtering.max_tsse (
Optional
[float
]) – 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 whendata
is 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