Skip to contents

Extract the tidy spiDE results table

Usage

results(object, ...)

# S4 method for class 'SpiDEResults'
results(object, type = c("niche", "celltype", "patient"), ...)

Arguments

object

a SpiDEResults object.

...

ignored; present for compatibility with the generic.

type

which response result to return. "niche" (default) gives the neighbourhood-dependent calls keyed by (gene, ct_index, ct_niche, bandwidth), gated by the 3-level gene -> index -> niche cascade. "celltype" gives cell-type-specific response calls keyed by (gene, ct_index), gated by a 2-level gene -> cell type cascade. "patient" gives one abundance-weighted response contrast per gene. The latter two are empty unless the design carries a CellType:condition block — in particular they are always empty for a condition-free (condition = NULL) fit, where "niche" instead reports the two-way CellType:niche associations.

All three layers combine evidence across every bandwidth, using the same log-likelihood-weighted Cauchy combination. The CellType:condition coefficients are not identical between bandwidths – they are fitted alongside different niche columns – so each bandwidth contributes its own evidence about the same contrast, and combining is what pools it.

Value

a data.frame of significant calls; see type. Empty until testSpiDE() is run.

Examples

data(toySpiDE)
spe <- buildNiches(toySpiDE, sigma = 20)
res <- spiDE(spe, condition = "condition", sigma = 20, random = "none", verbose = FALSE)
head(results(res))
#>   gene ct_index ct_niche bandwidth.max      coef         t DirectionGene
#> 1  G11        C        B            20 88.952901 53.321979          Both
#> 2  G11        B        A            20 29.157918 17.500218          Both
#> 3  G17        C        B            20 34.709419 13.878225            Up
#> 4   G5        C        A            20 21.886440 11.807649            Up
#> 5   G9        C        B            20 17.358199  7.341270            Up
#> 6   G1        A        B            20  3.205271  5.458804            Up
#>   DirectionIndex DirectionNiche     fdr.gene    fdr.index    fdr.niche
#> 1             Up             Up 3.996803e-14 2.997602e-15 1.998401e-15
#> 2             Up             Up 3.996803e-14 2.997602e-15 1.998401e-15
#> 3             Up             Up 3.996803e-14 5.995204e-15 1.998401e-15
#> 4             Up             Up 3.996803e-14 5.995204e-15 1.998401e-15
#> 5             Up             Up 6.347145e-12 1.269318e-12 4.232170e-13
#> 6             Up             Up 1.150443e-06 2.876110e-07 9.587034e-08