Last chance! 50% off unlimited learning
Sale ends in
x
into one species/taxa/OTU.phyloseq-class
, otu_table-class
,
phylo-class
, taxonomyTable-class
),
as well as
a vector of species that should be merged.
It is intended to be able to operate at a low-level such that
related methods, such as tip_glom
and tax_glom
can both reliably call merge_taxa
for their respective purposes.merge_taxa(x, eqtaxa, archetype=1)## S3 method for class 'phyloseq':
merge_taxa(x, eqtaxa,
archetype = eqtaxa[which.max(taxa_sums(x)[eqtaxa])])
## S3 method for class 'sample_data':
merge_taxa(x, eqtaxa, archetype = 1L)
## S3 method for class 'otu_table':
merge_taxa(x, eqtaxa,
archetype = eqtaxa[which.max(taxa_sums(x)[eqtaxa])])
## S3 method for class 'phylo':
merge_taxa(x, eqtaxa, archetype = 1L)
## S3 method for class 'XStringSet':
merge_taxa(x, eqtaxa, archetype = 1L)
## S3 method for class 'taxonomyTable':
merge_taxa(x, eqtaxa, archetype = 1L)
phyloseq-class
, otu_table-class
, taxonomyTable-class
,
phylo
.length(eqtaxa) < 2
, then the object x
will be returned
safely unchanged.eqtaxa
, or OTU ID,
indicating the species that should be kept to represent
the summed/merged group of species/taxa/OTUs.
The default is to use the OTU with the largest count total
if counts are available, or to use 1
(the first OTU in eqtaxa
) otherwise.
If archetype
is not a valid index or index-name in eqtaxa
,
the first will be used, and the value in archetype will be used
as the index-name for the new species.x
, in its original class, but with the specified
species merged into one entry in all relevant components.tip_glom
, tax_glom
, merge_phyloseq
,
merge_samples
#
data(esophagus)
tree <- phy_tree(esophagus)
otu <- otu_table(esophagus)
otutree0 <- phyloseq(otu, tree)
# plot_tree(otutree0)
otutree1 <- merge_taxa(otutree0, 1:8, 2)
# plot_tree(esophagus, ladderize="left")
Run the code above in your browser using DataLab