View source: R/getStepwiseDivergence.R
getStepwiseDivergence | R Documentation |
Calculates sample dissimilarity between consecutive time points (t, t+i),
within a group (subject, reaction chamber, or similar). The corresponding
time difference is returned as well. The method operates on
SummarizedExperiment
objects, and the results are stored in colData
.
getStepwiseDivergence(
x,
group = NULL,
time_field,
time_interval = 1,
name_divergence = "time_divergence",
name_timedifference = "time_difference",
assay.type = "counts",
FUN = vegan::vegdist,
method = "bray",
altexp = NULL,
dimred = NULL,
n_dimred = NULL,
...
)
getTimeDivergence(x, ...)
## S4 method for signature 'ANY'
getTimeDivergence(x, ...)
x |
A
|
group |
|
time_field |
|
time_interval |
|
name_divergence |
|
name_timedifference |
|
assay.type |
|
FUN |
|
method |
|
altexp |
|
dimred |
|
n_dimred |
|
... |
Arguments to be passed |
a
SummarizedExperiment
or
TreeSummarizedExperiment
containing the sample dissimilarity and corresponding time difference between
samples (across n time steps), within each level of the grouping factor.
#library(miaTime)
library(TreeSummarizedExperiment)
data(hitchip1006)
tse <- mia::transformCounts(hitchip1006, method = "relabundance")
# Subset to speed up example
tse <- tse[, colData(tse)$subject %in% c("900", "934", "843", "875")]
# Using vegdist for divergence calculation, one can pass
# the dissimilarity method from the vegan::vegdist options
# via the "method" argument
tse2 <- getStepwiseDivergence(tse, group = "subject",
time_interval = 1,
time_field = "time",
assay.type="relabundance",
FUN = vegan::vegdist,
method="bray")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.