% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lcmsPlot-class.R
\name{lp_isolation_window}
\alias{lp_isolation_window}
\title{Visualise the isolation window for a precursor fragmentation event}
\usage{
lp_isolation_window(
  pid = NULL,
  sample_id = NULL,
  half_width = 0.5,
  zoom_factor = 3
)
}
\arguments{
\item{pid}{An integer or integer vector of precursor IDs (the \code{pid} column in
\code{purityA@puritydf}) selecting which event(s) to display. \code{NULL} shows all
events (use with care on large datasets).}

\item{sample_id}{A \code{character} sample ID to filter by when \code{pid} is \code{NULL}.}

\item{half_width}{A \code{numeric} value (in Da) for the isolation window
half-width on each side of the precursor m/z. Default is \code{0.5}.}

\item{zoom_factor}{A \code{numeric} multiplier controlling how far beyond the
isolation window the x-axis extends. The visible range is
\verb{precursor_mz ± zoom_factor * half_width}. Default is \code{3}.}
}
\value{
A layer function for use with the \code{+} operator.
}
\description{
\code{lp_isolation_window()} extracts the MS1 survey spectrum at the scan
immediately preceding a chosen MS2 event from a \code{purityA} object and
annotates it with a semi-transparent rectangle spanning the isolation window
and a dashed line at the precursor m/z. The \code{inPurity} score is shown as a
plot subtitle.
}
