get_taxadf: get the data of specified taxonomy

get_taxadfR Documentation

get the data of specified taxonomy

Description

get the data of specified taxonomy

Usage

get_taxadf(obj, ...)

## S4 method for signature 'phyloseq'
get_taxadf(obj, taxlevel = 2, type = "species", ...)

## S4 method for signature 'data.frame'
get_taxadf(
  obj,
  taxda,
  taxa_are_rows,
  taxlevel,
  sampleda = NULL,
  type = "species",
  ...
)

Arguments

obj

phyloseq, phyloseq class or data.frame the shape of data.frame (nrow sample * column feature taxa_are_rows set FALSE, nrow feature * ncol sample, taxa_are_rows set TRUE).

...

additional parameters.

taxlevel

character, the column names of taxda that you want to get. when the input is phyloseq class, you can use 1 to 7.

type

character, the type of datasets, default is "species", if the dataset is not about species, such as dataset of kegg function, you should set it to "others".

taxda

data.frame, the classifies of feature contained in obj(data.frame).

taxa_are_rows

logical, if the column of data.frame are features, it should be set FALSE.

sampleda

data.frame, the sample information.

Value

phyloseq class contained tax data.frame and sample information.

Author(s)

Shuangbin Xu

Examples

## Not run: 
library(ggplot2)
data(test_otu_data)
test_otu_data %<>% as.phyloseq()
phytax <- get_taxadf(test_otu_data, taxlevel=2)
phytax
head(phyloseq::otu_table(phytax))
phybar <- ggbartax(phytax) + 
         xlab(NULL) + ylab("relative abundance (%)")

## End(Not run)

xiangpin/MicrobitaProcess documentation built on April 12, 2024, 9:03 p.m.