SpiDEFit-class

The fitted per-patient niche models of spiDE

Description

Returned by fitSpiDE(); tested with testSpiDE().

Usage

## S4 method for signature 'SpiDEFit'
x\$name

Arguments

x a SpiDEFit or SpiDEResults.
name a slot name.

Details

For the slopes engine each element of index holds genes, niches (tested niche columns), patients, beta (genes x patients x niches: each patient’s slope), v_tile (the within-patient spatial sandwich variance of each slope), v_model (the model variance), factor (patients x niches: the per-patient variance factor), pooled (genes x niches: the shared fit’s slope), mean_expr and ncells. For the sandwich engine it holds genes, niches and a data.frame coef of the tested coefficients (test = "pooled" or "condition") with their CR2 standard errors and Bell-McCaffrey degrees of freedom. Both hold status (genes fitted; genes left out because the solver could not fit them or their coefficients ran off, the latter also counted as runaway; and genes whose dispersion is on its search bound) and, under depth = “spatial_spline”, depth_r2 (patients x niches: the \(R^2\) of each niche column on the patient’s library-size spline, a diagnostic of how much of the niche covariate the spline could absorb). From spiDE 0.99.34 both also hold intercept (genes x patients: each patient’s intercept in the shared, condition-free fit; see patientIntercepts()), niche_mean (patients x niches: the mean log1p density of each tested niche over the patient’s index cells), loglib_mean (the patients’ mean log library size) and ncells (the patients’ index cells).

Value

An object of class SpiDEFit, created by fitSpiDE(); its $ accessor returns a slot, and show() prints a summary.

Slots

engine
a character, “slopes” or “sandwich”.
sigma
a numeric, the niche bandwidth the fit used.
condition
a character (length 0 or 1), the condition the fit was given (the sandwich engine fits condition-specific slopes only if it was given one; the slopes engine only records it).
patients
a data.frame, one row per patient (sample): its id, the number of cells it contributes, and every colData column that is constant within patients (so a condition can be named at testSpiDE() time).
index
a named list, one element per index cell type, holding the engine’s estimates (see Details).
params
a list of the settings the fit used.