Learn R Programming

RAM (version 1.2.0)

data.revamp: Transform OTU Table

Description

This function consumes and transforms either an OTU table or a taxonomy abundance matrix. If an OTU table was provided, it will be either transposed without the "taxonomy" column, but each otuID will be renames with it's LCA classification appended; or being transformed to be taxonomic abundance matrix at the ranks set by ranks. If a taxonomic abundance matrix is provided, it will be kept the same with proper data transformation as defined by stand.method option.

Usage

data.revamp(data, is.OTU=TRUE, ranks=NULL, stand.method=NULL, 
            top=NULL, mode="number")

Arguments

data
an OTU table or a taxonomic abundance matrix.
is.OTU
logical. If an OTU table was provided, is.OTU should be set as TRUE; otherwise, it should be set as FALSE.
ranks
optional. If no ranks was provided, the OTU table will be processed by LCA.OTU and then transposed with sampleIDs being row names and otuIDs being column names. If ranks was prov
stand.method
optional. Transform the output using method from the function decostand
top
optional. Select the top taxa or OTUs.
mode
a character vector, one of "percent" or "number". If number, then top many groups will be selected. If percent, then all groups with relative abundance in at least one sample above t

Value

  • The value returned by this function is a list, so for convenience, any nested lists have been given descriptive items names to make accessing its elements simple (see Examples).
    • Ifis.OTUisTRUEandranksis not given: the output is a length one list namedLCA_OTU.
    • Ifis.OTUisTRUEandranksis given: the output is a list with a length same as the number of taxonomic ranks provided. Each member of the list is named after the rank it processed at.
    • Ifis.OTUisFALSE, the output is a length one list namedTaxa.

Examples

Run this code
data(ITS1, ITS2, meta)
data.new <- data.revamp(data=list(ITS1=ITS1), is.OTU=TRUE, 
                        ranks=c("f", "g"), stand.method="log")
data.new <- data.revamp(data=list(ITS1=ITS1), is.OTU=TRUE, 
                        ranks=NULL, stand.method="log")
data.new <- data.revamp(data=list(ITS1=ITS1, ITS2=ITS2), 
           is.OTU=TRUE, ranks=c("f", "g"), stand.method="total")
names(data.new)

Run the code above in your browser using DataLab