pl.plot_spillover

pl.plot_spillover(
    res,
    adata,
    test='pooled',
    fold=4,
    label=6,
    fdr=None,
    assay='counts',
    name='Niche',
)

Are the calls the niche type’s own markers? (R plotSpillover).

Every tested triplet, placed by how much higher the gene is in the niche type than in the index type (log2, from each cell type’s mean counts per 10,000) against the signed z of its test; calls are coloured by direction. A gene several-fold higher in the niche type whose measured level in the index cells rises with that niche’s density is what transcripts leaking across segmentation boundaries would produce: the association is real in the data, but it needs orthogonal evidence (nuclear counts, a spillover-corrected segmentation) before it is read as biology.

Parameters

Name Type Description Default
res SpiDEResults The results to plot. required
adata anndata.AnnData The object the results came from. required
test ('pooled', 'condition') Which test’s triplets to place. "pooled"
fold float The niche-marker threshold, as a fold change (shaded). 4
label int The number of markers labelled (strongest first). 6
fdr float The q-value threshold of a call (default: the results’). None
assay str The counts layer. "counts"
name str The niche obsm prefix. "Niche"

Returns

Name Type Description
matplotlib.figure.Figure One panel of log2 fold (niche type over index type) against signed z.

See Also

plot_call_map : Which cell-type pairs carry the calls. plot_top_triplets : Flags niche markers on the strongest triplets.

Examples

import matplotlib.pyplot as plt
from spidepy import build_niches, fit_spide, test_spide
from spidepy.datasets import toy_spide
from spidepy.pl import plot_spillover
adata = build_niches(toy_spide(), sigma=30)
fit = fit_spide(adata, condition="condition", verbose=False)
res = test_spide(fit)
fig = plot_spillover(res, adata, test="pooled")
fig