38#include "../../pappsoexception.h"
76 QObject::tr(
"precursor charge is not defined in spectrum %1")
84 QObject::tr(
"precursor m/z is not defined in spectrum %1")
93 std::vector<double> mz_list =
96 std::size_t mz_current_indice = 0;
98 for(std::vector<pappso::DataPoint>::const_iterator it =
103 double current_mz = it->x;
107 auto itpair_symetric =
findMz(symetric_current_mz);
108 if(itpair_symetric != itend)
112 qDebug() <<
"current_mz=" << current_mz <<
" both";
121 qDebug() <<
"current_mz=" << current_mz <<
" symetrics";
138 if(
findMz(precusorBion) == itend)
148 return (
a.symetric_mz <
b.symetric_mz);
152 for(
auto &data_point : *
this)
154 data_point.indice = i;
159std::vector<pappso::DataPoint>::const_iterator
171 if(it->x <= mz_range.
upper())
188 std::vector<double> mass_list;
191 mass_list.push_back(n.symetric_mz);
206 std::vector<double> mass_list;
210 mass_list.push_back(n.symetric_mz);
219 QStringList all_element;
223 << QString(
"%1 %2").arg(n.symetric_mz).arg((std::uint8_t)n.type);
225 return QString(
"[%1]").arg(all_element.join(
"] ["));
234std::vector<ExperimentalSpectrumDataPoint>::const_reverse_iterator
236 std::size_t start_position,
const pappso::MzRange &aaTheoMzRange)
const
239 qDebug() <<
"start_position" << start_position
240 <<
" lookfor=" << aaTheoMzRange.
getMz();
241 std::vector<ExperimentalSpectrumDataPoint>::const_reverse_iterator itrbegin =
242 rbegin() + (size() - 1 - start_position);
244 qDebug() << itrbegin->indice <<
"mz=" << itrbegin->symetric_mz;
245 double eperimentalMzReference = itrbegin->symetric_mz;
246 auto itrend = this->rend();
249 for(
auto itr = itrbegin + 1; itr != itrend; ++itr)
251 qDebug() << itr->indice;
252 double experimentalMzDifference =
253 eperimentalMzReference - itr->symetric_mz;
255 if(experimentalMzDifference > aaTheoMzRange.
upper())
260 qDebug() << experimentalMzDifference <<
">" << aaTheoMzRange.
upper();
263 else if(experimentalMzDifference < aaTheoMzRange.
lower())
268 qDebug() << itr->indice <<
" diff=" << experimentalMzDifference;
const QString & getNativeId() const
pappso_double getMz() const
pappso_double lower() const
pappso_double upper() const
Class representing a fully specified mass spectrum.
MassSpectrumCstSPtr getMassSpectrumCstSPtr() const
Get the MassSpectrumCstSPtr.
uint getPrecursorCharge(bool *ok=nullptr) const
get precursor charge
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
pappso_double getPrecursorMz(bool *ok=nullptr) const
get precursor mz
double getSymetricMz(double mz) const
compute the symetric 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 symetric peaks to the spectrum Create a SymetricPeakList that contain symmetric peaks and the inf...
std::vector< pappso::DataPoint >::const_iterator findMz(double mz)
find the correspondin mz in the mass spectrum (given the precision)
pappso::QualifiedMassSpectrum m_qualifiedMassSpectrum
transform a spectrum to SpecGlob spectra
ExperimentalSpectrumDataPointType
@ symetric
new peak : computed symetric mass from a corresponding native peak
@ synthetic
does not correspond to existing peak, for computational purpose
@ both
both, the ion and the complement exists in the original spectrum
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)