snapatac2.pp.scrublet#
- snapatac2.pp.scrublet(adata, features='selected', n_comps=15, sim_doublet_ratio=2.0, expected_doublet_rate=0.1, n_neighbors=None, use_approx_neighbors=True, random_state=0)[source]#
Compute probability of being a doublet using the scrublet algorithm.
- Parameters
adata (
AnnData
) – AnnData objectfeatures (
UnionType
[str
,ndarray
,None
]) – Boolean index mask, whereTrue
means that the feature is kept, andFalse
means the feature is removed.n_comps (
int
) – Number of PCssim_doublet_ratio (
float
) – Number of doublets to simulate relative to the number of observed cells.expected_doublet_rate (
float
) – Expected doublet rate.n_neighbors (
Optional
[int
]) – Number of neighbors used to construct the KNN graph of observed cells and simulated doublets. IfNone
, this is set to round(0.5 * sqrt(n_cells))use_approx_neighbors – Whether to use approximate search.
random_state (
int
) – Random state.
- Returns
- It updates adata with the following fields:
adata.obs["doublet_score"]
: scrublet doublet scoreadata.uns["scrublet"]["sim_doublet_score"]
: doublet scores of simulated doublets
- Return type
None