% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/requantify-functions.R
\docType{methods}
\name{requantify,MSnSet-method}
\alias{requantify,MSnSet-method}
\alias{requantify}
\title{Intensity requantification}
\usage{
\S4method{requantify}{MSnSet}(object, saturationThreshold,
method=c("sum", "reference", "th.mean", "th.median",
"th.weighted.mean"), \ldots)
}
\arguments{
\item{object}{An \code{\linkS4class{MSnSet}} object.}

\item{saturationThreshold}{\code{double}, intensity of an ion (isotope of a
given charge state) at which saturation is starting to occur.}

\item{method}{\code{character}, requantification method, please see details
section.}

\item{\ldots}{further arguments passed to internal functions. Currently
\code{onlyCommonIsotopes} for \code{method="sum"} and \code{requantifyAll}
for \code{method=c("th.mean", "th.median", "th.weighted.mean")} are supported.}
}
\value{
\code{\linkS4class{MSnSet}} where the
\code{assayData} are requantified.
}
\description{
This method tries to remove saturation effects from the intensity counts.
}
\details{
Currently \code{requantify} supports 3 (5) different requantification
methods. \cr

\code{"sum"} is the simplest requantification method. All ions of a
peptide below the saturation threshold are summed to get the new intensity.
This method accept an additional argument, namely \code{onlyCommonIsotopes}
If \code{onlyCommonIsotopes=TRUE} (default) all ions that are not seen in
all runs are removed and only the common seen ions are summed. In contrast
\code{onlyCommonIsotopes=FALSE} sums all ions regardless they are present
in all runs. \cr

In \code{"reference"} the run that has the most unsaturated ions in common
with all the other runs. If there are more than one run, the most intense is
used as reference. The other runs are corrected as
follows:
\itemize{
 \item{Find common ions between current and the reference run.}
 \item{Divide the intensities of the common ions and calculate the mean of
 these quotients as a run specific scaling factor.}
 \item{Multiply the unsaturated ions of the current run by the scaling
 factor and replace the saturated ones by the product of the scaling
 factor and the intensities of their corresponding ions in the reference
 run.}
 \item{Sum the rescaled ion intensities.}
}

The \code{"th.*"} methods are nearly identical. All of them calculate the
theoretical isotopic distribution for the given sequence of the peptide.
Subsequently the unsaturated ions are divided by their theoretical
proportion and the \code{mean}/\code{median}/\code{weighted.mean}
(proportions are used as weights) of these intensities are calculated per
charge state. The sum of the charge state values is used as requantified
intensity for this peptide. \cr
If \code{requantifyAll=FALSE} (default) just peptides with at least one
saturated ion are requantified (unsaturated peptides are unaffected). If
\code{requantify=TRUE} all peptides even these where all ions are below
\code{saturationThreshold} are requantified by their theoretical
distribution.
}
\references{
See discussion on github: \url{https://github.com/lgatto/synapter/issues/39}
}
\seealso{
MSnSet documentation: \code{\linkS4class{MSnSet}}
}
\author{
Sebastian Gibb \email{mail@sebastiangibb.de} and Pavel Shliaha
}
