Yuzhu Chen JL, Yufeng Zhang, Mingqian Zhang, Zheng Sun, Gongchao Jing, Shi Huang , Xiaoquan Su. Parallel-Meta Suite: interactive and rapid microbiome data analysis on multiple platforms. 2022. https://github.com/qdu-bioinfo/parallel-meta-suite
Perform principal coordinate analysis (PCoA) and plotting
Use the functions in the vegan package to process the distance matrix and perform PCoA to calculate the principal coordinates of the sample. Based on the classification information in the metadata, draw a PCoA plot for each categorical variable, and use ggplot2 to generate scatter plots of PC1 vs PC2, PC1 vs PC3, and PC2 vs PC3.