|
libpappsomspp
Library for mass spectrometry
|
#include <semiglobalalignment.h>
Public Member Functions | |
| SemiGlobalAlignment (const ScoreValues &score_values, const pappso::PrecisionPtr precision_ptr, const AaCode &aaCode) | |
| ~SemiGlobalAlignment () | |
| void | fastAlign (const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr) |
| perform the first alignment search between a protein sequence and a spectrum. The member location heap is filled with the candidates locations. | |
| void | preciseAlign (const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr, const std::size_t beginning, const std::size_t length) |
| performs the second alignment search between a protein subsequence and a spectrum. | |
| void | postProcessingAlign (const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr, std::size_t beginning, std::size_t length, const std::vector< double > &shifts) |
| performs the post-processing : generates corrected spectra and align them | |
| LocationSaver | getLocationSaver () const |
| Returns a copy of m_location_saver. | |
| Scenario | getScenario () const |
| Returns a copy of m_scenario. | |
| const Alignment & | getBestAlignment () const |
| Returns a const ref to m_best_alignment. | |
| const std::vector< KeyCell > & | getInterestCells () const |
| convenient function for degub purpose | |
Static Public Member Functions | |
| static std::vector< double > | getPotentialMassErrors (const pappso::AaCode &aa_code, const Alignment &alignment, const QString &protein_seq) |
| Returns a list of the potential mass errors corresponding to the provided alignment in the provided protein sequence. | |
| static bool | checkSequenceDiversity (const QString &sequence, std::size_t window, std::size_t minimum_aa_diversity) |
| check that the sequence has a minimum of amino acid checkSequenceDiversity | |
Private Member Functions | |
| void | saveBestAlignment (const SpOMSProtein &sequence, const SpOMSSpectrum &spectrum, std::size_t offset) |
| Stores the best alignment from m_scenario in m_best_alignment. | |
| void | correctAlign (const SpOMSProtein &protein_subseq, const SpOMSProtein *protein_ptr, const SpOMSSpectrum &spectrum, std::vector< std::size_t > &peaks_to_remove, std::size_t offset) |
| Recursively performs the correction of the alignment. | |
| void | updateAlignmentMatrix (const pappso::specpeptidoms::SpOMSProtein &sequence, const std::size_t row_number, const std::vector< AaPosition > &aa_positions, const SpOMSSpectrum &spectrum, const bool fast_align, const pappso::specpeptidoms::SpOMSProtein *protein_ptr) |
| updates the scores of the alignment matrix for a given amino acid as well as the location heap/scenario. | |
| bool | perfectShiftPossible (const pappso::specpeptidoms::SpOMSProtein &sequence, const SpOMSSpectrum &spectrum, const std::size_t origin_row, const std::size_t current_row, const std::size_t l_peak, const std::size_t r_peak) const |
| indicates if a perfect shift is possible between the provided positions | |
| std::size_t | perfectShiftPossibleFrom0 (const pappso::specpeptidoms::SpOMSProtein &sequence, const SpOMSSpectrum &spectrum, const std::size_t current_row, const std::size_t r_peak) const |
| indicates if a perfect shift is possible from the spectrum beginning to the provided peak. | |
| std::size_t | perfectShiftPossibleEnd (const pappso::specpeptidoms::SpOMSProtein &sequence, const SpOMSSpectrum &spectrum, std::size_t end_row, std::size_t end_peak) const |
| indicates if a perfect shift is possible between the provided positions | |
Private Attributes | |
| std::vector< KeyCell > | m_interest_cells |
| std::vector< std::pair< std::size_t, KeyCell > > | m_updated_cells |
| const ScoreValues & | m_scorevalues |
| const int | min_score = 15 |
| pappso::PrecisionPtr | m_precision_ptr |
| const AaCode & | m_aaCode |
| LocationSaver | m_location_saver |
| Scenario | m_scenario |
| Alignment | m_best_alignment |
| Alignment | m_best_corrected_alignment |
| Alignment | m_best_post_processed_alignment |
Definition at line 90 of file semiglobalalignment.h.
| pappso::specpeptidoms::SemiGlobalAlignment::SemiGlobalAlignment | ( | const ScoreValues & | score_values, |
| const pappso::PrecisionPtr | precision_ptr, | ||
| const AaCode & | aaCode | ||
| ) |
Default constructor
Definition at line 80 of file semiglobalalignment.cpp.
References pappso::specpeptidoms::KeyCell::beginning, m_interest_cells, m_precision_ptr, pappso::specpeptidoms::KeyCell::n_row, pappso::specpeptidoms::KeyCell::score, and pappso::specpeptidoms::KeyCell::tree_id.
| pappso::specpeptidoms::SemiGlobalAlignment::~SemiGlobalAlignment | ( | ) |
|
static |
check that the sequence has a minimum of amino acid checkSequenceDiversity
| sequence | protein sequence |
| window | the size of substring to check |
| minimum_aa_diversity | minimum number of different amino acid in this window |
Definition at line 1010 of file semiglobalalignment.cpp.
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment(), and pappso::cbor::psm::PsmSpecPeptidOmsScan::storeAlignment().
|
private |
Recursively performs the correction of the alignment.
| protein_seq | Protein reversed sequence to align. |
| protein_ptr | Protein pointer on the sequence to align. |
| spectrum | Spectrum to align. |
| peaks_to_remove | Peaks to remove from the spectrum. |
| offset | Size of the protein sequence minus beginning of the alignment. Used to compute the position of the alignment in the protein sequence. |
Definition at line 269 of file semiglobalalignment.cpp.
References pappso::specpeptidoms::CorrectionTree::addPeaks(), pappso::specpeptidoms::KeyCell::beginning, pappso::specpeptidoms::SpOMSSpectrum::getAaPositions(), pappso::specpeptidoms::SpOMSSpectrum::getComplementaryPeak(), pappso::specpeptidoms::CorrectionTree::getPeaks(), pappso::specpeptidoms::SpOMSSpectrum::getPrecursorCharge(), pappso::specpeptidoms::SpOMSProtein::getSequence(), pappso::specpeptidoms::init, pappso::specpeptidoms::MIN_ALIGNMENT_SCORE(), pappso::specpeptidoms::KeyCell::n_row, pappso::specpeptidoms::KeyCell::score, and pappso::specpeptidoms::KeyCell::tree_id.
| void pappso::specpeptidoms::SemiGlobalAlignment::fastAlign | ( | const SpOMSSpectrum & | spectrum, |
| const SpOMSProtein * | protein_ptr | ||
| ) |
perform the first alignment search between a protein sequence and a spectrum. The member location heap is filled with the candidates locations.
| spectrum | Spectrum to align |
| protein_ptr | Protein pointer on the sequence to align. |
Definition at line 103 of file semiglobalalignment.cpp.
References pappso::specpeptidoms::KeyCell::beginning, pappso::specpeptidoms::SpOMSSpectrum::getAaPositions(), pappso::specpeptidoms::init, pappso::specpeptidoms::KeyCell::n_row, pappso::specpeptidoms::KeyCell::score, and pappso::specpeptidoms::KeyCell::tree_id.
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment().
| const pappso::specpeptidoms::Alignment & pappso::specpeptidoms::SemiGlobalAlignment::getBestAlignment | ( | ) | const |
Returns a const ref to m_best_alignment.
Definition at line 959 of file semiglobalalignment.cpp.
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment().
| const std::vector< pappso::specpeptidoms::KeyCell > & pappso::specpeptidoms::SemiGlobalAlignment::getInterestCells | ( | ) | const |
convenient function for degub purpose
Definition at line 97 of file semiglobalalignment.cpp.
| pappso::specpeptidoms::LocationSaver pappso::specpeptidoms::SemiGlobalAlignment::getLocationSaver | ( | ) | const |
Returns a copy of m_location_saver.
Definition at line 757 of file semiglobalalignment.cpp.
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment().
|
static |
Returns a list of the potential mass errors corresponding to the provided alignment in the provided protein sequence.
| aa_code | the amino acid code of reference to get aminon acid masses |
| alignment | Alignment for which to get the potential mass errors. |
| protein_seq | Protein sequence corresponding to the provided alignment. |
Definition at line 965 of file semiglobalalignment.cpp.
References pappso::specpeptidoms::Alignment::begin_shift, pappso::specpeptidoms::Alignment::beginning, pappso::specpeptidoms::Alignment::end, pappso::specpeptidoms::Alignment::end_shift, pappso::AaCode::getMass(), pappso::specpeptidoms::shift, and pappso::specpeptidoms::Alignment::shifts.
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment().
| pappso::specpeptidoms::Scenario pappso::specpeptidoms::SemiGlobalAlignment::getScenario | ( | ) | const |
Returns a copy of m_scenario.
Definition at line 763 of file semiglobalalignment.cpp.
|
private |
indicates if a perfect shift is possible between the provided positions
| sequence | Reversed sequence of the protein being aligned |
| spectrum | Spectrum being aligned |
| origin_row | beginning row of the aa gap to verify (== index of the first missing aa in sequence) |
| current_row | row being processed (== index of the current AaPosition in sequence) |
| l_peak | left peak index of the mz gap to verify |
| r_peak | right peak index of the mz gap to verify |
Definition at line 650 of file semiglobalalignment.cpp.
References pappso::MzRange::contains(), pappso::specpeptidoms::SpOMSSpectrum::getMZShift(), and pappso::PappsoException::qwhat().
|
private |
indicates if a perfect shift is possible between the provided positions
| sequence | Reversed sequence of the protein being aligned |
| spectrum | Spectrum being aligned |
| end_row | Index of the last aligned row. |
| end_peak | Index of the last aligned peak. |
Definition at line 717 of file semiglobalalignment.cpp.
References pappso::MzRange::contains(), pappso::specpeptidoms::SpOMSSpectrum::getMissingMass(), and pappso::PappsoException::qwhat().
|
private |
indicates if a perfect shift is possible from the spectrum beginning to the provided peak.
| sequence | Reversed sequence of the protein being aligned |
| spectrum | Spectrum being aligned |
| current_row | row being processed (== index of the current AaPosition in sequence) |
| r_peak | right peak index of the mz gap to verify |
Definition at line 690 of file semiglobalalignment.cpp.
References pappso::MzRange::contains(), and pappso::specpeptidoms::SpOMSSpectrum::getMZShift().
| void pappso::specpeptidoms::SemiGlobalAlignment::postProcessingAlign | ( | const SpOMSSpectrum & | spectrum, |
| const SpOMSProtein * | protein_ptr, | ||
| std::size_t | beginning, | ||
| std::size_t | length, | ||
| const std::vector< double > & | shifts | ||
| ) |
performs the post-processing : generates corrected spectra and align them
| spectrum | Spectrum to align |
| protein_ptr | Protein pointer on the sequence to align. |
| beginning | Index of the beginning of the subsequence to align. |
| length | Length of the subsequence to align. |
| shifts | List of potential precursor mass errors to test. |
Definition at line 353 of file semiglobalalignment.cpp.
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment().
| void pappso::specpeptidoms::SemiGlobalAlignment::preciseAlign | ( | const SpOMSSpectrum & | spectrum, |
| const SpOMSProtein * | protein_ptr, | ||
| const std::size_t | beginning, | ||
| const std::size_t | length | ||
| ) |
performs the second alignment search between a protein subsequence and a spectrum.
| spectrum | Spectrum to align |
| protein_ptr | Protein pointer on the sequence to align. |
| beginning | Index of the beginning of the subsequence to align. |
| length | Length of the subsequence to align. |
Definition at line 139 of file semiglobalalignment.cpp.
References pappso::specpeptidoms::CorrectionTree::addPeaks(), pappso::specpeptidoms::SpOMSSpectrum::getAaPositions(), pappso::specpeptidoms::SpOMSSpectrum::getComplementaryPeak(), pappso::specpeptidoms::CorrectionTree::getPeaks(), pappso::specpeptidoms::SpOMSProtein::getSequence(), pappso::specpeptidoms::init, pappso::specpeptidoms::MIN_ALIGNMENT_SCORE(), and pappso::PappsoException::qwhat().
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment().
|
private |
Stores the best alignment from m_scenario in m_best_alignment.
| sequence | reversed sequence of the current alignment. |
| spectrum | Spectrum currently being aligned. |
| offset | Size of the protein sequence minus beginning of the alignment. Used to compute the position of the alignment in the protein sequence. |
Definition at line 769 of file semiglobalalignment.cpp.
References pappso::specglob::both, pappso::MzRange::contains(), pappso::specpeptidoms::found, pappso::specpeptidoms::foundShift, pappso::Aa::getMass(), pappso::specpeptidoms::SpOMSSpectrum::getMissingMass(), pappso::specpeptidoms::SpOMSSpectrum::getMZShift(), pappso::specpeptidoms::SpOMSSpectrum::getPrecursorMass(), pappso::specpeptidoms::init, pappso::specpeptidoms::AminoAcidModel::m_aminoAcid, pappso::specpeptidoms::AminoAcidModel::m_massDifference, pappso::specpeptidoms::AminoAcidModel::m_skipped, pappso::specglob::native, pappso::specpeptidoms::notFound, pappso::specpeptidoms::perfectShift, pappso::specpeptidoms::shift, pappso::specpeptidoms::SpOMSProtein::sliced(), pappso::specglob::symmetric, and pappso::specglob::synthetic.
|
private |
updates the scores of the alignment matrix for a given amino acid as well as the location heap/scenario.
| sequence | Reversed sequence of the protein being aligned |
| row_number | number of the row to update (== index in sequence of the amino acid being aligned) |
| aa_positions | list of the AaPositions of the current amino acid |
| spectrum | Spectrum being aligned |
| fast_align | Whether to use the fast version of the algorithm (for 1st alignemnt step) |
| protein_ptr | Protein pointer on the sequence to align. |
Definition at line 379 of file semiglobalalignment.cpp.
References pappso::specpeptidoms::ALIGNMENT_SURPLUS(), pappso::specpeptidoms::KeyCell::beginning, pappso::specglob::both, pappso::specpeptidoms::found, pappso::specpeptidoms::foundDouble, pappso::specpeptidoms::foundShift, pappso::specpeptidoms::foundShiftDouble, pappso::specpeptidoms::SpOMSSpectrum::getMissingMass(), pappso::specpeptidoms::SpOMSSpectrum::getMZShift(), pappso::specpeptidoms::KeyCell::n_row, pappso::specpeptidoms::notFound, pappso::specpeptidoms::SpOMSSpectrum::peakType(), pappso::specpeptidoms::perfectShift, pappso::PappsoException::qwhat(), pappso::specpeptidoms::KeyCell::score, pappso::specpeptidoms::shift, and pappso::specpeptidoms::KeyCell::tree_id.
|
private |
Definition at line 275 of file semiglobalalignment.h.
|
private |
Definition at line 278 of file semiglobalalignment.h.
|
private |
Definition at line 279 of file semiglobalalignment.h.
|
private |
Definition at line 280 of file semiglobalalignment.h.
|
private |
Definition at line 270 of file semiglobalalignment.h.
Referenced by SemiGlobalAlignment().
|
private |
Definition at line 276 of file semiglobalalignment.h.
|
private |
Definition at line 274 of file semiglobalalignment.h.
Referenced by SemiGlobalAlignment().
|
private |
Definition at line 277 of file semiglobalalignment.h.
|
private |
Definition at line 272 of file semiglobalalignment.h.
|
private |
Definition at line 271 of file semiglobalalignment.h.
|
private |
Definition at line 273 of file semiglobalalignment.h.