slimTax {otuSummary}R Documentation

reshape heirarchical taxonomy

Description

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

Usage

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

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.

Details

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

Value

The function will return the reshaped taxonomy.

Author(s)

Sizhong Yang <yanglzu@163.com>

See Also

fillTax

Examples


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)


[Package otuSummary version 0.1.2 Index]