Skip to content

Doublets (GPU)

The CPU twin is bixverse.doublets.

doublets

GPU Scrublet.

Returns the bixverse.doublets.ScrubletRes the CPU scrublet returns, so call_doublets_manual and get_data work unchanged, group_by included.

scrublet

scrublet(
    sc: SingleCells,
    *,
    scrublet_params: ScrubletGpuParams | None = None,
    seed: int = 42,
    streaming: bool | None = None,
    cells_to_use: Selection | None = None,
    group_by: str | None = None,
    return_combined_pca: bool = False,
    return_pairs: bool = False,
    verbose: Verbose = True,
) -> ScrubletRes

Scrublet doublet detection with the SVD, the doublet projection and (by default) the kNN on the GPU.

HVG selection, doublet simulation, the kNN classifier and the Otsu threshold are the CPU steps of bixverse.doublets.scrublet.

Parameters:

Name Type Description Default
sc SingleCells

The experiment.

required
scrublet_params ScrubletGpuParams | None

The parameters. None uses the defaults.

None
seed int

Seed.

42
streaming bool | None

Stream the HVG pass. None streams on large data.

None
cells_to_use Selection | None

0-based cell indices or ids to run on. None uses the kept cells.

None
group_by str | None

obs column to run per group on, e.g. the sample.

None
return_combined_pca bool

Also return the PCA of observed and simulated cells.

False
return_pairs bool

Also return the parents of the simulated doublets.

False
verbose Verbose

0 (False) silent, 1 (True) progress, 2 extra detail where the method has it. With group_by, 1 shows a progress bar over the groups and 2 also runs each group at level 1.

True

Returns:

Type Description
ScrubletRes

The ScrubletRes.

Raises:

Type Description
ValueError

If group_by is missing or incomplete, or a group is too small.

BixverseError

Without a GPU adapter.

References

Wolock, et al., Cell Syst, 2019.