Skip to content

Differential expression (GPU)

The CPU twin is bixverse.de.

de

GPU NEBULA.

Returns the bixverse.de.ScNebula the CPU nebula returns. Only stage two, the per-gene penalised fits, runs on the GPU, in f32, so the estimates sit close to the CPU ones rather than on them. No reml on the GPU.

nebula

nebula(
    sc: ScOrScSubset,
    subject_col: str,
    design: str,
    *,
    coef: int | str | None = None,
    contrast: ndarray | Sequence[float] | None = None,
    genes_to_use: Selection | None = None,
    cells_to_use: Sequence[str] | None = None,
    offset: ndarray | Sequence[float] | None = None,
    nebula_params: NebulaGpuParams | None = None,
    verbose: Verbose = True,
) -> ScNebula

NEBULA with the per-gene fits on the GPU.

Inputs and the result are those of bixverse.de.nebula.

Parameters:

Name Type Description Default
sc ScOrScSubset

The experiment.

required
subject_col str

obs column with the subject (donor), the random effect.

required
design str

Formula over obs, e.g. "~ condition + age".

required
coef int | str | None

The coefficient the Wald test reports, a 0-based design column or its name. None takes the last column.

None
contrast ndarray | Sequence[float] | None

One weight per design column. Exclusive with coef.

None
genes_to_use Selection | None

0-based gene indices or ids. None fits every gene.

None
cells_to_use Sequence[str] | None

Cell ids to fit. None takes the kept cells.

None
offset ndarray | Sequence[float] | None

Strictly positive scaling per cell. None uses the library sizes.

None
nebula_params NebulaGpuParams | None

The parameters. None uses the defaults.

None
verbose Verbose

0 (False) silent, 1 (True) progress, 2 extra detail where the method has it.

True

Returns:

Type Description
ScNebula

The ScNebula.

Raises:

Type Description
ValueError

On missing columns, no cells left, both coef and contrast, or a bad offset.

BixverseError

Without a GPU adapter that runs plane operations.

References

He, et al., Commun Biol, 2021.