% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Diversity_16S.R
\name{Diversity_16S}
\alias{Diversity_16S}
\title{Diversity function for 16S amplicon data}
\usage{
Diversity_16S(
  x,
  R = 999,
  brea = TRUE,
  thresh = 200,
  parallel = FALSE,
  ncores = 2
)
}
\arguments{
\item{x}{phyloseq object generated by the phyloseq package}

\item{R}{Number of bootstraps to conduct. Defaults to 999}

\item{brea}{TRUE/FALSE if breakaway method for D0 estimation should be used.
Defaults to TRUE. This method fails easily if you don't have atleast 6 contiguous
frequencies.}

\item{thresh}{Minimum sample size required to perform Chao1 estimation.}

\item{parallel}{Should the calculation be parallelized? Defaults to FALSE}

\item{ncores}{How many cores should be used in case of parallel computation?
Defaults to 2.}
}
\description{
This function calculates Hill diversity metrics from 16S amplicon data (in phyloseq format).
D0 (richness) is calculated with three methods: 1) Observed richness, 2) Chao1 estimator
3) breakaway method (Willis and Bunge 2016). D1 (exponential of Shannon entropy)
and D2 (inverse Simpson index) are respectively Hill order 1 and 2.
Errors for D1 and D2 are calculated by bootstrapping.
}
\examples{
# First install phyloseq if you haven't yet
if(requireNamespace("phyloseq",quietly=TRUE)){
library(phyloseq)
} else {
source("https://bioconductor.org/biocLite.R")
biocLite("phyloseq")
library(phyloseq)
}
# Load data (V3-V4 amplicon data from doi: 10.1111/2041-210X.12607)
data(physeq_test)
# Opting for three bootstraps, because this can take some time.
Diversity_16S(phyloseq::prune_samples(phyloseq::sample_names(physeq_test) == "1", physeq_test), R=3)
}
\keyword{alpha}
\keyword{diversity,}
\keyword{fcm,}
