getStepwiseDivergence | R Documentation |
Calculates sample dissimilarity between consecutive time points along with time difference.
getStepwiseDivergence(x, ...)
addStepwiseDivergence(x, ...)
## S4 method for signature 'ANY'
getStepwiseDivergence(
x,
time.col,
assay.type = "counts",
time.interval = 1L,
group = NULL,
method = "bray",
...
)
## S4 method for signature 'SummarizedExperiment'
addStepwiseDivergence(x, name = "divergence", name.time = "time_diff", ...)
x |
A
|
... |
Optional arguments passed into
|
time.col |
|
assay.type |
|
time.interval |
|
group |
|
method |
|
name |
|
name.time |
|
These functions calculate time-wise divergence, meaning each sample is
compared to the previous i-th sample, where i is the specified time
interval (see time.interval
). By default, the function calculates
divergence by comparing all samples with each other. However, it is often
more meaningful to calculate divergence within a specific patient or group
(see the group
parameter).
getStepwiseDivergence
returns DataFrame
object
containing the sample dissimilarity and corresponding time difference between
samples. addStepwiseDivergence
, on the other hand, returns a
SummarizedExperiment
object with these results in its colData
.
mia::addDivergence()
library(miaTime)
data(hitchip1006)
tse <- transformAssay(hitchip1006, method = "relabundance")
# Calculate divergence
tse <- addStepwiseDivergence(
tse,
group = "subject",
time.interval = 1,
time.col = "time",
assay.type = "relabundance"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.