R/AllGenerics.R
, R/differentiationTest.R
differentiationTest.Rd
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() )
cellWeights | Can be either a |
---|---|
... | 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 |
args_mmd | arguments passed to the mmd test. See |
args_wass | arguments passed to the wasserstein permutation test. See
|
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
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 . #>#>#>#> 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