patientSlopes

Each patient’s niche slopes

Description

The slopes engine estimates every patient’s own niche slopes (a one-step negative binomial estimate from the shared fit); this returns them in long form, e.g. to plot how a gene’s slope varies between patients and conditions.

Usage

patientSlopes(object, ...)

## S4 method for signature 'SpiDEFit'
patientSlopes(object, gene = NULL, index = NULL, niche = NULL, ...)

## S4 method for signature 'SpiDEResults'
patientSlopes(object, ...)

Arguments

object a SpiDEFit or SpiDEResults from the slopes engine.
… unused.
gene, index, niche optional character vectors to subset.

Value

a data.frame: gene, index, niche, patient, slope, var_spatial (the within-patient spatial sandwich variance), var_model, ncells, plus the patient-level colData columns recorded by fitSpiDE().

Examples

library("spiDE")

data(toySpiDE)
spe <- buildNiches(toySpiDE, sigma = 30)
fit <- fitSpiDE(spe, index = "A", sigma = 30)
head(patientSlopes(fit, gene = "G1"))