Learn R Programming

otuSummary (version 0.1.1)

otuCollap: collapse a OTU table at given level.

Description

The function will collapse a structured OTU table at given taxonomic level.

Usage

otuCollap(otutab, taxto, siteInCol = TRUE, taxhead = "taxonomy",
    pattern = ";", collap = ";")

Value

The function will return a collapsed OTU table.

Arguments

otutab

A OTU table of microbial community, which must contain a taxonomic column (if siteInCol) or row (if site in rows). The otu table can be given in numeric counts or in relative abundance.

taxto

numeric, collapse the otutable at the taxonomic level which start position (index) from the left of taxonomy. For example, in "Archaea; Euryarchaeota; Methanomicrobia; Methanomicrobiales; Methanoregulaceae", the indices of "Euryarchaeota" and "Methanomicrobiales" are 2 and 4, respectively.

siteInCol

Logical, if "TRUE", the OTU table contains samples in columns and taxa in rows. The function will decide whether to transpose the otu table based on this parameter.

taxhead

Character, specify the header of taxonomy. By default we assume your taxonomic column is entitled "taxonomy".

pattern

Character, specify the separation of taxonomy. By default, the taxonomy is separated by semicolon (";").

collap

Character, tell the function about the separation for the hierarchical order in the output.

Author

Sizhong Yang <yanglzu@163.com>

Details

This function will directly collapse the otu table according to numeric position of structured taxonony. This function can also collapse data with structured format like the example OTU table.

See Also

otuReport

Examples

Run this code

data(otuqiime)
dim(otuqiime)

result <- otuCollap(otutab = otuqiime, taxto = 2, siteInCol = TRUE,
    taxhead = "taxonomy", pattern = ";")

dim(result)

Run the code above in your browser using DataLab