![]() |
OpenMS
|
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_ |
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:
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.
| struct OpenMS::NuXLIonLikelihood::Evidence |
| struct OpenMS::NuXLIonLikelihood::Features |
Features of one hit.
| struct OpenMS::NuXLIonLikelihood::Outcomes |
| using Model = FragmentIonLikelihoodModel |
| enum Group : std::uint8_t |
| NuXLIonLikelihood | ( | double | tolerance, |
| bool | ppm, | ||
| int | max_fragment_charge = 2 |
||
| ) |
| tolerance | fragment tolerance, |
| ppm | whether it is in ppm, |
| max_fragment_charge | highest fragment charge |
References DefaultParamHandler::getParameters(), DefaultParamHandler::setParameters(), Param::setValue(), and NuXLIonLikelihood::tsg_.
Add a confident hit to the models of fold.
References NuXLIonLikelihood::GROUPS, NuXLIonLikelihood::Outcomes::groups, NuXLIonLikelihood::Outcomes::ions, NuXLIonLikelihood::models_, NuXLIonLikelihood::Evidence::noise, and NuXLIonLikelihood::Evidence::signal.
| void finalize | ( | ) |
Finalize the models of both folds.
References NuXLIonLikelihood::models_.
| 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.
| scan | Scan index of the hit's spectrum. |
| peptide | The peptide, with fixed and variable modifications but without nucleic acid adduct. |
| precursor_charge | Precursor charge of the hit. |
| shifts | Masses of the fragment adducts of the cross-linked nucleotide; empty for hits without cross-link. |
| site | Position 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().
|
private |
References FragmentIonLikelihoodModel::COMPLEMENT_STATES, first, MSSpectrum::getIntegerDataArrays(), TheoreticalSpectrumGenerator::getSpectrum(), MSSpectrum::getStringDataArrays(), NuXLIonLikelihood::Outcomes::groups, NuXLIonLikelihood::Outcomes::ions, NuXLIonLikelihood::LINEAR, FragmentIonLikelihoodModel::matchIons(), NuXLIonLikelihood::max_fragment_charge_, NuXLIonLikelihood::models_, FragmentIonLikelihoodModel::parseIonName(), FragmentIonLikelihoodModel::PeakLists::peaks(), NuXLIonLikelihood::peaks_, NuXLIonLikelihood::ppm_, FragmentIonLikelihoodModel::PeakLists::size(), AASequence::size(), NuXLIonLikelihood::tolerance_, NuXLIonLikelihood::tsg_, NuXLIonLikelihood::XL_SHIFTED, NuXLIonLikelihood::XL_UNLOCALIZED, and NuXLIonLikelihood::XL_UNSHIFTED.
Referenced by NuXLIonLikelihood::match().
| void resetFold | ( | Size | fold | ) |
Clear the models of fold.
References NuXLIonLikelihood::models_.
|
static |
Reversed sequence of the noise hypothesis (all but the C-terminal residue)
References AASequence::getCTerminalModification(), AASequence::getNTerminalModification(), AASequence::hasCTerminalModification(), AASequence::hasNTerminalModification(), AASequence::setCTerminalModification(), AASequence::setNTerminalModification(), and AASequence::size().
Referenced by NuXLIonLikelihood::match().
| NuXLIonLikelihood::Features score | ( | Size | fold, |
| const Outcomes & | outcomes | ||
| ) | const |
Features of a hit scored by the models of fold.
References FragmentIonLikelihoodModel::Ion::context, NuXLIonLikelihood::Features::explained_presence, NuXLIonLikelihood::Outcomes::groups, NuXLIonLikelihood::Outcomes::ions, NuXLIonLikelihood::Features::llr, NuXLIonLikelihood::Features::llr_shifted, FragmentIonLikelihoodModel::logLikelihoodRatio(), NuXLIonLikelihood::models_, FragmentIonLikelihoodModel::Ion::outcome, FragmentIonLikelihoodModel::presenceProbability(), NuXLIonLikelihood::Features::top_predicted_observed, NuXLIonLikelihood::XL_SHIFTED, and NuXLIonLikelihood::XL_UNLOCALIZED.
| void setSpectra | ( | const PeakMap & | spectra | ) |
Compact copies of the spectra the hits refer to (by scan index)
References FragmentIonLikelihoodModel::PeakLists::assign(), NuXLIonLikelihood::peaks_, FragmentIonLikelihoodModel::PeakLists::reset(), and MSExperiment::size().
|
private |
Referenced by NuXLIonLikelihood::matchHypothesis_().
|
private |
Referenced by NuXLIonLikelihood::matchHypothesis_(), and NuXLIonLikelihood::setSpectra().
|
private |
Referenced by NuXLIonLikelihood::matchHypothesis_().
|
private |
Referenced by NuXLIonLikelihood::matchHypothesis_().
|
private |
Referenced by NuXLIonLikelihood::matchHypothesis_(), and NuXLIonLikelihood::NuXLIonLikelihood().