collectors.curve {rtk}R Documentation

collectors.curve

Description

Collectorscurves visualize the richness gained by picking more samples.

Usage

	collectors.curve(x, y = NULL, col = 1, times = 10, bin = 3, add = FALSE, 
	                 ylim = NULL, xlim = NULL, doPlot = TRUE, rareD = NULL, 
	                 cls = NULL, pch = 20, col2 = NULL, accumOrder = NULL, ...)

Arguments

x

Input a rarefaction object with one matrix and one depth or dataframe/matrix or the output of collectors.curve itself

y

secondary input matrix for comparative plots

col

fill color of the boxplots (set to c(0) for no color)

times

Number of times the sampeling of samples should be perfomed

bin

Number of samples to be added each step. Usefull to adjust for a quick glance.

add

add the plot to an existing plot?

ylim

Limits for Y-scale

xlim

Limits for X-scale

doPlot

should this function plot the collectors curve, or just return an object that can be plotted later with this function?

rareD

Depth to which rarefy the dataset using rtk

cls

vector describing the class of each input sample

pch

Plotting symbols

col2

Color for the border of the boxplot, defaults to col

accumOrder

accumulate successively within each class, given by cls in the order given in this vector. All classes in cls must be represented in this vector.

...

Options passed to plot or boxplot

Details

The function collectors.curve can visualize the richness a dataset has, if sampels are picked at random. It can handle rareafaction results as well as normal dataframes.

Author(s)

Falk Hildebrand, Paul Saary

References

Saary, Paul, et al. "RTK: efficient rarefaction analysis of large datasets." Bioinformatics (2017): btx206.

See Also

Use plot.rtk for how to plot your results.

Examples

require("rtk")
# Collectors Curve dataset should be broad and contain many samples (columns)
data       <- matrix(sample(x = c(rep(0, 15000),rep(1:10, 100)),
                     size = 10000, replace = TRUE), ncol = 80)
data.r     <- rtk(data, ReturnMatrix = 1, depth = min(colSums(data)))
# collectors curve on dataframe/matrix
collectors.curve(data, xlab = "No. of samples", ylab = "richness")
# same with rarefaction results (one matrix recommended)
collectors.curve(data.r, xlab = "No. of samples (rarefied data)", ylab = "richness")

# if you want to have an accumulated order, t compare various studies to one another:
cls          <- rep_len(c("a","b","c","d"), ncol(data))  # study origin of each sample
accumOrder   <- c("b","a","d","c")      # define the order, for the plot
colors       <- c(1,2,3,4)
names(colors) <- accumOrder # names used for legend
collectors.curve(data, xlab = "No. of samples",
                 ylab = "richness", col = colors, bin = 1,cls = cls, 
                 accumOrder = accumOrder)


[Package rtk version 0.2.6.1 Index]