Description Usage Arguments Details Author(s) References See Also Examples
Rarefy datasets in R or from a path.
1 2 3 4 |
x |
a rare result object |
div |
Diversity measure to plot. Can be any of |
groups |
If grouping is desired a vector of factors corresponting to the input samples |
col |
Colors used for plotting. Can be a vector of any length which will be recycled if it is to small. By default a rainbow is used. |
lty |
Linetypes used for plotting. Can be a vector of any length which will be recycled if it is to small. |
pch |
Symbols used for plotting. Can be a vector of any length which will be recycled if it is to small. |
fit |
Fit the rarefaction curve. Possible values: |
legend |
Logical indicating if a legend should be created or not |
legend.pos |
Position of the said legend |
log.dim |
Character vector indicating which scale log log transform for plotting rarefaction curves. |
boxplot |
If a boxplot should be added to the lineplot of the rarefaction curve. |
... |
Other plotting input will be passed to |
To create plots from the rarefaction results you can easily just call a plot on the resulting elements. This will either produce a rarefaction curve, if mor than one depth was rarefied to, or a boxplot for a single depth. Grouping of samples is possible by simply passing a vetor of the length of the samples to the option groups
.
Rarefaction curves can be fittet to either the arrhenius-equation, the michaelis-menten (SSmicmen) equation or the logis function SSlogis. To disable fitting fit
must be set to FALSE
.
Falk Hildebrand, Paul Saary
Saary, Paul, et al. "RTK: efficient rarefaction analysis of large datasets." Bioinformatics (2017): btx206.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | require("rtk")
# generate semi sparse example data
data <- matrix(sample(x = c(rep(0, 1500),rep(1:10, 500),1:1000),
size = 120, replace = TRUE), 40)
# find the column with the lowest aboundance
samplesize <- min(colSums(data))
# rarefy the dataset, so each column contains the same number of samples
d1 <- rtk(input = data, depth = samplesize)
# rarefy to different depths between 1 and samplesize
d2 <- rtk(input = data, depth = round(seq(1, samplesize, length.out = 10)))
# just the richness of all three samples as boxplot
plot(d1, div = "richness")
#rarefaction curve for each sample with fit
plot(d2, div = "eveness", fit = "arrhenius", pch = c(1,2,3))
# Rarefaction curve with boxplot, sampels pooled together (grouped)
plot(d2, div = "richness", fit = FALSE, boxplot = TRUE, col = 1, groups = rep(1, ncol(data)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.