Description Usage Arguments Details Value Examples
Standard transforms for phyloseq-class
.
1 |
x |
|
transform |
Transformation to apply. The options include: 'compositional' (ie relative abundance), 'Z', 'log10', 'log10p', 'hellinger', 'identity', 'clr', or any method from the vegan::decostand function. |
target |
Apply the transform for 'sample' or 'OTU'. Does not affect the log transform. |
shift |
A constant indicating how much to shift the baseline abundance (in transform='shift') |
scale |
Scaling constant for the abundance values when transform = "scale". |
In transformation typ, the 'compositional' abundances are returned as relative abundances in [0, 1] (convert to percentages by multiplying with a factor of 100). The Hellinger transform is square root of the relative abundance but instead given at the scale [0,1]. The log10p transformation refers to log10(1 + x). The log10 transformation is applied as log10(1 + x) if the data contains zeroes. CLR transform applies a pseudocount of min(relative abundance)/2 to exact zero relative abundance entries in OTU table before taking logs.
Transformed phyloseq
object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | data(dietswap)
x <- dietswap
# No transformation
xt <- transform(x, 'identity')
# OTU relative abundances
# xt <- transform(x, 'compositional')
# Z-transform for OTUs
# xt <- transform(x, 'Z', 'OTU')
# Z-transform for samples
# xt <- transform(x, 'Z', 'sample')
# Log10 transform (log10(1+x) if the data contains zeroes)
# xt <- transform(x, 'log10')
# Log10p transform (log10(1+x) always)
# xt <- transform(x, 'log10p')
# CLR transform
xt <- microbiome::transform(x, 'clr')
# Shift the baseline
# xt <- transform(x, 'shift', shift=1)
# Scale
# xt <- transform(x, 'scale', scale=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.