libpappsomspp
Library for mass spectrometry
|
#include <spomsspectrum.h>
Public Member Functions | |
SpOMSSpectrum (pappso::QualifiedMassSpectrum &qmass_spectrum, pappso::PrecisionPtr precision_ptr, const pappso::AaCode &aaCode) | |
SpOMSSpectrum (const SpOMSSpectrum &other) | |
SpOMSSpectrum (const SpOMSSpectrum &other, double precursor_mass_error) | |
Returns a copy of the provided spectrum accounting for the provided precursor mass error. | |
virtual | ~SpOMSSpectrum () |
void | addAaPosition (uint8_t aa, const std::size_t r_peak, const std::size_t l_peak, const std::size_t next_l_peak, bool l_support) |
Adds an amino acid position to the data structure. | |
std::vector< AaPosition > & | getAaPositions (pappso::Enums::AminoAcidChar aa) const |
Returns the list of aa_positions for a given amino acid. | |
std::vector< AaPosition > | getAaPositions (pappso::Enums::AminoAcidChar aa, std::vector< std::size_t > peaks_to_remove) const |
Returns the list of aa_positions for a given amino acid, except those relying on provided peaks. | |
std::vector< double > | getMassList () const |
Returns the spectrum's list of masses. | |
specglob::ExperimentalSpectrumDataPointType | peakType (std::size_t indice) const |
Returns the type of one of the spectrum's peaks. | |
uint | getPrecursorCharge () const |
Returns the spectrum's precursor's charge. | |
double | getMissingMass (std::size_t peak) const |
Returns the missing mass between a peak and the precursor's mass (shift at the end). | |
double | getMZShift (std::size_t l_peak, std::size_t r_peak) const |
Returns the mz difference between two peaks. | |
std::size_t | getComplementaryPeak (std::size_t peak) const |
Private Member Functions | |
void | preprocessSpectrum () |
Preprocess the spectrum. | |
void | removeUnsupportedMasses () |
Removes the unsupported peaks (without an amino acid to the left) from the spectrum. | |
uint32_t | computeCondition (const std::size_t l_peak, bool l_support) const |
Computes the "condition" integer, used to apply the three peaks rule. | |
void | addSupportedPeak (std::size_t peak) |
Add a peak to the supported peaks list. | |
void | correctPeakIndexes () |
Reindexes the peaks after removal of the unsupported peaks. | |
void | fillComplementaryPeakIndexes () |
For each point of the spectrum, indicate the index of its complementary peak;. | |
Private Attributes | |
pappso::QualifiedMassSpectrum | m_qualifiedMassSpectrum |
std::vector< std::shared_ptr< std::vector< AaPosition > > > | m_aapositions |
pappso::PrecisionPtr | m_precision_ptr |
std::vector< std::shared_ptr< std::vector< uint8_t > > > | m_supported_peaks |
std::vector< int > | m_reindexed_peaks |
const pappso::AaCode & | m_aaCode |
std::vector< std::size_t > | m_complementary_peak_indexes |
double | m_precursor_mass_error |
Definition at line 67 of file spomsspectrum.h.
pappso::specpeptidoms::SpOMSSpectrum::SpOMSSpectrum | ( | pappso::QualifiedMassSpectrum & | qmass_spectrum, |
pappso::PrecisionPtr | precision_ptr, | ||
const pappso::AaCode & | aaCode ) |
Default constructor
exp_spectrum | ExperimentalSpectrum to preprocess |
precision_ptr | Precision to use for preprocessing |
Definition at line 40 of file spomsspectrum.cpp.
References m_aaCode, m_aapositions, m_precision_ptr, m_precursor_mass_error, m_qualifiedMassSpectrum, m_reindexed_peaks, m_supported_peaks, pappso::MASSOXYGEN(), pappso::MHPLUS(), pappso::MPROTIUM(), and preprocessSpectrum().
Referenced by SpOMSSpectrum(), and SpOMSSpectrum().
pappso::specpeptidoms::SpOMSSpectrum::SpOMSSpectrum | ( | const SpOMSSpectrum & | other | ) |
Copy constructor
other | SpOMSSpectrum to copy |
Definition at line 69 of file spomsspectrum.cpp.
References SpOMSSpectrum(), m_aaCode, m_aapositions, m_complementary_peak_indexes, m_precision_ptr, m_precursor_mass_error, m_qualifiedMassSpectrum, m_reindexed_peaks, and m_supported_peaks.
pappso::specpeptidoms::SpOMSSpectrum::SpOMSSpectrum | ( | const SpOMSSpectrum & | other, |
double | precursor_mass_error ) |
Returns a copy of the provided spectrum accounting for the provided precursor mass error.
Post-processing constructor
other | SpOMSSpectrum to copy |
precursor_mass_error | precursor mass error to account for |
Definition at line 83 of file spomsspectrum.cpp.
References SpOMSSpectrum(), m_aaCode, m_aapositions, m_precision_ptr, m_precursor_mass_error, m_qualifiedMassSpectrum, m_reindexed_peaks, m_supported_peaks, pappso::MASSOXYGEN(), pappso::MHPLUS(), pappso::MPROTIUM(), and preprocessSpectrum().
|
virtual |
void pappso::specpeptidoms::SpOMSSpectrum::addAaPosition | ( | uint8_t | aa, |
const std::size_t | r_peak, | ||
const std::size_t | l_peak, | ||
const std::size_t | next_l_peak, | ||
bool | l_support ) |
Adds an amino acid position to the data structure.
aa | Amino acid to add to the data structure |
r_peak | index of the amino acid's right support peak |
l_peak | index of the amino acid's left support peak, if it is supported by an amino acid, otherwise see next_l_peak |
next_l_peak | index of the first supported peak to the left of the amino acid's left support peak |
l_support | indicates whether the amino acid's left support peak if supported by an amino acid |
Definition at line 232 of file spomsspectrum.cpp.
References computeCondition(), and m_aapositions.
Referenced by preprocessSpectrum().
|
private |
Add a peak to the supported peaks list.
Definition at line 340 of file spomsspectrum.cpp.
References m_reindexed_peaks.
Referenced by preprocessSpectrum().
|
private |
Computes the "condition" integer, used to apply the three peaks rule.
Definition at line 253 of file spomsspectrum.cpp.
References m_supported_peaks.
Referenced by addAaPosition().
|
private |
Reindexes the peaks after removal of the unsupported peaks.
Definition at line 361 of file spomsspectrum.cpp.
References m_aapositions, and m_reindexed_peaks.
Referenced by preprocessSpectrum().
|
private |
For each point of the spectrum, indicate the index of its complementary peak;.
Definition at line 375 of file spomsspectrum.cpp.
References pappso::MzRange::contains(), m_complementary_peak_indexes, m_precision_ptr, m_qualifiedMassSpectrum, and pappso::MHPLUS().
Referenced by preprocessSpectrum().
std::vector< pappso::specpeptidoms::AaPosition > & pappso::specpeptidoms::SpOMSSpectrum::getAaPositions | ( | pappso::Enums::AminoAcidChar | aa | ) | const |
Returns the list of aa_positions for a given amino acid.
aa | Amino acid for which to retrieve positions |
Definition at line 279 of file spomsspectrum.cpp.
References m_aaCode, and m_aapositions.
Referenced by pappso::specpeptidoms::SemiGlobalAlignment::correctAlign(), pappso::specpeptidoms::SemiGlobalAlignment::fastAlign(), and pappso::specpeptidoms::SemiGlobalAlignment::preciseAlign().
std::vector< pappso::specpeptidoms::AaPosition > pappso::specpeptidoms::SpOMSSpectrum::getAaPositions | ( | pappso::Enums::AminoAcidChar | aa, |
std::vector< std::size_t > | peaks_to_remove ) const |
Returns the list of aa_positions for a given amino acid, except those relying on provided peaks.
Definition at line 288 of file spomsspectrum.cpp.
References m_aaCode, and m_aapositions.
std::size_t pappso::specpeptidoms::SpOMSSpectrum::getComplementaryPeak | ( | std::size_t | peak | ) | const |
Definition at line 409 of file spomsspectrum.cpp.
References m_complementary_peak_indexes.
Referenced by pappso::specpeptidoms::SemiGlobalAlignment::correctAlign(), and pappso::specpeptidoms::SemiGlobalAlignment::preciseAlign().
std::vector< double > pappso::specpeptidoms::SpOMSSpectrum::getMassList | ( | ) | const |
Returns the spectrum's list of masses.
Definition at line 304 of file spomsspectrum.cpp.
References pappso::specglob::ExperimentalSpectrumDataPoint::peak_mz.
Referenced by preprocessSpectrum().
double pappso::specpeptidoms::SpOMSSpectrum::getMissingMass | ( | std::size_t | peak | ) | const |
Returns the missing mass between a peak and the precursor's mass (shift at the end).
Definition at line 333 of file spomsspectrum.cpp.
References m_precursor_mass_error, m_qualifiedMassSpectrum, and pappso::MHPLUS().
Referenced by pappso::specpeptidoms::SemiGlobalAlignment::perfectShiftPossibleEnd(), pappso::specpeptidoms::SemiGlobalAlignment::saveBestAlignment(), and pappso::specpeptidoms::SemiGlobalAlignment::updateAlignmentMatrix().
double pappso::specpeptidoms::SpOMSSpectrum::getMZShift | ( | std::size_t | l_peak, |
std::size_t | r_peak ) const |
Returns the mz difference between two peaks.
l_peak | left peak |
r_peak | right peak |
Definition at line 327 of file spomsspectrum.cpp.
Referenced by pappso::specpeptidoms::SemiGlobalAlignment::perfectShiftPossible(), pappso::specpeptidoms::SemiGlobalAlignment::perfectShiftPossibleFrom0(), pappso::specpeptidoms::SemiGlobalAlignment::saveBestAlignment(), and pappso::specpeptidoms::SemiGlobalAlignment::updateAlignmentMatrix().
uint pappso::specpeptidoms::SpOMSSpectrum::getPrecursorCharge | ( | ) | const |
Returns the spectrum's precursor's charge.
Definition at line 321 of file spomsspectrum.cpp.
References m_qualifiedMassSpectrum.
Referenced by pappso::specpeptidoms::SemiGlobalAlignment::correctAlign().
pappso::specglob::ExperimentalSpectrumDataPointType pappso::specpeptidoms::SpOMSSpectrum::peakType | ( | std::size_t | indice | ) | const |
Returns the type of one of the spectrum's peaks.
indice | Peak index to be identified |
Definition at line 315 of file spomsspectrum.cpp.
Referenced by pappso::specpeptidoms::SemiGlobalAlignment::updateAlignmentMatrix().
|
private |
Preprocess the spectrum.
Definition at line 119 of file spomsspectrum.cpp.
References addAaPosition(), addSupportedPeak(), correctPeakIndexes(), fillComplementaryPeakIndexes(), pappso::specpeptidoms::found, getMassList(), m_aaCode, m_precision_ptr, m_reindexed_peaks, m_supported_peaks, and removeUnsupportedMasses().
Referenced by SpOMSSpectrum(), and SpOMSSpectrum().
|
private |
Removes the unsupported peaks (without an amino acid to the left) from the spectrum.
Definition at line 215 of file spomsspectrum.cpp.
References m_reindexed_peaks.
Referenced by preprocessSpectrum().
|
private |
Definition at line 165 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), SpOMSSpectrum(), SpOMSSpectrum(), getAaPositions(), getAaPositions(), and preprocessSpectrum().
|
private |
Definition at line 160 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), SpOMSSpectrum(), SpOMSSpectrum(), addAaPosition(), correctPeakIndexes(), getAaPositions(), and getAaPositions().
|
private |
Definition at line 166 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), fillComplementaryPeakIndexes(), and getComplementaryPeak().
|
private |
Definition at line 161 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), SpOMSSpectrum(), SpOMSSpectrum(), fillComplementaryPeakIndexes(), and preprocessSpectrum().
|
private |
Definition at line 167 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), SpOMSSpectrum(), SpOMSSpectrum(), and getMissingMass().
|
private |
Definition at line 159 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), SpOMSSpectrum(), SpOMSSpectrum(), fillComplementaryPeakIndexes(), getMissingMass(), and getPrecursorCharge().
|
private |
Definition at line 163 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), SpOMSSpectrum(), SpOMSSpectrum(), addSupportedPeak(), correctPeakIndexes(), preprocessSpectrum(), and removeUnsupportedMasses().
|
private |
Definition at line 162 of file spomsspectrum.h.
Referenced by SpOMSSpectrum(), SpOMSSpectrum(), SpOMSSpectrum(), computeCondition(), and preprocessSpectrum().