Reference#
Everything the package exports, built from the docstrings.
The pipeline#
pace_fit runs all four stages and returns one object. The stages each take a
fit and return it with one more layer attached, for when you want to stop
partway or re-run a later one with different settings.
Fit PACE and attach every reporting layer. |
|
Fit the PACE model, without the reporting layers. |
|
Shrink the neighbour slopes and attach them to the fit. |
|
Decompose the variance and attach both tables to the fit. |
|
Rank each pair's drivers and attach the tables to the fit. |
Readouts#
The shrunken slopes, with a local false sign rate per effect. |
|
The per-gene variance decomposition. |
|
The per-pair driver tables, or one pair's. |
|
Each neighbour's share of a focal type's spatial variance. |
|
Per cell: the contamination loading, and the fraction it explains. |
|
The genes that most mark each cell type, which anchor its contamination. |
|
The cell types, in the order they index the random-effect rows. |
|
What the fit was run with. |
|
The solver's own output: coefficients, errors, dispersions, loadings. |
|
The per-cell-type statistics, rebuilding the means a gene block at a time. |
|
Rebuild the fitted means for a block of genes. |
Figures#
Stacked bars of each focal type's variance blocks, as R draws them. |
|
The pair heatmap, oriented as R draws it: FOCAL on x, NEIGHBOUR on y. |
|
The top genes mediating one pair, as R draws them. |
|
A gene's raw counts against how many of a neighbour type a cell has. |
|
What the shrinkage did: the raw slope against the shrunken one. |
Building and inspecting a fit#
The kernel-weighted neighbour abundances, before any fitting. |
|
The sparse cross-cell-type contamination field, in compressed-column form. |
|
Copy a fit's readouts into adata.uns, leaving the solver state behind. |
|
Drop what a saved fit does not need, keeping every readout. |
Objects#
A fitted model, with the pieces the readouts need. |
|
Per-(cell type, gene) summaries of the fitted means. |
The numerical core#
Single stages, for anyone who wants one on its own rather than a whole fit.
Canonical multivariate adaptive shrinkage for one slice. |
|
Driver scores for one focal-neighbour pair. |
|
Pratt attribution of spatial variance across a focal type's neighbours. |