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.
scrublet
must be ran first in order to use this function.- Parameters:
adata (
AnnData
|list
[AnnData
]) – The (annotated) data matrix of shapen_obs
xn_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 (
Optional
[float
]) – Threshold for doublet score. Doublet score greater than this threshold will be removed. Only one ofprobability_threshold
andscore_threshold
can be set. Usingscore_threshold
is 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, whereTrue
means that the cell is kept,False
means the cell is removed.- Return type:
np.ndarray | None
See also