snapatac2.pp.filter_doublets#
- snapatac2.pp.filter_doublets(adata, probability_threshold=0.5, score_threshold=None, inplace=True, n_jobs=8, verbose=True)[source]#
Remove doublets according to the doublet probability or doublet score.
The user can choose to remove doublets by either the doublet probability or the doublet score.
scrubletmust be ran first in order to use this function.- Parameters:
adata (
AnnData|list[AnnData]) – The (annotated) data matrix of shapen_obsxn_vars. Rows correspond to cells and columns to regions.probability_threshold (
float|None) – Threshold for doublet probability. Doublet probability greater than this threshold will be removed. The default value is 0.5. Using a lower threshold will remove more cells.score_threshold (
float|None) – Threshold for doublet score. Doublet score greater than this threshold will be removed. Only one ofprobability_thresholdandscore_thresholdcan be set. Usingscore_thresholdis not recommended for most cases.inplace (
bool) – Perform computation inplace or return result.n_jobs (
int) – Number of jobs to run in parallel.verbose (
bool) – Whether to print progress messages.
- Returns:
If
inplace = True, directly subsets the data matrix. Otherwise return a boolean index mask that does filtering, whereTruemeans that the cell is kept,Falsemeans the cell is removed.- Return type:
np.ndarray | None
See also