contaslayer.Rd 1.22 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
% 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
}