beta_cpcoa: Plotting beta diversity scatter plot of Constrained PCoA

View source: R/beta_cpcoa.R

beta_cpcoaR Documentation

Plotting beta diversity scatter plot of Constrained PCoA

Description

Input rarefied OTU table and metadata, and manual set beta distance type and metadata column names. ggplot2 show CPCoA with color and stat ellipse.

Usage

beta_cpcoa(
  otutab,
  metadata,
  dis = "bray",
  groupID = "Group",
  ellipse = T,
  label = F
)

Arguments

otutab

rarefied OTU table, typical output of usearch -otutab_norm or -otutab_rare,

metadata

matrix or dataframe, including sampleID and groupID;

dis

distance type for caucluate, default "bray", alternative "manhattan, euclidean, canberra, bray, kulczynski, jaccard, gower, altGower, morisita, horn, mountford, raup , binomial, chao, cao or mahalanobis".

groupID

column name for groupID.

ellipse

stat ellipse, T or F.

label

sample name showing, T or F.

Details

By default, returns beta CPCoA coordinate The available diversity indices include the following:

  • most used indices: bray, manhattan, euclidean, jaccard

  • other used indices: canberra, kulczynski, gower, altGower, morisita, horn, mountford, raup , binomial, chao, cao or mahalanobis

Value

ggplot2 object.

Author(s)

Contact: Yong-Xin Liu metagenome@126.com

References

Yong-Xin Liu, Yuan Qin, Tong Chen, Meiping Lu, Xubo Qian, Xiaoxuan Guo & Yang Bai. A practical guide to amplicon and metagenomic analysis of microbiome data. Protein Cell, 2020, DOI: https://doi.org/10.1007/s13238-020-00724-8

Jingying Zhang, Yong-Xin Liu, Na Zhang, Bin Hu, Tao Jin, Haoran Xu, Yuan Qin, Pengxu Yan, Xiaoning Zhang, Xiaoxuan Guo, Jing Hui, Shouyun Cao, Xin Wang, Chao Wang, Hui Wang, Baoyuan Qu, Guangyi Fan, Lixing Yuan, Ruben Garrido-Oter, Chengcai Chu & Yang Bai. NRT1.1B is associated with root microbiota composition and nitrogen use in field-grown rice. Nature Biotechnology, 2019(37), 6:676-684, DOI: https://doi.org/10.1038/s41587-019-0104-4

See Also

beta_cpcoa

Examples

# example data: OTU table, rownames is OTU_xxx, colnames is SampleID
data(otutab)
# example data: metadata or design, include SampleID, Group and site
data(metadata)
# Set 2 parameters: otu table, metadata, and distance type and groupID using default "bray" and "Group"
beta_cpcoa(otutab, metadata)
# Set 4 parameters: otu table, metadata, distance type as "jaccard" and groupID as "site"
beta_cpcoa(otutab, metadata, "jaccard", "site")
# You can found a two-dimension seperated groups, by watch out p is significantly?
# Set 6 parameters: otutab, metadata, and groupID as using "site",
beta_cpcoa(otutab, metadata, dis = "bray", groupID = "Group", ellipse = T, label = T)

microbiota/amplicon documentation built on April 30, 2023, 1:48 p.m.