alpha_barplot: Plotting alpha diversity barplot for each group with anova...

View source: R/alpha_barplot.R

alpha_barplotR Documentation

Plotting alpha diversity barplot for each group with anova statistics

Description

Input alpha index and metadata, and manual set alpha index and metadata column names. ANOVA or agricolae::LSD.test calculate p-value, and dplyr summary each group max for p-value groups position. ggplot2 show barplot, error bar and stat groups.

Usage

alpha_barplot(alpha_div, metadata, index = "richness", groupID = "genotype")

Arguments

alpha_div

alpha diversity matrix, typical output of usearch -alpha_div or vegan estimateR/diversity(), rowname is sampleID, colname is index of alpha diversity;

metadata

matrix or dataframe, including sampleID and groupID;

index

index types of alpha diversity;

groupID

column name for groupID.

Details

By default, input alpha diversity and metatdata, and output plot The available diversity indices include the following:

  • most used indices: chao1, richness, shannon_e

  • other used indices: berger_parker, buzas_gibson, dominance, equitability, jost, jost1, reads, robbins, simpson, shannon_2, shannon_10

Value

ggplot2 object.

Author(s)

Contact: Tao Wen 2018203048@njau.edu.cn, Yong-Xin Liu yxliu@genetics.ac.cn

References

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

alpha_rare alpha_boxplot

Examples

# Set four parameters: alpha_div, metadata, index and groupID
alpha_barplot(alpha_div, metadata, "richness", "genotype")
# Set two parameters: alpha_div, metadata, and index and groupID as using chao1 and site
alpha_barplot(alpha_div, metadata, "chao1", "site")
# Set four parameters: alpha_div, metadata, index and groupID with full parameters
alpha_barplot(alpha_div = alpha_div, metadata = metadata, index = "richness", groupID = "genotype")

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