Skip to contents

Stores the negative binomial GLM fit and Wald/Brown inference for a single niche bandwidth. Several SpiDEFit objects (one per bandwidth) are combined in a SpiDEResults container.

Usage

# S4 method for class 'SpiDEFit'
x$name

Arguments

x

an object of class SpiDEFit.

name

a character, the slot to retrieve.

Value

Return value varies depending on method.

Slots

sigma

a numeric, the niche bandwidth (kernel standard deviation) used.

mode

a character, the design mode: "condition" (the default — a CellType:condition:niche design) or "niche" (a condition-free design in which the two-way CellType:niche interactions are the tested effects).

ngenes

a numeric, the number of genes.

ncells

a numeric, the number of cells/spots.

W

a matrix, the design matrix (cells x covariates).

two.sided

logical, TRUE when the within-gene combination used two-sided p-values (Cauchy/ACAT); FALSE for Brown's method.

se_patient

numeric, per-gene standard error of the abundance-weighted patient-level response contrast; length 0 when the design has no CellType:condition block.

covtype

a factor, the covariate type of each column of W, one of "CellType", "Niche", "Response", "ResponseNiche", "ResponseCellType", "Other", or "Random" (patient random-effect columns for the mixed-effects fit).

coefmap

a DataFrame mapping each covariate to its index cell type, niche cell type, and type.

alpha

a matrix, the per-gene coefficients (genes x covariates).

gmean

a numeric, the per-gene intercept (zero for the generic fit).

psi

a numeric, the per-gene negative binomial dispersion.

rho

a numeric, the average inter-gene correlation of the Pearson residuals, accumulated by testSpiDE() from the gene blocks it already loads. Used by spiGSEA() as the variance-inflation term. Empty until inference has run.

loglik

a numeric, the per-gene log-likelihood (used for Cauchy weights).

re_group

a character (or NULL), the random-effect group of each column of W (NA for fixed columns); NULL for a fixed-effects fit.

tau2

a numeric (or NULL), the fitted random-effect variance components (one per random-effect group); NULL for a fixed-effects fit.

penalty

a numeric (or NULL), the per-column ridge penalty (lambda.a) used at fit time (0 on fixed columns, 1/tau2 on random columns).

df

a numeric (or NULL), the Wald reference degrees of freedom. NULL for a fixed-effects fit (normal reference); a scalar between-patient S - 2 under df.method = "between"; or a named per-tested-coefficient vector (aligned to the columns of t_stat/se) under df.method = "satterthwaite" — the Response main effect stays ~ S - 2 while niche interactions, informed by within-sample variation, get a larger df.

t_stat

a matrix, per-gene Wald t-statistics (genes x covariates).

se

a matrix, per-gene coefficient standard errors (genes x covariates).

p.combined.pos

a matrix, combined p-values for up-regulation (genes x (gene-level plus per-index-cell-type)). The within-gene combiner is Brown's method or the Cauchy combination test (see combine).

p.combined.neg

a matrix, combined p-values for down-regulation.

polish

a data.frame or NULL; per-gene diagnostics of the convergence stage (iterations, fitNB's psi, whether the gene restarted from a sane start, whether it hit the iteration cap, whether its information matrix was singular). NULL when converge = FALSE.

sampling

a factor, cells used for GLM/dispersion estimation (from SpaNorm::fitNB()).