Learn R Programming

RAM (version 1.2.1.3)

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 provided, the OTU table will be processed by tax.abund at each given taxonomic ranks. See also RAM.rank.formatting. The unclassified taxon groups are removed.
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 top will be selected.

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).
  • If is.OTU is TRUE and ranks is not given: the output is a length one list named LCA_OTU.
  • If is.OTU is TRUE and ranks is 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.
  • If is.OTU is FALSE, the output is a length one list named Taxa.

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")
## Not run: 
# 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)
# ## End(Not run)

Run the code above in your browser using DataLab