33#include <unordered_set>
44 specglob::ExperimentalSpectrum(qmass_spectrum, precision_ptr)),
51 for(std::size_t iter = 0; iter <
m_aaCode.getSize(); iter++)
53 m_aapositions.push_back(std::make_shared<std::vector<AaPosition>>());
54 m_aapositions.back()->reserve(this->size() - 1);
59 for(std::size_t iter = 1; iter < this->size(); iter++)
84 double precursor_mass_error)
94 for(std::size_t iter = 0; iter <
m_aaCode.getSize(); iter++)
96 m_aapositions.push_back(std::make_shared<std::vector<AaPosition>>());
97 m_aapositions.back()->reserve(this->size() - 1);
102 for(std::size_t iter = 1; iter < this->size(); iter++)
108 this->back().peak_mz =
123 std::vector<double>::iterator iter1, iter2;
124 std::size_t peak1, peak2, next_l_peak;
128 for(iter1 = mass_list.begin(); iter1 != mass_list.end(); iter1++)
132 for(iter2 = iter1 + 1; iter2 != mass_list.end(); iter2++)
139 for(std::size_t iter = 1; iter < peak1;
217 std::vector<specglob::ExperimentalSpectrumDataPoint> kept_peaks;
218 for(std::vector<specglob::ExperimentalSpectrumDataPoint>::iterator iter = this->begin();
224 kept_peaks.push_back(*iter);
228 this->assign(kept_peaks.begin(), kept_peaks.end());
233 const std::size_t r_peak,
234 const std::size_t l_peak,
235 const std::size_t next_l_peak,
243 {r_peak, l_peak, next_l_peak,
computeCondition(l_peak, l_support), l_support});
248 {r_peak, next_l_peak, next_l_peak,
computeCondition(l_peak, l_support), l_support});
254 bool l_support)
const
272 condition += 2 << *(aa);
278std::vector<pappso::specpeptidoms::AaPosition> &
282 qDebug() <<
" m_aaCode.getAaCode(aa.getLetter()) - 1=" <<
m_aaCode.getAaCode(aa) - 1
287std::vector<pappso::specpeptidoms::AaPosition>
289 std::vector<std::size_t> peaks_to_remove)
const
291 std::vector<AaPosition> aa_positions;
294 if(std::find(peaks_to_remove.begin(), peaks_to_remove.end(), aap.r_peak) ==
295 peaks_to_remove.end())
297 aa_positions.push_back(aap);
306 std::vector<double> mass_list;
309 mass_list.push_back(n.
peak_mz);
317 return this->at(indice).type;
329 return this->at(r_peak).peak_mz - this->at(l_peak).peak_mz;
336 this->at(peak).peak_mz +
MHPLUS;
342 std::size_t counter = 0;
343 for(std::size_t iter = 0; iter < peak; iter++)
365 for(
auto aap = aa->get()->begin(); aap != aa->get()->end(); aap++)
377 std::size_t left_index, right_index;
385 right_index = this->size() - 1;
388 while(left_index < right_index)
391 if(mz_range.
contains(this->at(right_index).peak_mz))
395 qDebug() << left_index << right_index;
397 if(comp_mass - this->at(left_index).peak_mz - this->at(right_index).peak_mz >= 0)
collection of integer code for each amino acid 0 => null 1 to 20 => amino acid sorted by there mass (...
bool contains(pappso_double) const
Class representing a fully specified mass spectrum.
void preprocessSpectrum()
Preprocess the spectrum.
double getMZShift(std::size_t l_peak, std::size_t r_peak) const
Returns the mz difference between two peaks.
uint getPrecursorCharge() const
Returns the spectrum's precursor's charge.
SpOMSSpectrum(pappso::QualifiedMassSpectrum &qmass_spectrum, pappso::PrecisionPtr precision_ptr, const pappso::AaCode &aaCode)
std::vector< AaPosition > & getAaPositions(pappso::Enums::AminoAcidChar aa) const
Returns the list of aa_positions for a given amino acid.
double getMissingMass(std::size_t peak) const
Returns the missing mass between a peak and the precursor's mass (shift at the end).
std::vector< std::size_t > m_complementary_peak_indexes
std::vector< std::shared_ptr< std::vector< uint8_t > > > m_supported_peaks
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 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.
void removeUnsupportedMasses()
Removes the unsupported peaks (without an amino acid to the left) from the spectrum.
double m_precursor_mass_error
pappso::PrecisionPtr m_precision_ptr
pappso::QualifiedMassSpectrum m_qualifiedMassSpectrum
std::vector< std::shared_ptr< std::vector< AaPosition > > > m_aapositions
void correctPeakIndexes()
Reindexes the peaks after removal of the unsupported peaks.
void addSupportedPeak(std::size_t peak)
Add a peak to the supported peaks list.
void fillComplementaryPeakIndexes()
For each point of the spectrum, indicate the index of its complementary peak;.
std::vector< int > m_reindexed_peaks
std::size_t getComplementaryPeak(std::size_t peak) const
specglob::ExperimentalSpectrumDataPointType peakType(std::size_t indice) const
Returns the type of one of the spectrum's peaks.
std::vector< double > getMassList() const
Returns the spectrum's list of masses.
const pappso::AaCode & m_aaCode
ExperimentalSpectrumDataPointType
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
const pappso_double MHPLUS(1.007276466879)
const pappso_double MPROTIUM(1.007825032241)
const pappso_double MASSOXYGEN(15.99491461956)
const PrecisionBase * PrecisionPtr