beta_pcoa: Plotting beta diversity scatter plot

View source: R/beta_pcoa.R

beta_pcoaR Documentation

Plotting beta diversity scatter plot

Description

Input distance matrix and metadata, and manual set metadata column names. Visualize PCoA with color and stat ellipse by ggplot2.

Usage

beta_pcoa(
  dis_mat,
  metadata,
  groupID = "Group",
  ellipse = T,
  label = F,
  PCo = 12
)

Arguments

dis_mat

distance matrix, typical output of usearch -beta_div,

metadata

matrix or dataframe, including sampleID and groupID;

groupID

column name for groupID.

ellipse

stat ellipse, T or F.

label

sample name showing, T or F.

PCo

principle coordinate used, default 12, alternative 13, or 23.

Details

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

  • most used indices: bray_curtis, unifrac

  • other used indices: unifrac_binary, jaccard, euclidean, manhatten

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

# Set essential 3 parameters: distance matrix, metadata and groupID
beta_pcoa(beta_bray_curtis, metadata, "Group")
# Set full 6 parameters: distance matrix, metadata, and groupID as using "site",
beta_pcoa(dis_mat=beta_unifrac, metadata=metadata, groupID="Site", ellipse=F, label=T, PCo=13)

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