56 double precursor_mass_error)
91 QObject::tr(
"precursor charge is not defined in spectrum %1")
99 QObject::tr(
"precursor m/z is not defined in spectrum %1")
110 std::size_t mz_current_indice = 0;
112 for(std::vector<pappso::DataPoint>::const_iterator it =
117 double current_mz = it->x;
121 auto itpair_symmetric =
findMz(symmetric_current_mz);
122 if(itpair_symmetric != itend)
126 qDebug() <<
"current_mz=" << current_mz <<
" both";
133 qDebug() <<
"current_mz=" << current_mz <<
" symmetrics";
149 if(
findMz(precusorBion) == itend)
157 return (
a.peak_mz <
b.peak_mz);
161 for(
auto &data_point : *
this)
163 data_point.indice = i;
168std::vector<pappso::DataPoint>::const_iterator
180 if(it->x <= mz_range.
upper())
197 std::vector<double> mass_list;
200 mass_list.push_back(n.
peak_mz);
215 std::vector<double> mass_list;
219 mass_list.push_back(n.
peak_mz);
228 QStringList all_element;
231 all_element << QString(
"%1 %2").arg(n.
peak_mz).arg((std::uint8_t)n.
type);
233 return QString(
"[%1]").arg(all_element.join(
"] ["));
242std::vector<ExperimentalSpectrumDataPoint>::const_reverse_iterator
247 qDebug() <<
"start_position" << start_position <<
" lookfor=" << aaTheoMzRange.
getMz();
248 std::vector<ExperimentalSpectrumDataPoint>::const_reverse_iterator itrbegin =
249 rbegin() + (size() - 1 - start_position);
251 qDebug() << itrbegin->indice <<
"mz=" << itrbegin->peak_mz;
252 double eperimentalMzReference = itrbegin->peak_mz;
253 auto itrend = this->rend();
256 for(
auto itr = itrbegin + 1; itr != itrend; ++itr)
258 qDebug() << itr->indice;
259 double experimentalMzDifference = eperimentalMzReference - itr->peak_mz;
261 if(experimentalMzDifference > aaTheoMzRange.
upper())
266 qDebug() << experimentalMzDifference <<
">" << aaTheoMzRange.
upper();
269 else if(experimentalMzDifference < aaTheoMzRange.
lower())
274 qDebug() << itr->indice <<
" diff=" << experimentalMzDifference;
pappso_double getMz() const
pappso_double lower() const
pappso_double upper() const
Class representing a fully specified mass spectrum.
double getSymetricMz(double mz) const
compute the symmetric mass for debuggin purpose
std::vector< double > getMassList() const
virtual ~ExperimentalSpectrum()
double getPrecursorMass() const
const pappso::QualifiedMassSpectrum & getQualifiedMassSpectrum() const
double getTargetMzSum() const
pappso::PrecisionPtr m_precisionPtr
std::vector< ExperimentalSpectrumDataPoint >::const_reverse_iterator reverseFindDiffMz(std::size_t start_position, const pappso::MzRange &targeted_mass_range) const
find the peak for wich mass difference from rbegin corresponds to aaTheoMass Find if a peak back in t...
ExperimentalSpectrum(const pappso::QualifiedMassSpectrum &qmass_spectrum, pappso::PrecisionPtr precision_ptr)
void createSymetricPeakList()
add symmetric peaks to the spectrum Create a SymetricPeakList that contain symmetric peaks and the in...
std::vector< pappso::DataPoint >::const_iterator findMz(double mz)
find the correspondin mz in the mass spectrum (given the precision)
pappso::QualifiedMassSpectrum m_qualifiedMassSpectrum
ExperimentalSpectrumDataPointType
@ synthetic
does not correspond to existing peak, for computational purpose
@ both
both, the ion and the complement exists in the original spectrum
@ symmetric
new peak : computed symmetric mass from a corresponding native peak
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::vector< DataPoint >::iterator findFirstEqualOrGreaterX(std::vector< DataPoint >::iterator begin, std::vector< DataPoint >::iterator end, const double &value)
find the first element in which X is equal or greater than the value searched important : it implies ...
const pappso_double MHPLUS(1.007276466879)
const pappso_double MPROTIUM(1.007825032241)
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
const PrecisionBase * PrecisionPtr
ExperimentalSpectrumDataPointType type