preformattax: Reformatter of taxonomy files from mothur for use in R

Description Usage Arguments Value Examples

View source: R/preformattax.R

Description

This function uses a taxonomy file (i.e. an RDP naive bayesian fixed-rank asignment detail) and pre-processes it into a data frame for use within R.

Usage

1
2
3
4
5
6
7
8
preformattax(
  taxonomy,
  OTUtax = TRUE,
  probab = TRUE,
  keepProbab = TRUE,
  keepOTU = FALSE,
  keepSize = FALSE
)

Arguments

taxonomy

is a taxonomy file, raw.

OTUtax

is a logical indicating wether we are dealing with a classify.otu (TRUE) or classify.seqs (FALSE) taxonomy file. Defaults to TRUE.

probab

is a logical indicating whether the classify command was run with probs =T (i.e. probabilities or bootstrap confidences are included). Defaults to TRUE (= probs are in the taxonomy file). Currently ignored for if FALSE.

keepProbab

is a logical indicating whether or not to keep the columns with the probabilities. Defaults to TRUE. Ignored when probab is FALSE

keepOTU

is a logical indicating whether or not to include a column with the OTU names called OTU. Defaults to FALSE.

keepSize

is a logical indicating whether or not to include a column that contains the total read count within the OTU. Defaults to FALSE.

Value

A dataframe with a splitted taxonomy file. The Size column is dropped.

Examples

1
2
3
4
5
6
## Short example
# make sure library(CMETNGS) is loaded
taxonomydataset <- system.file("extdata","large_OTU_basedtax.taxonomy",
                              package = "CMETNGS",mustWork = TRUE)
taxonomy <- data.table::fread(input = taxonomydataset)
taxonomy.clean <- preformattax(taxonomy=taxonomy)

CMET-UGent/CMETNGS documentation built on Dec. 12, 2020, 8:22 a.m.