% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions-XCMSnExp.R
\name{overlappingFeatures}
\alias{overlappingFeatures}
\title{Identify overlapping features}
\usage{
overlappingFeatures(x, expandMz = 0, expandRt = 0, ppm = 0)
}
\arguments{
\item{x}{\code{XCMSnExp} with the features.}

\item{expandMz}{\code{numeric(1)} with the value to expand each feature (on each
side) in m/z dimension before identifying overlapping features.
The resulting \code{"mzmin"} for the feature is thus \code{mzmin - expandMz} and
the \code{"mzmax"} \code{mzmax + expandMz}.}

\item{expandRt}{\code{numeric(1)} with the value to expand each feature (on each
side) in retention time dimension before identifying overlapping
features. The resulting \code{"rtmin"} for the
feature is thus \code{rtmin - expandRt} and the \code{"rtmax"} \code{rtmax + expandRt}.}

\item{ppm}{\code{numeric(1)} to grow the m/z width of the feature by a relative
value: \code{mzmin - mzmin * ppm / 2e6}, \code{mzmax + mzmax * ppm / 2e6}. Each
feature is thus expanded in m/z dimension by ppm/2 on each side before
identifying overlapping features.}
}
\value{
\code{list} with indices of features (in \code{\link[=featureDefinitions]{featureDefinitions()}}) that
are overlapping.
}
\description{
\code{overlappingFeatures} identifies features that are overlapping or close in
the m/z - rt space.
}
\examples{
## Load 2 test files.
data <- readMSData(c(system.file("cdf/KO/ko15.CDF", package = "faahKO"),
                     system.file("cdf/KO/ko16.CDF", package = "faahKO")),
                   mode = "onDisk")

## Perform peak detection; parameters set to reduce processing speed
data <- findChromPeaks(data, CentWaveParam(noise = 10000, snthresh = 40))

## Correspondence analysis
data <- groupChromPeaks(data, param = PeakDensityParam(sampleGroups = c(1, 1)))

## Identify overlapping features
overlappingFeatures(data)

## Identify features that are separated on retention time by less than
## 2 minutes
overlappingFeatures(data, expandRt = 60)
}
\author{
Johannes Rainer
}
