library("spiDE")
data(toySpiDE)
res <- spiDE(toySpiDE, condition = "condition", sigma = 30, index = "A",
procedure = "all")
sets <- list(first = paste0("G", 1:5), second = paste0("G", 6:12))
spiGSEA(res, sets, min.size = 3)Gene-set tests on spiDE’s niche results
Description
Asks, for every gene set and every (index cell type, niche cell type) column, whether the set’s genes as a group change with the niche (the pooled test) or change with it differently between the two conditions (the condition-specific test).
Usage
spiGSEA(object, genesets, ...)
## S4 method for signature 'SpiDEResults'
spiGSEA(
object,
genesets,
test = NULL,
type = c("competitive", "self-contained"),
min.size = 5L,
max.size = 500L,
BPPARAM = BiocParallel::SerialParam(),
...
)
Arguments
object
|
a SpiDEResults from the slopes engine. |
genesets
|
a named list of character vectors of gene names. |
…
|
unused. |
test
|
“pooled”, “condition” or both (the default: every test the results hold).
|
type
|
“competitive” (default) or “self-contained”.
|
min.size, max.size
|
set size limits after intersecting with the genes tested in each index type. |
BPPARAM
|
a BiocParallelParam; the condition-specific test is run in parallel over sets. |
Details
A gene set is tested exactly like a gene. Every patient gets a slope for the set: the average of its genes’ niche slopes in that patient, each gene’s slope first put on a common scale (divided by the gene’s typical spread of slopes between patients, so a highly expressed gene does not dominate). By default the set’s slope is competitive: the same average over the column’s other tested genes is subtracted, so the test asks whether the set moves more than the typical gene. This guards against a shift that moves every gene, e.g. from segmentation spillover. With type = “self-contained” nothing is subtracted.
The patients’ set slopes then go through the same pooled and condition tests as the genes’ slopes (see testSpiDE() and the model vignette). Because the patient is the unit of replication, the correlation between the genes of a set is accounted for without being estimated: it is already in how much the set’s slope varies from patient to patient.
Needs the slopes engine, whose fit holds each patient’s slopes. For gene sets in the between-patient test, use testNicheAbundance() with genesets.
Value
a data.frame, one row per (set, index, niche, test): size (genes of the set tested there), estimate (the mean set slope, pooled, or its difference between conditions, in units of the genes’ between-patient spread), se, t, df, p, q (Benjamini-Hochberg within the (index, niche, test) column), q.global (over every row of that test), n_patients and direction.
See Also
testSpiDE()