OpenMS
OPXLSpectrumProcessingAlgorithms Class Reference

#include <OpenMS/ANALYSIS/XLMS/OPXLSpectrumProcessingAlgorithms.h>

Static Public Member Functions

static PeakSpectrum mergeAnnotatedSpectra (PeakSpectrum &first_spectrum, PeakSpectrum &second_spectrum)
 Merges two spectra into one while correctly considering metainfo in DataArrays. More...
 
static PeakMap preprocessSpectra (PeakMap &exp, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, Size peptide_min_size, Int min_precursor_charge, Int max_precursor_charge, bool deisotope, bool labeled)
 Preprocesses spectra. More...
 
static void getSpectrumAlignmentFastCharge (std::vector< std::pair< Size, Size > > &alignment, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum &theo_spectrum, const PeakSpectrum &exp_spectrum, const DataArrays::IntegerDataArray &theo_charges, const DataArrays::IntegerDataArray &exp_charges, DataArrays::FloatDataArray &ppm_error_array, double intensity_cutoff=0.0)
 Computes a spectrum alignment while considering fragment charges stored in a IntegerDataArray and a cut-off for the intensity difference ratio. More...
 
static void getSpectrumAlignmentSimple (std::vector< std::pair< Size, Size > > &alignment, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const std::vector< SimpleTSGXLMS::SimplePeak > &theo_spectrum, const PeakSpectrum &exp_spectrum, const DataArrays::IntegerDataArray &exp_charges)
 Computes a spectrum alignment while considering fragment charges. Uses TSGXLMS::SimplePeak for the theoretical spectrum and its charges. Does not consider intensities. More...
 

Member Function Documentation

◆ getSpectrumAlignmentFastCharge()

static void getSpectrumAlignmentFastCharge ( std::vector< std::pair< Size, Size > > &  alignment,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
const PeakSpectrum theo_spectrum,
const PeakSpectrum exp_spectrum,
const DataArrays::IntegerDataArray theo_charges,
const DataArrays::IntegerDataArray exp_charges,
DataArrays::FloatDataArray ppm_error_array,
double  intensity_cutoff = 0.0 
)
static

Computes a spectrum alignment while considering fragment charges stored in a IntegerDataArray and a cut-off for the intensity difference ratio.

Parameters
alignmentThe empty alignment, that will be filled by the algorithm
fragment_mass_toleranceThe peak mass tolerance
fragment_mass_tolerance_unit_ppmTrue if the given tolerance is a ppm tolerance, false if tolerance is in Da
theo_spectrumThe first spectrum to be aligned (preferably the theoretical one)
exp_spectrumthe second spectrum to be aligned (preferably the experimental one)
theo_chargesIntegerDataArray with charges for the theo_spectrum
exp_chargesIntegerDataArray with charges for the exp_spectrum
ppm_error_arrayempty FloatDataArray to be filled with per peak ppm errors
intensity_cutoffPeaks will only be aligned if intensity1 / intensity2 > intensity_cutoff, with intensity1 being the lower of the two compared peaks and intensity2 the higher one. Set to 0 to ignore intensity differences.

◆ getSpectrumAlignmentSimple()

static void getSpectrumAlignmentSimple ( std::vector< std::pair< Size, Size > > &  alignment,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
const std::vector< SimpleTSGXLMS::SimplePeak > &  theo_spectrum,
const PeakSpectrum exp_spectrum,
const DataArrays::IntegerDataArray exp_charges 
)
static

Computes a spectrum alignment while considering fragment charges. Uses TSGXLMS::SimplePeak for the theoretical spectrum and its charges. Does not consider intensities.

Parameters
alignmentThe empty alignment, that will be filled by the algorithm
fragment_mass_toleranceThe peak mass tolerance
fragment_mass_tolerance_unit_ppmTrue if the given tolerance is a ppm tolerance, false if tolerance is in Da
theo_spectrumThe first spectrum to be aligned (preferably the theoretical one)
exp_spectrumthe second spectrum to be aligned (preferably the experimental one)
exp_chargesIntegerDataArray with charges for the exp_spectrum

◆ mergeAnnotatedSpectra()

static PeakSpectrum mergeAnnotatedSpectra ( PeakSpectrum first_spectrum,
PeakSpectrum second_spectrum 
)
static

Merges two spectra into one while correctly considering metainfo in DataArrays.

Parameters
first_spectrum
second_spectrum
Returns
A PeakSpectrum containing all peaks from both input spectra

◆ preprocessSpectra()

static PeakMap preprocessSpectra ( PeakMap exp,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
Size  peptide_min_size,
Int  min_precursor_charge,
Int  max_precursor_charge,
bool  deisotope,
bool  labeled 
)
static

Preprocesses spectra.

Filters out spectra with too few peaks (based on peptide_min_size) and those that do not fit into the precursor charge range. Removes zero intensity peaks and normalizes intensities from all spectra in exp. MS2 spectra are reduced in peak count using a WindowMower, if labeled is false. The number of returned spectra (MS2 only) is equal to the number of input MS2 spectra for labeled data (otherwise not necessarily).

Parameters
expInput data, which contains MS1 and MS2 spectra. Will be modified.
fragment_mass_toleranceFor deisotoping (used only if deisotope is true)
fragment_mass_tolerance_unit_ppmFor deisotoping (used only if deisotope is true)
peptide_min_sizeMinimum length of a peptide (used to filter spectra with few peaks)
min_precursor_chargeMS2 spectra's minimal PC charge (ignored if labeled is true)
max_precursor_chargeMS2 spectra's maximal PC charge (ignored if labeled is true)
deisotopeDeisotope MS2 spectra?
labeledIs the data labeled? (i.e. keep all MS2 spectra irrespective of precursor)
Returns
A PeakMap of preprocessed spectra (MS2 spectra only)