Perform test of differential expression patterns between lineages in a user-defined region based on the knots of the smoothers.

earlyDETest(models, ...)

# S4 method for SingleCellExperiment
earlyDETest(
models,
global = TRUE,
pairwise = FALSE,
knots = NULL,
nPoints = 2 * nknots(models),
l2fc = 0,
eigenThresh = 0.01
)

# S4 method for list
earlyDETest(
models,
global = TRUE,
pairwise = FALSE,
knots = NULL,
nPoints = 2 * nknots(models),
l2fc = 0,
eigenThresh = 0.01
)

## Arguments

models The fitted GAMs, typically the output from fitGAM. parameters including: If TRUE, test for all pairwise comparisons simultaneously. If TRUE, test for all pairwise comparisons independently. A vector of length 2 specifying the knots at the start and end of the region of interest. The number of points to be compared between lineages. Defaults to twice the number of knots The log2 fold change threshold to test against. Note, that this will affect both the global test and the pairwise comparisons. Eigenvalue threshold for inverting the variance-covariance matrix of the coefficients to use for calculating the Wald test statistics. Lower values are more lenient to adding more information but also decrease computational stability. This argument should in general not be changed by the user but is provided for back-compatability. Set to 1e-8 to reproduce results of older version of tradeSeq.

## Value

A matrix with the wald statistic, the number of df and the p-value associated with each gene for all the tests performed. Also, for each possible pairwise comparision, the observed log fold changes. If the testing procedure was unsuccessful, the procedure will return NA test statistics, fold changes and p-values.

## Details

To help the user in choosing which knots to use when defining the branching, the plotGeneCount function has a models optional parameter that can be used to visualize where the knots are.

## Examples

data(gamList, package = "tradeSeq")
earlyDETest(gamList, knots = c(1, 2), global = TRUE, pairwise = TRUE)
#> Only two lineages; skipping pairwise comparison.#>                   waldStat df    pvalue   fcMedian
#> 1700012B09Rik 1.071612e-16  2 1.0000000  0.4901689
#> 1700017B05Rik 3.960814e+00  2 0.1380130  1.4803166
#> 1700020L24Rik 1.071612e-16  2 1.0000000  0.4901689
#> 1810009A15Rik 1.611391e+00  2 0.4467770  1.7931856
#> 1810011H11Rik 1.071612e-16  2 1.0000000  0.4901689
#> 1810027O10Rik 1.985099e-01  2 0.9055118  0.2846985
#> 1810031K17Rik 1.027339e+00  2 0.5982960  1.1570870
#> 1810033B17Rik 1.071612e-16  2 1.0000000  0.4901689
#> 1810037I17Rik 1.484424e+00  2 0.4760596  0.2644434
#> 2010002N04Rik 1.071612e-16  2 1.0000000  0.4901689
#> 2010011I20Rik 1.810283e-01  2 0.9134614 55.4715290