Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subset_taxa-methods

Subset species by taxonomic expression


Description

This is a convenience wrapper around the subset function. It is intended to speed subsetting complex experimental objects with one function call. In the case of subset_taxa, the subsetting will be based on an expression related to the columns and values within the tax_table (taxonomyTable component) slot of physeq. The OTUs retained in the dataset is equivalent to x[subset & !is.na(subset)], where x is the vector of OTU IDs and subset is the logical that results from your subsetting expression. This is important to keep in mind, as users are often unaware that this subsetting step also removes/omits OTUs that have a missing value result, NA, somewhere in the expression.

Usage

subset_taxa(physeq, ...)

Arguments

physeq

A taxonomyTable-class, or phyloseq-class that contains a taxonomyTable. If the tax_table slot is missing in physeq, then physeq will be returned as-is and a warning will be printed to screen.

...

The subsetting expression that should be applied to the taxonomyTable. This is passed on to subset, and more details and examples about how it functions can be found in its documentation.

Value

A subsetted object with the same class as physeq.

See Also

Examples

## ex3 <- subset_taxa(GlobalPatterns, Phylum=="Bacteroidetes")

phyloseq

Handling and analysis of high-throughput microbiome census data

v1.34.0
AGPL-3
Authors
Paul J. McMurdie <joey711@gmail.com>, Susan Holmes <susan@stat.stanford.edu>, with contributions from Gregory Jordan and Scott Chamberlain
Initial release
2019-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.