View source: R/transform_filter-methods.R
filter_taxa | R Documentation |
This function is directly analogous to the
genefilter
function for microarray filtering,
but is used for filtering OTUs from phyloseq objects.
It applies an arbitrary set of functions —
as a function list, for instance, created by filterfun
—
as across-sample criteria, one OTU at a time.
It takes as input a phyloseq object,
and returns a logical vector
indicating whether or not each OTU passed the criteria.
Alternatively, if the "prune"
option is set to FALSE
,
it returns the already-trimmed version of the phyloseq object.
filter_taxa(physeq, flist, prune=FALSE)
physeq |
(Required). A |
flist |
(Required). A function or list of functions that take a vector
of abundance values and return a logical. Some canned useful function types
are included in the |
prune |
(Optional). A logical. Default |
A logical vector equal to the number of taxa in physeq
.
This can be provided directly to prune_taxa
as first argument.
Alternatively, if prune==TRUE
, the pruned phyloseq-class
object is returned instead.
filterfun
,
genefilter_sample
,
filterfun_sample
data("enterotype") require("genefilter") flist <- filterfun(kOverA(5, 2e-05)) ent.logi <- filter_taxa(enterotype, flist) ent.trim <- filter_taxa(enterotype, flist, TRUE) identical(ent.trim, prune_taxa(ent.logi, enterotype)) identical(sum(ent.logi), ntaxa(ent.trim)) filter_taxa(enterotype, flist, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.