OpenMS
Loading...
Searching...
No Matches
CoIsolationDetector Class Reference

Finds precursors co-isolated with the selected one in the isolation window of an MS2 spectrum. More...

#include <OpenMS/ANALYSIS/ID/CoIsolationDetector.h>

Classes

struct  CoIsolated
 a co-isolated precursor More...
 

Static Public Member Functions

static double isotopeKL (const MSSpectrum &ms1, double mono_mz, int charge, double tol_da, Size n_isotopes=4)
 Divergence of the isotope envelope at mono_mz from averagine.
 
static std::vector< CoIsolated > detect (const MSSpectrum &ms1, double window_lower, double window_upper, double selected_mz, int min_charge, int max_charge, double tol_da, double max_kl, Size max_n)
 Co-isolated precursors in the isolation window [window_lower, window_upper] of ms1.
 
static Size annotate (PeakMap &exp, int min_charge, int max_charge, double tolerance, bool tolerance_ppm, double max_kl, Size max_n)
 Annotate each MS2 spectrum of exp with the precursors co-isolated with its first precursor.
 

Static Public Attributes

static const std::string META_MZ
 meta value of an MS2 spectrum: the monoisotopic m/z of its co-isolated precursors (DoubleList, see annotate())
 
static const std::string META_CHARGE
 meta value of an MS2 spectrum: the charges of its co-isolated precursors (IntList, same order as META_MZ)
 

Detailed Description

Finds precursors co-isolated with the selected one in the isolation window of an MS2 spectrum.

A chimeric MS2 spectrum holds the fragments of more than one precursor: those that fell into the isolation window next to the selected one. detect() looks for them in the survey (MS1) scan: each peak in the window, most intense first, is taken as a monoisotopic peak at each charge, and accepted if the isotope envelope found there fits an averagine envelope (Kullback-Leibler divergence of the observed from the averagine envelope at most max_kl). The selected precursor and its isotope peaks, and the isotope peaks of an envelope already accepted, are skipped. Since above about 1.8 kDa the M+1 peak is the most intense, an accepted envelope is moved down by one isotope step (up to three times) while there is a peak and the envelope from it fits averagine better.

Ported from bigbio/andes (chimeric cascade, #118, #136).


Class Documentation

◆ OpenMS::CoIsolationDetector::CoIsolated

struct OpenMS::CoIsolationDetector::CoIsolated

a co-isolated precursor

Class Members
int charge = 0 charge
double kl = 0.0 divergence of its isotope envelope from averagine
double mono_mz = 0.0 m/z of the monoisotopic peak

Member Function Documentation

◆ annotate()

static Size annotate ( PeakMap &  exp,
int  min_charge,
int  max_charge,
double  tolerance,
bool  tolerance_ppm,
double  max_kl,
Size  max_n 
)
static

Annotate each MS2 spectrum of exp with the precursors co-isolated with its first precursor.

The survey scan is MSExperiment::getPrecursorSpectrum(); the isolation window is centred on the "isolation window target m/z" of the precursor (its m/z if absent) and spans its isolation window offsets. Spectra without a survey scan or an isolation window are left out. Writes the meta values META_MZ and META_CHARGE (also when nothing was found, as empty lists). Sorts the survey scans by m/z if they are not.

Parameters
expExperiment whose MS2 spectra are annotated (survey scans may be sorted by m/z)
min_chargeLowest charge tried
max_chargeHighest charge tried
tolerancem/z tolerance for the isotope peaks
tolerance_ppmWhether tolerance is in ppm of the selected precursor's m/z (else Th)
max_klLargest accepted divergence from averagine
max_nAt most this many precursors per spectrum (most intense monoisotopic peaks first)
Returns
Number of co-isolated precursors found

◆ detect()

static std::vector< CoIsolated > detect ( const MSSpectrum &  ms1,
double  window_lower,
double  window_upper,
double  selected_mz,
int  min_charge,
int  max_charge,
double  tol_da,
double  max_kl,
Size  max_n 
)
static

Co-isolated precursors in the isolation window [window_lower, window_upper] of ms1.

Parameters
ms1Survey scan, sorted by m/z
window_lowerLower end of the isolation window (m/z)
window_upperUpper end of the isolation window (m/z)
selected_mzm/z of the selected precursor (it and its isotope peaks are skipped)
min_chargeLowest charge tried
max_chargeHighest charge tried
tol_dam/z tolerance (Th) for the isotope peaks
max_klLargest accepted divergence from averagine
max_nAt most this many precursors (most intense monoisotopic peaks first); 0 finds none

◆ isotopeKL()

static double isotopeKL ( const MSSpectrum &  ms1,
double  mono_mz,
int  charge,
double  tol_da,
Size  n_isotopes = 4 
)
static

Divergence of the isotope envelope at mono_mz from averagine.

The observed envelope is the most intense peak within tol_da of each of the first n_isotopes isotope positions (0 if none), scaled to sum 1. Returns sum_k o_k ln(o_k / a_k) over the isotopes with o_k > 0, with a the averagine envelope of the same mass (scaled to sum 1); 10 if no isotope position has a peak.

Parameters
ms1Survey scan, sorted by m/z
mono_mzm/z of the monoisotopic peak
chargeCharge of the envelope
tol_dam/z tolerance (Th) for the isotope peaks
n_isotopesNumber of isotope positions compared

Member Data Documentation

◆ META_CHARGE

const std::string META_CHARGE
static

meta value of an MS2 spectrum: the charges of its co-isolated precursors (IntList, same order as META_MZ)

◆ META_MZ

const std::string META_MZ
static

meta value of an MS2 spectrum: the monoisotopic m/z of its co-isolated precursors (DoubleList, see annotate())