a SpiDEResults or SpiDEFit; adjust = TRUE needs one from spiDE >= 0.99.34. Under the sandwich engine every patient’s and group’s line has the pooled slope.
gene
one or more genes, one panel each.
index, niche
the index and niche cell types.
adjust
divide out each patient’s intercept (see Details).
bins
the number of density bins (adjust = TRUE; bins are quantiles over all patients). Raw data use fifths of each patient’s own density range.
assay
the counts assay.
name
the niche reducedDim prefix.
Details
With adjust = TRUE (the default) each cell’s expression is divided by its patient’s fitted intercept, so the patients share one reference level and overlay: faint points are each patient’s mean in a density bin, points and bars the mean across patients and its 95
the dashed line each group’s fitted slope. This is what the tests compare. With adjust = FALSE the data are raw: each patient’s own slope is a segment through its mean (open circle), and the dashed line through the patients’ means is the between-patient association that the intercepts absorb – testNicheAbundance()’s question, not a niche slope.
Read it for the data behind a slope, whether the log1p scale is roughly linear, and whether a few extreme cells drive it. The display normalises depth by library size (the model fits a slope on it). Every layer carries patient, so + facet_wrap(~ patient) splits it by patient.
Value
a ggplot; p$data has one row per (gene, patient, bin): gene, patient, bin, expr (mean CP10k), density (mean log1p density), condition and gene_lab. Bins without counts are left out of that layer (not out of the means).
Examples
library("spiDE")data(toySpiDE)spe <-buildNiches(toySpiDE, sigma =30)res <-spiDE(spe, condition ="condition", sigma =30, index ="A", verbose =FALSE)plotNicheResponse(spe, res, gene ="G1", index ="A", niche ="B")
plotNicheResponse(spe, res, gene ="G1", index ="A", niche ="B", adjust =FALSE)