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

Augments a peptide-cross-link fragment spectrum with NuXL-specific ions that TheoreticalSpectrumGenerator does not produce. More...

#include <OpenMS/ANALYSIS/NUXL/NuXLFragmentIonGenerator.h>

Collaboration diagram for NuXLFragmentIonGenerator:
[legend]

Static Public Member Functions

static void addMS2MarkerIons (const std::vector< NuXLFragmentAdductDefinition > &marker_ions, PeakSpectrum &spectrum, PeakSpectrum::IntegerDataArray &spectrum_charge, PeakSpectrum::StringDataArray &spectrum_annotation)
 Append singly-charged RNA marker ions (protonated nitrogenous bases and their loss variants) to spectrum.
 
static void addShiftedImmoniumIons (const std::string &unmodified_sequence, const std::string &fragment_shift_name, const double fragment_shift_mass, PeakSpectrum &partial_loss_spectrum, PeakSpectrum::IntegerDataArray &partial_loss_spectrum_charge, PeakSpectrum::StringDataArray &partial_loss_spectrum_annotation)
 Append shifted residue-specific immonium ions to partial_loss_spectrum for amino acids found in unmodified_sequence.
 
static void generatePartialLossSpectrum (const std::string &unmodified_sequence, const double &fixed_and_variable_modified_peptide_weight, const std::string &precursor_rna_adduct, const double &precursor_rna_mass, const int &precursor_charge, const std::vector< NuXLFragmentAdductDefinition > &partial_loss_modification, const PeakSpectrum &patial_loss_template_z1, const PeakSpectrum &patial_loss_template_z2, const PeakSpectrum &patial_loss_template_z3, PeakSpectrum &partial_loss_spectrum)
 Compose a full partial-loss fragment spectrum for one peptide / NA-adduct pair.
 
static void addPrecursorWithCompleteRNA_ (const double fixed_and_variable_modified_peptide_weight, const std::string &precursor_rna_adduct, const double precursor_rna_mass, const int charge, PeakSpectrum &partial_loss_spectrum, MSSpectrum::IntegerDataArray &partial_loss_spectrum_charge, MSSpectrum::StringDataArray &partial_loss_spectrum_annotation)
 Append the [M+nH+complete-RNA] precursor peak to partial_loss_spectrum for the requested charge.
 
static void addSpecialLysImmonumIons (const std::string &unmodified_sequence, PeakSpectrum &spectrum, PeakSpectrum::IntegerDataArray &spectrum_charge, PeakSpectrum::StringDataArray &spectrum_annotation)
 Append two non-classical Lys-related immonium ions (iK(C5H10N1) and iK(C6H13N2O)) when unmodified_sequence contains K.
 

Static Public Attributes

static constexpr const char * ANNOTATIONS_MARKER_ION_PREFIX = "MI:"
 Annotation prefix used for marker ions appended by addMS2MarkerIons (e.g. "MI:U-H2O").
 

Detailed Description

Augments a peptide-cross-link fragment spectrum with NuXL-specific ions that TheoreticalSpectrumGenerator does not produce.

All entry points are static and append to caller-provided PeakSpectrum + parallel IntegerDataArray (charge) + StringDataArray (annotation) arrays. Every appended peak has intensity 1.0f and charge 1 unless a method documents otherwise. None of the methods sort the output — call sortByPosition afterwards if order matters (the composite generatePartialLossSpectrum entry point does this on the final result).

Ion kinds covered:

  • RNA marker ions (protonated nitrogenous base and its loss variants, e.g. U-H2O).
  • Shifted residue-specific immonium ions (Y, W, F, H, C, P, L/I, K, M) carrying a configurable mass shift.
  • Non-classical Lys-related immonium variants (iK(C5H10N1), iK(C6H13N2O)) that empirically appear alongside the classical K immonium.
  • Precursor peaks of the peptide + complete-RNA adduct for every charge <= the precursor charge (used mainly for ETD-type spectra).

Member Function Documentation

◆ addMS2MarkerIons()

static void addMS2MarkerIons ( const std::vector< NuXLFragmentAdductDefinition > &  marker_ions,
PeakSpectrum spectrum,
PeakSpectrum::IntegerDataArray spectrum_charge,
PeakSpectrum::StringDataArray spectrum_annotation 
)
static

Append singly-charged RNA marker ions (protonated nitrogenous bases and their loss variants) to spectrum.

For each entry in marker_ions, appends one peak at m.mass + PROTON_MASS_U with intensity 1.0f, charge 1, and annotation ANNOTATIONS_MARKER_ION_PREFIX + m.name (e.g. "MI:U-H2O"). Peaks are appended unconditionally — no collision check against existing entries.

Parameters
[in]marker_ionsMarker-ion definitions (name + monoisotopic mass).
[in,out]spectrumSpectrum to extend; new peaks are appended.
[in,out]spectrum_chargeParallel charge array; one 1 appended per marker ion.
[in,out]spectrum_annotationParallel annotation array; one prefixed name appended per marker ion.

◆ addPrecursorWithCompleteRNA_()

static void addPrecursorWithCompleteRNA_ ( const double  fixed_and_variable_modified_peptide_weight,
const std::string &  precursor_rna_adduct,
const double  precursor_rna_mass,
const int  charge,
PeakSpectrum partial_loss_spectrum,
MSSpectrum::IntegerDataArray partial_loss_spectrum_charge,
MSSpectrum::StringDataArray partial_loss_spectrum_annotation 
)
static

Append the [M+nH+complete-RNA] precursor peak to partial_loss_spectrum for the requested charge.

Computes the m/z as (peptide_weight + precursor_rna_mass + charge * PROTON_MASS_U) / charge and appends one peak only when no existing entry is within 1e-4 m/z (collision check via findNearest). Annotation format:

  • "[M+H+{adduct}]" for charge 1,
  • "[M+nH+{adduct}]" with n explicit for charge >= 2, where {adduct} stands in for precursor_rna_adduct. Intensity 1.0f; the charge data array receives the actual charge value (not always 1).
Parameters
[in]fixed_and_variable_modified_peptide_weightMass of the modified peptide.
[in]precursor_rna_adductAdduct label embedded in the annotation.
[in]precursor_rna_massMonoisotopic mass of the complete RNA adduct.
[in]chargeCharge state to emit.
[in,out]partial_loss_spectrumSpectrum to extend.
[in,out]partial_loss_spectrum_chargeParallel charge array.
[in,out]partial_loss_spectrum_annotationParallel annotation array.

◆ addShiftedImmoniumIons()

static void addShiftedImmoniumIons ( const std::string &  unmodified_sequence,
const std::string &  fragment_shift_name,
const double  fragment_shift_mass,
PeakSpectrum partial_loss_spectrum,
PeakSpectrum::IntegerDataArray partial_loss_spectrum_charge,
PeakSpectrum::StringDataArray partial_loss_spectrum_annotation 
)
static

Append shifted residue-specific immonium ions to partial_loss_spectrum for amino acids found in unmodified_sequence.

For every supported residue present in unmodified_sequence, appends an immonium ion at the residue's nominal immonium m/z plus fragment_shift_mass. Residues covered: Y, W, F, H, C, P, L (matches I as well), K, and M. K additionally emits two non-classical variants (iK(C5H10N1) and iK(C6H13N2O)). M additionally emits a methionine-related CH5S fragment.

All appended peaks have charge 1 and intensity 1.0f. Annotations are formatted by NuXLFragmentAnnotationHelper::getAnnotatedImmoniumIon for the standard immoniums and as "iK(C5H10N1){shift}" / "iK(C6H13N2O){shift}" for the K variants (with {shift} standing in for the fragment_shift_name suffix). No collision check against existing entries.

Parameters
[in]unmodified_sequencePeptide sequence (one-letter codes); only residues present in this string contribute peaks.
[in]fragment_shift_nameAnnotation suffix (e.g. "U-H2O") appended to the K variants and used by NuXLFragmentAnnotationHelper.
[in]fragment_shift_massMass shift added to every appended immonium m/z.
[in,out]partial_loss_spectrumSpectrum to extend.
[in,out]partial_loss_spectrum_chargeParallel charge array.
[in,out]partial_loss_spectrum_annotationParallel annotation array.

◆ addSpecialLysImmonumIons()

static void addSpecialLysImmonumIons ( const std::string &  unmodified_sequence,
PeakSpectrum spectrum,
PeakSpectrum::IntegerDataArray spectrum_charge,
PeakSpectrum::StringDataArray spectrum_annotation 
)
static

Append two non-classical Lys-related immonium ions (iK(C5H10N1) and iK(C6H13N2O)) when unmodified_sequence contains K.

No-op when unmodified_sequence has no K. For each variant, the peak is appended only when no existing entry is within 1e-4 m/z (collision check). Both peaks have charge 1 and intensity 1.0f. Unlike addShiftedImmoniumIons, these are not mass-shifted — they capture variants observed empirically alongside the classical K immonium.

Parameters
[in]unmodified_sequencePeptide sequence; only K-containing sequences contribute peaks.
[in,out]spectrumSpectrum to extend.
[in,out]spectrum_chargeParallel charge array.
[in,out]spectrum_annotationParallel annotation array.

◆ generatePartialLossSpectrum()

static void generatePartialLossSpectrum ( const std::string &  unmodified_sequence,
const double &  fixed_and_variable_modified_peptide_weight,
const std::string &  precursor_rna_adduct,
const double &  precursor_rna_mass,
const int &  precursor_charge,
const std::vector< NuXLFragmentAdductDefinition > &  partial_loss_modification,
const PeakSpectrum patial_loss_template_z1,
const PeakSpectrum patial_loss_template_z2,
const PeakSpectrum patial_loss_template_z3,
PeakSpectrum partial_loss_spectrum 
)
static

Compose a full partial-loss fragment spectrum for one peptide / NA-adduct pair.

For each partial_loss_modification entry f:

  1. Calls addShiftedImmoniumIons (charge-1 immonium series for f.mass).
  2. For each charge z in [1, min(precursor_charge, 3)], copies peaks from the charge-specific patial_loss_template_z{1,2,3} into the output and shifts their m/z by f.mass / z. For z == 2 and z == 3 the template is filtered down to peaks whose template-charge annotation matches z (lower-charge peaks already present in the higher-charge templates are skipped).
  3. Charges >= 4 are not emitted (the loop breaks).
  4. Appends " " + f.name to each shifted-peak annotation.

After the per-modification loop, calls addPrecursorWithCompleteRNA_ for every charge in [1, precursor_charge] (mainly for ETD-type spectra). Finally, partial_loss_spectrum is sorted by m/z via sortByPosition.

The output spectrum's IntegerDataArrays and StringDataArrays are resized to one array each on entry.

Parameters
[in]unmodified_sequencePeptide sequence used for immonium-ion generation.
[in]fixed_and_variable_modified_peptide_weightMass of the peptide carrying the fixed and variable modifications (used to compute the precursor-with-complete-RNA m/z).
[in]precursor_rna_adductString label of the complete RNA adduct (placed inside the "[M+nH+...]" precursor annotation).
[in]precursor_rna_massMonoisotopic mass of the complete RNA adduct.
[in]precursor_chargeUpper bound on the emitted fragment / precursor charge states.
[in]partial_loss_modificationDefinitions of MS2 fragment adducts whose shifts the spectrum should reflect.
[in]patial_loss_template_z1Charge-1 template peaks to shift and append.
[in]patial_loss_template_z2Charge-2 template peaks (filtered to charge-2 entries during the shift step).
[in]patial_loss_template_z3Charge-3 template peaks (filtered to charge-3 entries during the shift step).
[out]partial_loss_spectrumReceives the composed spectrum (data arrays resized to one each).

Member Data Documentation

◆ ANNOTATIONS_MARKER_ION_PREFIX

constexpr const char* ANNOTATIONS_MARKER_ION_PREFIX = "MI:"
staticconstexpr

Annotation prefix used for marker ions appended by addMS2MarkerIons (e.g. "MI:U-H2O").