R: Agglomerate closely-related taxa using single-linkage...
tip_glom
R Documentation
Agglomerate closely-related taxa using single-linkage clustering.
Description
All tips of the tree separated by a cophenetic distance smaller than
h will be agglomerated into one taxa using merge_taxa.
Usage
tip_glom(physeq, h = 0.2, hcfun = agnes, ...)
Arguments
physeq
(Required). A phyloseq-class,
containing a phylogenetic tree.
Alternatively, a phylogenetic tree phylo will also work.
h
(Optional). Numeric scalar of the height where the tree should be cut.
This refers to the tree resulting from hierarchical clustering
of cophenetic.phylo(phy_tree(physeq)),
not necessarily the original phylogenetic tree, phy_tree(physeq).
Default value is 0.2.
Note that this argument used to be named speciationMinLength,
before this function/method was rewritten.
hcfun
(Optional). A function.
The (agglomerative, hierarchical) clustering function to use.
Good examples are
agnes and hclust.
The default is agnes.
...
(Optional). Additional named arguments to pass
to hcfun.
Details
Can be used to create a non-trivial OTU Table, if a phylogenetic tree is available.
For now, a simple, “greedy”, single-linkage clustering is used. In future releases
it should be possible to specify different clustering approaches available in R,
in particular, complete-linkage clustering appears to be used more commonly for OTU
clustering applications.
Value
An instance of the phyloseq-class.
Or alternatively, a phylo object if the
physeq argument was just a tree.
In the expected-use case, the number of OTUs will be fewer
(see ntaxa),
after merging OTUs that are related enough to be called
the same OTU.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(phyloseq)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/phyloseq/tip_glom.Rd_%03d_medium.png", width=480, height=480)
> ### Name: tip_glom
> ### Title: Agglomerate closely-related taxa using single-linkage
> ### clustering.
> ### Aliases: tip_glom
>
> ### ** Examples
>
> data("esophagus")
> # for speed
> esophagus = prune_taxa(taxa_names(esophagus)[1:25], esophagus)
> plot_tree(esophagus, label.tips="taxa_names", size="abundance", title="Before tip_glom()")
> plot_tree(tip_glom(esophagus, h=0.2), label.tips="taxa_names", size="abundance", title="After tip_glom()")
>
>
>
>
>
> dev.off()
null device
1
>