differentiationTest {condiments} | R Documentation

## Differential Differentiation Test

### Description

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

### Usage

    differentiationTest(cellWeights, ...)

    ## S4 method for signature '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 signature '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 signature '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 signature '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)

[Package condiments version 1.2.0 Index]