Differential Progression Test — progressionTest (original) (raw)

Test whether or not the pseudotime distribution are identical within lineages between conditions

progressionTest(pseudotime, ...)

S4 method for matrix

progressionTest( pseudotime, cellWeights, conditions, global = TRUE, lineages = FALSE, method = ifelse(dplyr::n_distinct(conditions) == 2, "KS", "Classifier"), thresh = ifelse(method == "Classifer", 0.05, 0.01), args_mmd = list(), args_classifier = list(), args_wass = list(), rep = 10000 )

S4 method for SlingshotDataSet

progressionTest( pseudotime, conditions, global = TRUE, lineages = FALSE, method = ifelse(dplyr::n_distinct(conditions) == 2, "KS", "Classifier"), thresh = ifelse(method == "Classifer", 0.05, 0.01), args_mmd = list(), args_classifier = list(), args_wass = list(), rep = 10000 )

S4 method for SingleCellExperiment

progressionTest( pseudotime, conditions, global = TRUE, lineages = FALSE, method = ifelse(dplyr::n_distinct(conditions) == 2, "KS", "Classifier"), thresh = ifelse(method == "Classifer", 0.05, 0.01), args_mmd = list(), args_classifier = list(), args_wass = list(), rep = 10000 )

S4 method for PseudotimeOrdering

progressionTest( pseudotime, conditions, global = TRUE, lineages = FALSE, method = ifelse(dplyr::n_distinct(conditions) == 2, "KS", "Classifier"), thresh = ifelse(method == "Classifer", 0.05, 0.01), args_mmd = list(), args_classifier = list(), args_wass = list(), rep = 10000 )

Arguments

pseudotime Can be either a SlingshotDataSet or aSingleCellExperiment object or a matrix of pseudotime values, each row represents a cell and each column represents a lineage.
... parameters including:
cellWeights If pseudotime is a matrix of pseudotime values, this represent the cell weights for each lineage. Ignored if pseudotime is not a matrix.
conditions Either the vector of conditions, or a character indicating which column of the metadata contains this vector.
global If TRUE, test for all lineages simultaneously.
lineages If TRUE, test for all lineages independently.
method One of "KS", "Classifier", "mmd", "wasserstein_permutation" or "Permutation" for a permutation. See details. Default to KS if there is two conditions and to "Classifier" otherwise.
thresh The threshold for the KS test or Classifier test. Ignored if method = "Permutation". Default to .01 for KS and .05 for the 'classifier'.
args_mmd arguments passed to the mmd test. See mmd_test.
args_classifier arguments passed to the classifier test. See classifier_test.
args_wass arguments passed to the wasserstein permutation test. Seewasserstein_permut.
rep Number of permutations to run. Ignored if method = "KS". Default to 1e4.

Value

A data frame with 3 columns:

Details

For every lineage, we compare the pseudotimes of the cells from either conditions, using the lineage weights as observations weights.

The p-value at the global level can be computed in two ways. method is "KS" or"Permutation", then the p-values are computed using stouffer's z-score method, with the lineages weights acting as weights. Otherwise, the test works on multivariate data and is applied on all pseudotime values.

References

Stouffer, S.A.; Suchman, E.A.; DeVinney, L.C.; Star, S.A.; Williams, R.M. Jr. (1949)._The American Soldier, Vol.1: Adjustment during Army Life._Princeton University Press, Princeton.

Examples

data('slingshotExample', package = "slingshot") rd <- slingshotExample$rd cl <- slingshotExample$cl condition <- factor(rep(c('A','B'), length.out = nrow(rd))) condition[110:139] <- 'A' sds <- slingshot::slingshot(rd, cl) progressionTest(sds, condition)

#> lineage statistic p.value #> 1 All 2.873272 0.002031221