from spidepy import spide
from spidepy.datasets import toy_spide
res = spide(toy_spide(), condition="condition", sigma=30, verbose=False)
res.fit.engine'slopes'
Run spiDE end to end (R spiDE).
Builds the niche covariates at bandwidth sigma (unless adata already carries them), fits the per-patient niche models (fit_spide) and tests them (test_spide): the pooled niche test always, and the condition-specific test when a condition is given.
| Name | Type | Description | Default |
|---|---|---|---|
| adata | AnnData | Cells x genes with raw counts. Niches built here are not left on adata. |
required |
| condition | str | The obs column of a two-level, patient-level condition. |
None |
| sigma | float | The niche bandwidth (a single value). Required: None raises an error. |
None |
| engine | ('slopes', 'sandwich') | See fit_spide. |
"slopes" |
| procedure | str | Passed to test_spide; defaults to the engine’s default. |
None |
| fdr | float | Passed to test_spide. |
0.05 |
| cell_type | str | The obs column of the cell type. |
"cell_type" |
| sample_id | str | The obs column of the patient. |
"sample_id" |
| name | str | The niche key prefix: the niches are read from, or built into, adata.obsm[name + sigma]. |
"Niche" |
| n_jobs | int | Number of workers. | 1 |
| verbose | bool | Report progress on stderr. | True |
| **fit_kwargs | Further arguments to fit_spide. |
{} |
| Name | Type | Description |
|---|---|---|
| SpiDEResults | The tests of the fit. |
build_niches : The first step. fit_spide : The second step. test_spide : The third step.
'slopes'