topologyTest | R Documentation |
Test whether or not slingshot should be fitted independently for different conditions or not.
topologyTest(sds, ...)
## S4 method for signature 'SlingshotDataSet'
topologyTest(
sds,
conditions,
rep = 100,
threshs = 0.01,
methods = ifelse(dplyr::n_distinct(conditions) == 2, "KS_mean", "Classifier"),
parallel = FALSE,
BPPARAM = BiocParallel::bpparam(),
args_mmd = list(),
args_classifier = list(),
args_wass = list(),
nmax = nrow(slingshot::slingPseudotime(sds)),
distinct_samples = NULL
)
## S4 method for signature 'SingleCellExperiment'
topologyTest(
sds,
conditions,
rep = 100,
threshs = 0.01,
methods = ifelse(dplyr::n_distinct(conditions) == 2, "KS_mean", "Classifier"),
parallel = FALSE,
BPPARAM = BiocParallel::bpparam(),
args_mmd = list(),
args_classifier = list(),
args_wass = list(),
nmax = ncol(sds),
distinct_samples = NULL
)
## S4 method for signature 'PseudotimeOrdering'
topologyTest(
sds,
conditions,
rep = 100,
threshs = 0.01,
methods = ifelse(dplyr::n_distinct(conditions) == 2, "KS_mean", "Classifier"),
parallel = FALSE,
BPPARAM = BiocParallel::bpparam(),
args_mmd = list(),
args_classifier = list(),
args_wass = list(),
nmax = nrow(slingshot::slingPseudotime(sds)),
distinct_samples = NULL
)
sds |
A slingshot object already run on the full dataset. Can be either a
|
... |
parameters including: |
conditions |
Either the vector of conditions, or a character indicating which column of the metadata contains this vector. |
rep |
How many permutations to run. Default to 50. |
threshs |
the threshold(s) for the KS test or classifier test. Default to .01
See |
methods |
The method(s) to use to test. Must be among 'KS_mean', 'Classifier', "KS_all', "mmd' and 'wasserstein_permutation'. See details. |
parallel |
Logical, defaults to FALSE. Set to TRUE if you want to parallellize the fitting. |
BPPARAM |
object of class |
args_mmd |
arguments passed to the mmd test. See |
args_classifier |
arguments passed to the classifier test. See |
args_wass |
arguments passed to the wasserstein permutation test. See
|
nmax |
How many samples to use to compute the mmd test. See details. |
distinct_samples |
The samples to which each cell belong to. Only use
with method 'distinct'. See ' |
If there is only two conditions, default to 'KS_mean'. Otherwise, uses a classifier.
More than one method can be specified at once, which avoids running slingshot on the permutations more than once (as it is the slowest part).
For the 'mmd_test', if 'null=unbiased', it is recommand to set 'nmax=2000' or something of that order of magnitude to avoid overflowing the memory.
A list containing the following components:
*method* The method used to test
*thresh* The threshold (if relevant)
*statistic* the value of the test statistic.
*p.value* the p-value of the test.
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::getLineages(rd, cl)
topologyTest(sds, condition, rep = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.