prune_taxa | R Documentation |
An S4 Generic method for removing (pruning) unwanted OTUs/taxa from phylogenetic
objects, including phylo-class trees, as well as native phyloseq package
objects. This is particularly useful for pruning a phyloseq object that has
more than one component that describes OTUs.
Credit: the phylo
-class version is adapted from
prune.sample.
prune_taxa(taxa, x) ## S4 method for signature ''NULL',ANY' prune_taxa(taxa, x) ## S4 method for signature 'logical,ANY' prune_taxa(taxa, x) ## S4 method for signature 'character,phylo' prune_taxa(taxa, x) ## S4 method for signature 'character,otu_table' prune_taxa(taxa, x) ## S4 method for signature 'character,sample_data' prune_taxa(taxa, x) ## S4 method for signature 'character,phyloseq' prune_taxa(taxa, x) ## S4 method for signature 'character,taxonomyTable' prune_taxa(taxa, x) ## S4 method for signature 'character,XStringSet' prune_taxa(taxa, x)
taxa |
(Required). A character vector of the taxa in object x that you want to
keep – OR alternatively – a logical vector where the kept taxa are TRUE, and length
is equal to the number of taxa in object x. If |
x |
(Required). A phylogenetic object, including |
The class of the object returned by prune_taxa
matches
the class of the argument, x
.
prune_samples
data("esophagus") esophagus plot(sort(taxa_sums(esophagus), TRUE), type="h", ylim=c(0, 50)) x1 = prune_taxa(taxa_sums(esophagus) > 10, esophagus) x2 = prune_taxa(names(sort(taxa_sums(esophagus), TRUE))[1:9], esophagus) identical(x1, x2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.