taxa_filter: Filter taxa based on proportion of samples they are observed...

View source: R/taxa_filter.R

taxa_filterR Documentation

Filter taxa based on proportion of samples they are observed in. Function from the phylosmith-package.

Description

Inputs a phyloseq object and finds which taxa are seen in a given proportion of samples, either in the entire dataset, by treatment, or a particular treatment of interest.

Usage

taxa_filter(phyloseq_obj, treatment = NULL, subset = NULL,
frequency = 0, below = FALSE, drop_samples = FALSE)

Arguments

phyloseq_obj

A phyloseq-class object. It must contain sample_data()) with information about each sample, and it must contain tax_table()) with information about each taxa/gene.

treatment

Column name as a string or numeric in the sample_data. This can be a vector of multiple columns and they will be combined into a new column.

subset

A factor within the treatment. This will remove any samples that to not contain this factor. This can be a vector of multiple factors to subset on.

frequency

The proportion of samples the taxa is found in.

below

Does frequency define the minimum (FALSE) or maximum (TRUE) proportion of samples the taxa is found in.

drop_samples

Should the function remove samples that that are empty after removing taxa filtered by frequency (TRUE).

Value

phyloseq-object

Examples

taxa_filter(soil_column, frequency = 0.8)
taxa_filter(soil_column, treatment = c("Matrix", "Treatment"),
subset = "Soil Amended", frequency = 0.8)

schuyler-smith/phyloschuyler documentation built on March 27, 2024, 4:29 p.m.