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

Self-trained fragment ion likelihood for protein-nucleic acid cross-links (after ProSE's ion priors). More...

#include <OpenNuXL/include/NuXLIonLikelihood.h>

Classes

struct  Evidence
 Matched ions of a hit and of its noise hypothesis. More...
 
struct  Features
 Features of one hit. More...
 
struct  Outcomes
 Matched ions of one hypothesis (hit or its reversed sequence) More...
 

Public Types

enum  Group : std::uint8_t {
  LINEAR = 0 , XL_UNSHIFTED = 1 , XL_SHIFTED = 2 , XL_UNLOCALIZED = 3 ,
  GROUPS = 4
}
 
using Model = FragmentIonLikelihoodModel
 

Public Member Functions

 NuXLIonLikelihood (double tolerance, bool ppm, int max_fragment_charge=2)
 
void setSpectra (const PeakMap &spectra)
 Compact copies of the spectra the hits refer to (by scan index)
 
Evidence match (Size scan, const AASequence &peptide, int precursor_charge, const std::vector< double > &shifts, int site) const
 Match the ions of a hit and of its reversed sequence.
 
void resetFold (Size fold)
 Clear the models of fold.
 
void addTraining (Size fold, const Evidence &evidence)
 Add a confident hit to the models of fold.
 
void finalize ()
 Finalize the models of both folds.
 
Features score (Size fold, const Outcomes &outcomes) const
 Features of a hit scored by the models of fold.
 

Static Public Member Functions

static AASequence reversedSequence (const AASequence &peptide)
 Reversed sequence of the noise hypothesis (all but the C-terminal residue)
 

Private Member Functions

Outcomes matchHypothesis_ (Size scan, const AASequence &peptide, int precursor_charge, const std::vector< double > &shifts, int site) const
 

Private Attributes

double tolerance_
 
bool ppm_
 
int max_fragment_charge_
 
Model::PeakLists peaks_
 
TheoreticalSpectrumGenerator tsg_
 
std::array< std::array< Model, GROUPS >, 2 > models_
 

Detailed Description

Self-trained fragment ion likelihood for protein-nucleic acid cross-links (after ProSE's ion priors).

Every b and y ion of a hit is matched against its spectrum (closest peak within the fragment tolerance) and gets an outcome: absent, or intensity-rank bin x mass-error bin (see FragmentIonLikelihoodModel, RICH contexts). The ions fall into four groups, each with its own FragmentIonLikelihoodModel:

  • LINEAR: ions of a hit without nucleic acid adduct
  • XL_UNSHIFTED: ions of a localized cross-link that do not contain the cross-linked residue
  • XL_SHIFTED: ions that contain it; they carry one of the fragment adducts of the cross-linked nucleotide, and the best outcome over these adducts counts
  • XL_UNLOCALIZED: ions of a cross-link without localization; the best outcome over no shift and every fragment adduct counts

The noise hypothesis is the hit's sequence reversed except for its C-terminal residue (modifications move with their residues, so does the cross-linked residue), matched with the same shift alternatives against the same spectrum. Models are trained on the confident hits of one half of the spectra and score the other half.


Class Documentation

◆ OpenMS::NuXLIonLikelihood::Evidence

struct OpenMS::NuXLIonLikelihood::Evidence

Matched ions of a hit and of its noise hypothesis.

Class Members
Outcomes noise empty if the reversed sequence equals the sequence
Outcomes signal

◆ OpenMS::NuXLIonLikelihood::Features

struct OpenMS::NuXLIonLikelihood::Features

Features of one hit.

Class Members
double explained_presence = 0.0 sum of P(present) of the matched ions / sum over all ions
double llr = 0.0 summed log-likelihood ratio of all ions
double llr_shifted = 0.0 the part of llr from XL_SHIFTED and XL_UNLOCALIZED ions
double top_predicted_observed = 0.0 fraction of the 6 ions with the highest P(present) that matched

◆ OpenMS::NuXLIonLikelihood::Outcomes

struct OpenMS::NuXLIonLikelihood::Outcomes

Matched ions of one hypothesis (hit or its reversed sequence)

Class Members
vector< uint8_t > groups Group of each ion.
vector< Ion > ions

Member Typedef Documentation

◆ Model

Member Enumeration Documentation

◆ Group

enum Group : std::uint8_t
Enumerator
LINEAR 
XL_UNSHIFTED 
XL_SHIFTED 
XL_UNLOCALIZED 
GROUPS 

Constructor & Destructor Documentation

◆ NuXLIonLikelihood()

NuXLIonLikelihood ( double  tolerance,
bool  ppm,
int  max_fragment_charge = 2 
)
Parameters
tolerancefragment tolerance,
ppmwhether it is in ppm,
max_fragment_chargehighest fragment charge

References DefaultParamHandler::getParameters(), DefaultParamHandler::setParameters(), Param::setValue(), and NuXLIonLikelihood::tsg_.

Member Function Documentation

◆ addTraining()

◆ finalize()

void finalize ( )

Finalize the models of both folds.

References NuXLIonLikelihood::models_.

◆ match()

NuXLIonLikelihood::Evidence match ( Size  scan,
const AASequence &  peptide,
int  precursor_charge,
const std::vector< double > &  shifts,
int  site 
) const

Match the ions of a hit and of its reversed sequence.

Parameters
scanScan index of the hit's spectrum.
peptideThe peptide, with fixed and variable modifications but without nucleic acid adduct.
precursor_chargePrecursor charge of the hit.
shiftsMasses of the fragment adducts of the cross-linked nucleotide; empty for hits without cross-link.
sitePosition of the cross-linked residue, -1 if not localized (ignored without shifts).

References NuXLIonLikelihood::matchHypothesis_(), NuXLIonLikelihood::Evidence::noise, NuXLIonLikelihood::reversedSequence(), NuXLIonLikelihood::Evidence::signal, and AASequence::size().

◆ matchHypothesis_()

◆ resetFold()

void resetFold ( Size  fold)

Clear the models of fold.

References NuXLIonLikelihood::models_.

◆ reversedSequence()

◆ score()

◆ setSpectra()

void setSpectra ( const PeakMap &  spectra)

Member Data Documentation

◆ max_fragment_charge_

int max_fragment_charge_
private

◆ models_

◆ peaks_

◆ ppm_

bool ppm_
private

◆ tolerance_

double tolerance_
private

◆ tsg_