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

Post-scoring step of the OpenNuXL pipeline: annotates fragment-ion peaks of each candidate hit and localises the NA cross-link to a residue. More...

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

Static Public Member Functions

static void annotateAndLocate_ (const PeakMap &exp, std::vector< std::vector< NuXLAnnotatedHit > > &annotated_hits, const NuXLModificationMassesResult &mm, const ModifiedPeptideGenerator::MapToResidueType &fixed_modifications, const ModifiedPeptideGenerator::MapToResidueType &variable_modifications, Size max_variable_mods_per_peptide, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const NuXLParameterParsing::PrecursorsToMS2Adducts &all_feasible_adducts)
 Annotate every candidate hit in annotated_hits and localise the NA cross-link site.
 

Detailed Description

Post-scoring step of the OpenNuXL pipeline: annotates fragment-ion peaks of each candidate hit and localises the NA cross-link to a residue.

Consumes the per-scan vectors of NuXLAnnotatedHit produced upstream by the OpenNuXL search, reconstructs each hit's fully-modified peptide sequence, generates the theoretical fragment spectrum (b/a/y ions plus precursor + immonium variants), aligns it against the experimental spectrum, and writes the alignment results plus a per-residue localisation score back into the hit. Single-purpose helper class — only the static annotateAndLocate_ entry point is exposed.

Member Function Documentation

◆ annotateAndLocate_()

static void annotateAndLocate_ ( const PeakMap exp,
std::vector< std::vector< NuXLAnnotatedHit > > &  annotated_hits,
const NuXLModificationMassesResult mm,
const ModifiedPeptideGenerator::MapToResidueType fixed_modifications,
const ModifiedPeptideGenerator::MapToResidueType variable_modifications,
Size  max_variable_mods_per_peptide,
double  fragment_mass_tolerance,
bool  fragment_mass_tolerance_unit_ppm,
const NuXLParameterParsing::PrecursorsToMS2Adducts all_feasible_adducts 
)
static

Annotate every candidate hit in annotated_hits and localise the NA cross-link site.

Iterates over annotated_hits in parallel (OpenMP parallel for over the scan dimension). For each non-empty annotated_hits[scan_index]:

  1. Reads the experimental PeakSpectrum and its first precursor charge from exp[scan_index].
  2. For each candidate hit a:
    • Rebuilds a.sequence's fully-modified form by reapplying ModifiedPeptideGenerator::applyFixedModifications and ModifiedPeptideGenerator::applyVariableModifications (the upstream search only stored modification indices to save memory) and selects the entry at a.peptide_mod_index.
    • Picks the precursor NA adduct from mm via a.NA_mod_index (using the first entry of the composition set at that key).
    • Generates a total-loss theoretical spectrum (b/a/y + precursor + manually added abundant immoniums for charge 1 and precursor peaks for every charge) via TheoreticalSpectrumGenerator with hardcoded settings (add_first_prefix_ion, add_metainfo, add_a_ions, add_b_ions, add_y_ions enabled; add_c_ions, add_x_ions, add_z_ions, add_internal_fragments, add_abundant_immonium_ions, add_all_precursor_charges disabled — the latter two are added manually).
    • Aligns the theoretical and experimental spectra under fragment_mass_tolerance (in ppm when fragment_mass_tolerance_unit_ppm is true, else Da), with charge matching enforced.
    • Annotates the matched peaks as b/a/y ions, immoniums, marker ions and precursor variants (the immoniums / precursors are added by the NuXL fragment generator using the per-adduct definitions in all_feasible_adducts).
    • Computes per-residue site scores from the aligned shifted-ion evidence, lowercases every residue that ties for the maximum score in the resulting best_localization string, and stores the last-tied position in best_localization_position (the cpp's "Note: check if there are situations where multiple have the same score" caveat applies — ties resolve to the last index, not the first).
    • Writes localization_scores (comma-separated "0..100" percentages), best_localization, best_localization_score, and best_localization_position back into the hit.

All output goes into annotated_hits — no exceptions are thrown by this function; malformed alignments emit OPENMS_LOG_WARN. Hits whose first precursor adduct cannot be resolved fall back to an unmodified-sequence localisation (best_localization == unmodified_sequence, best_localization_score = 0).

The trailing underscore on the method name is a historical artefact from the OpenNuXL feature branch; the entry point is still public.

Parameters
[in]expMS2 experiment whose spectra are aligned against the theoretical spectra of the candidate hits.
[in,out]annotated_hitsPer-scan vectors of candidate hits to annotate and localise in place.
[in]mmPrecursor-adduct mass table (see NuXLModificationsGenerator::initModificationMassesNA); indexed by NuXLAnnotatedHit::NA_mod_index.
[in]fixed_modificationsCached fixed-modification table consumed by ModifiedPeptideGenerator.
[in]variable_modificationsCached variable-modification table consumed by ModifiedPeptideGenerator.
[in]max_variable_mods_per_peptideCap on the number of variable modifications placed per peptide.
[in]fragment_mass_toleranceHalf-width of the fragment-alignment tolerance window.
[in]fragment_mass_tolerance_unit_ppmInterpret fragment_mass_tolerance as ppm (true) or Da (false).
[in]all_feasible_adductsPer-precursor-adduct fragment-adduct definitions used to generate marker and shifted immonium ions.