% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/alpha_barplot.R
\name{alpha_barplot}
\alias{alpha_barplot}
\title{Plotting alpha diversity barplot for each group with anova statistics}
\usage{
alpha_barplot(alpha_div, metadata, index = "richness", groupID = "genotype")
}
\arguments{
\item{alpha_div}{alpha diversity matrix, typical output of usearch -alpha_div or vegan estimateR/diversity(),
rowname is sampleID, colname is index of alpha diversity;}

\item{metadata}{matrix or dataframe, including sampleID and groupID;}

\item{index}{index types of alpha diversity;}

\item{groupID}{column name for groupID.}
}
\value{
ggplot2 object.
}
\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.
}
\details{
By default, input alpha diversity and metatdata, and output plot
The available diversity indices include the following:
\itemize{
\item{most used indices: chao1, richness, shannon_e}
\item{other used indices: berger_parker, buzas_gibson, dominance, equitability, jost, jost1, reads, robbins, simpson, shannon_2, shannon_10}
}
}
\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")
}
\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: \url{https://doi.org/10.1038/s41587-019-0104-4}
}
\seealso{
alpha_rare alpha_boxplot
}
\author{
Contact: Tao Wen \email{2018203048@njau.edu.cn}, Yong-Xin Liu \email{yxliu@genetics.ac.cn}
}
