addDivergence | R Documentation |
Estimate divergence against a given reference sample.
addDivergence(x, name = "divergence", ...)
## S4 method for signature 'SummarizedExperiment'
addDivergence(x, name = "divergence", ...)
getDivergence(
x,
assay.type = assay_name,
assay_name = "counts",
reference = "median",
method = "bray",
...
)
## S4 method for signature 'SummarizedExperiment'
getDivergence(
x,
assay.type = assay_name,
assay_name = "counts",
reference = "median",
method = "bray",
...
)
x |
a |
name |
|
... |
optional arguments passed to
|
assay.type |
|
assay_name |
Deprecated. Use |
reference |
|
method |
|
Microbiota divergence (heterogeneity / spread) within a given sample set can be quantified by the average sample dissimilarity or beta diversity with respect to a given reference sample.
The calculation makes use of the function getDissimilarity()
. The
divergence
measure is sensitive to sample size. Subsampling or bootstrapping can be
applied to equalize sample sizes between comparisons.
x
with additional colData
named name
addAlpha
addDissimilarity
plotColData
data(GlobalPatterns)
tse <- GlobalPatterns
# By default, reference is median of all samples. The name of column where
# results is "divergence" by default, but it can be specified.
tse <- addDivergence(tse)
# The method that are used to calculate distance in divergence and
# reference can be specified. Here, euclidean distance is used. Reference is
# the first sample. It is recommended # to add reference to colData.
tse[["reference"]] <- rep(colnames(tse)[[1]], ncol(tse))
tse <- addDivergence(
tse, name = "divergence_first_sample",
reference = "reference",
method = "euclidean")
# Here we compare samples to global mean
tse <- addDivergence(tse, name = "divergence_average", reference = "mean")
# All three divergence results are stored in colData.
colData(tse)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.