% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/creators-purity.R
\name{create_isolation_window}
\alias{create_isolation_window}
\title{Populate the \code{spectra} slot with an MS1 isolation window spectrum}
\usage{
create_isolation_window(obj, options, pid, sample_id)
}
\arguments{
\item{obj}{An instance of class \code{lcmsPlotDataContainer} whose \code{data_obj}
is a \code{purityA} object.}

\item{options}{A \code{list} of plot options (reads \code{options$isolation_window}).}

\item{pid}{An integer \code{pid} from \code{puritydf} selecting which fragmentation
event(s) to visualise. \code{NULL} selects all events.}

\item{sample_id}{A character sample ID restricting which file to read.
Ignored when \code{pid} is provided. \code{NULL} selects all samples.}
}
\value{
A modified \code{lcmsPlotDataContainer} with \code{spectra} and
\code{feature_metadata} slots populated.
}
\description{
Extracts the MS1 survey scan nearest to a fragmentation event from
\code{purityA@puritydf}, reads the spectrum from the raw file, and stores it
in the \code{spectra} slot. Isolation-window boundaries and the \code{inPurity} score
are stored in \code{feature_metadata} for downstream annotation by
\code{plot_isolation_window()}.
}
\keyword{internal}
