Files
ROBITools/man/contaslayer.Rd

45 lines
1.2 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/contaslayer.R
\name{contaslayer}
\alias{contaslayer}
\title{Detects contaminants in metabarcoding data}
\usage{
contaslayer(x, controls, clust = NULL)
}
\arguments{
\item{x}{a \code{\link{metabarcoding.data}} object}
\item{controls}{a vector of samples names where conta are suspected to be detected
(typically negative control names).}
\item{clust}{a vector for grouping sequences. Default set to \code{NULL}.}
}
\value{
a vector containing the names of sequences identified as contaminants
}
\description{
Detects sequences/motus in a \code{\link{metabarcoding.data}} object
for which frequencies over the entire dataset are maximum in negative controls and
hence, most likely to be contaminants.
}
\examples{
data(termes)
termes.ok = termes[,colSums(termes$reads)>0]
neg = rownames(termes.ok)[grep("r",rownames(termes.ok))]
#finds contaminants based on neg samples
contaslayer(termes.ok, neg)
# extanding contamininant detection with grouping factor,
# typically obiclean/sumatra cluster or taxonomy membership
contaslayer(termes.ok, neg, termes.ok$motus$scientific_name)
}
\seealso{
\code{\link{threshold}} for further trimming
}
\author{
Lucie Zinger
}