% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rarefy_rrna.R
\name{rarefy_rrna}
\alias{rarefy_rrna}
\alias{rarefy_rrna.matrix}
\alias{rarefy_rrna.phyloseq}
\title{Rarefy and normalize based on 16S rRNA copy numbers}
\usage{
rarefy_rrna(
  x,
  reads,
  copy.database = "v13.5",
  seed = NULL,
  trim = FALSE,
  replace = FALSE
)

rarefy_rrna.matrix(x, reads, copy.database, seed = NULL, trim, replace)

rarefy_rrna.phyloseq(x, reads, copy.database, seed = NULL, trim, replace)
}
\arguments{
\item{x}{A phyloseq object OR an OTU-table with taxa as columns and OTU names as colnames. OTUs should be picked against the Greengenes v13.5 database, unless another copy number database is provided.}

\item{reads}{Number of reads to sample.}

\item{copy.database}{What Greengenes database version was used to find OTUs. Atm only "v13.5" is available. Alternatively, A dataframe with two variables: "ID" is the OTU id matched by names in x and "Copy" is the copy number.}

\item{seed}{Random seed for sampling.}

\item{trim}{Should samples with less than the set amount of reads be trimmed away?}

\item{replace}{Should reads be sampled with replacement? Default FALSE. If FALSE, rRNA copy numbers will have small effect if the rarefied depth is close to the actual depth. If TRUE, some taxa can end up with more reads in the rarefied matrix that they had in the input.}
}
\value{
A rarefied otu-table
}
\description{
Rarefy an OTU-table with the probability of the inverse 16S rRNA copy numbers: The result is a normalized AND copy number corrected OTU-table.
}
\keyword{normalize}
\keyword{rarefy}
\keyword{rrna}
