Learn R Programming

RAM (version 1.2.1.3)

tax.fill: Fill Missing Taxonomic Information

Description

This function consumes an OTU table and returns a new OTU table where the taxonomic classifications which are unidentified, unclassified, incertae sedis, or simply missing, are replaced with a more descriptive entry.

Usage

tax.fill(data, downstream = TRUE)

Arguments

data
the OTU table to be used.
downstream
logical. Should the replacement occur downstream, or upstream? (see Details)

Value

Returns an OTU table as a data frame with the exact same numerical counts as data, but an updated taxonomy column.

Details

If downstream == TRUE, the function will start at the kingdom level and work its way down. Whenever an invalid group is encountered (i.e. one of "unclassified", "unidentified", "incertae_sedis", or simply missing, ignoring capitalization), the last known 'good' group will be substituted in the form "p__belongs_to_k_Fungi." If downstream == FALSE, the function will begin at the species level and work up. This example should help clarify: given the taxonomy "k__Fungi; p__unidentified; c__Tremellomycetes", the new taxonomy is as follows (recall that an OTU table is required as input, and will be returned as output; this example simply shows the effect on the taxonomy):
  • Downstream (Kingdom -> Species): "k__Fungi; p__belongs_to_k_Fungi; c__Tremellomycetes; o__belongs_to_c_Tremellomycetes; f__belongs_to_c_Tremellomycetes; g__belongs_to_c_Tremellomycetes; s__belongs_to_c_Tremellomycetes"
  • Upstream (Species -> Kingdom): "k__Fungi; p__belongs_to_c_Tremellomycetes; c__Tremellomycetes; o__belongs_to_no_taxonomy; f__belongs_to_no_taxonomy; g__belongs_to_no_taxonomy; s__belongs_to_no_taxonomy"

Usually, downstream = TRUE will provide a more useful output, however if the species is often known for your data, but other ranks are unknown, downstream = FALSE will provide a more descriptive taxonomy.

See Also

RAM.rank.formatting

Examples

Run this code
data(ITS1)
#\code{filter.OTU} returns a list
otu <- filter.OTU(data=list(ITS1=ITS1), percent=0.001)[[1]]
tax.fill(otu)

Run the code above in your browser using DataLab