Test whether or not the cell repartition between lineages is independent of the conditions

differentiationTest(cellWeights, ...)

# S4 method for matrix
differentiationTest(
  cellWeights,
  conditions,
  global = TRUE,
  pairwise = FALSE,
  method = c("Classifier", "mmd", "wasserstein_permutation"),
  classifier_method = "rf",
  thresh = 0.01,
  args_classifier = list(),
  args_mmd = list(),
  args_wass = list()
)

# S4 method for SlingshotDataSet
differentiationTest(
  cellWeights,
  conditions,
  global = TRUE,
  pairwise = FALSE,
  method = c("Classifier", "mmd", "wasserstein_permutation"),
  classifier_method = "rf",
  thresh = 0.01,
  args_classifier = list(),
  args_mmd = list(),
  args_wass = list()
)

# S4 method for SingleCellExperiment
differentiationTest(
  cellWeights,
  conditions,
  global = TRUE,
  pairwise = FALSE,
  method = c("Classifier", "mmd", "wasserstein_permutation"),
  classifier_method = "rf",
  thresh = 0.01,
  args_classifier = list(),
  args_mmd = list(),
  args_wass = list()
)

# S4 method for PseudotimeOrdering
differentiationTest(
  cellWeights,
  conditions,
  global = TRUE,
  pairwise = FALSE,
  method = c("Classifier", "mmd", "wasserstein_permutation"),
  classifier_method = "rf",
  thresh = 0.01,
  args_classifier = list(),
  args_mmd = list(),
  args_wass = list()
)

Arguments

cellWeights

Can be either a SlingshotDataSet, a SingleCellExperiment object or a matrix of cell weights defining the probability that a cell belongs to a particular lineage. Each row represents a cell and each column represents a lineage. If only a single lineage, provide a matrix with one column containing all values of 1.

...

parameters including:

conditions

Either the vector of conditions, or a character indicating which column of the metadata contains this vector

global

If TRUE, test for all pairs simultaneously.

pairwise

If TRUE, test for all pairs independently.

method

One of "Classifier" or "mmd".

classifier_method

The method used in the classifier test. Default to "rf", i.e random forest.

thresh

The threshold for the classifier test. See details. Default to .05.

args_classifier

arguments passed to the classifier test. See classifier_test.

args_mmd

arguments passed to the mmd test. See mmd_test.

args_wass

arguments passed to the wasserstein permutation test. See wasserstein_permut.

Value

A data frame with 3 columns:

  • *pair* for individual pairs, the lineages numbers. For global, "All".

  • *p.value* the pvalue for the test at the global or pair level

  • *statistic* The classifier accuracy

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) differentiationTest(sds, condition)
#> note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 . #>
#> Loading required package: lattice
#> Loading required package: ggplot2
#> note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 . #>
#> # A tibble: 1 x 3 #> pair statistic p.value #> <chr> <dbl> <dbl> #> 1 1vs2 0.552 0.298