Learn R Programming

otuSummary (version 0.1.2)

slimTax: reshape heirarchical taxonomy

Description

The function will trunck the heirarchical taxonomy by "from" and "to".

Usage

slimTax(x, from, to, separator =';', jump=FALSE)

Value

The function will return the reshaped taxonomy.

Arguments

x

Character, structured strings to give the heirarchical taxonomy. If x is not character, please use as.character() function to convert first.

from

numeric, valid values within 1,2,...7, which represent the tax rank of domain, phylum, class, order, family, genus and species, respectively.

to

numeric, similar to parameter "from". Please note that value of "to" must not be smaller than "from".

separator

Character, for example semicolon ";" which states the seperator of taxonomic heirarchy.

jump

Logic, Setting "jump" to TRUE means only take the tax at indices "from" and "to", excluding those in between.

Author

Sizhong Yang <yanglzu@163.com>

Details

This function will reformat the taxonomy by the taxonomic ranks specified by "from" and "to".

See Also

fillTax

Examples

Run this code

test = 'd__Bacteria;p__Planctomycetota;c__Planctomycetes;o__Gemmatales;f__Gemmataceae;g__;s__'
slimTax(test, from=2, to=5)

data(otuqiime)
dim(otuqiime)

result <- slimTax(x = as.character(otuqiime$taxonomy), from=2, to=5, separator =';', jump=FALSE)

dim(result)

Run the code above in your browser using DataLab