56 lines
1.8 KiB
R
56 lines
1.8 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/metabarcoding_threshold.R
|
|
\docType{methods}
|
|
\name{threshold,metabarcoding.data-method}
|
|
\alias{threshold,metabarcoding.data-method}
|
|
\alias{threshold-methods,metabarcoding.data}
|
|
\title{Compute the cumulative threshold of read aboundances.}
|
|
\usage{
|
|
\S4method{threshold}{metabarcoding.data}(data, MARGIN = "sample",
|
|
threshold = 0.97)
|
|
}
|
|
\arguments{
|
|
\item{data}{The \code{\linkS4class{metabarcoding.data}} instance
|
|
on normalisation have to be computed.}
|
|
|
|
\item{MARGIN}{Indicates if the sums have to be computed across
|
|
samples or motus.
|
|
Allowed values are :
|
|
\itemize{
|
|
\item{'sample' or 1} for computing sum across samples
|
|
\item{'motu' or 2} for computing sum across motus
|
|
}}
|
|
|
|
\item{threshold}{a numeric value between 0 and 1 indicating which part of
|
|
the signal must be conserved. Default value is setup to
|
|
0.97 (97% of the total signal).}
|
|
}
|
|
\value{
|
|
a numeric vector containing the limit aboundancy to consider for
|
|
each sample or each MOTU according to the value of the \code{MARGIN}
|
|
parameter.
|
|
}
|
|
\description{
|
|
The method \code{threshold} of the class \code{\linkS4class{metabarcoding.data}}
|
|
computes the thresold to be used for conserving just a part of the global
|
|
signal. This thresold is computed by ranking aboundances by decreasing order.
|
|
The cululative sums of these ranked abondencies are computed and the aboundance
|
|
corresponding to the first sum greater than the threshold is returned as result.
|
|
}
|
|
\examples{
|
|
# load termite data set from the ROBITools sample data
|
|
data(termes)
|
|
|
|
# computes threshold value to used for keep 95\% of
|
|
# the reads per MOTU
|
|
|
|
t = threshold(termes,MARGIN='motu',threshold=0.95)
|
|
|
|
}
|
|
\seealso{
|
|
\code{\linkS4class{metabarcoding.data}}, \code{\link{threshold.mask}}
|
|
}
|
|
\author{
|
|
Aurelie Bonin
|
|
}
|