33 #include "../../pappsoexception.h"
34 #include "../../exception/exceptioninterrupted.h"
35 #include "../../processing/filters/filterresample.h"
57 QObject::tr(
"error extracting XIC: no MS level 1 in data file"));
75 std::vector<XicCoordSPtr>::iterator it_xic_coord_list_begin,
76 std::vector<XicCoordSPtr>::iterator it_xic_coord_list_end)
80 std::sort(it_xic_coord_list_begin,
81 it_xic_coord_list_end,
83 return a.get()->rtTarget <
b.get()->rtTarget;
86 for(
auto it = it_xic_coord_list_begin; it != it_xic_coord_list_end; it++)
94 QObject::tr(
"Xic extraction process interrupted"));
105 std::shared_ptr<Xic> msrunxic_sp = xic_coord.
xicSptr;
114 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
120 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
127 qDebug() <<
" spectrum->size()=" << spectrum->size();
128 keep_range.
filter(*(spectrum.get()));
129 qDebug() <<
" spectrum->size()=" << spectrum->size();
131 peak.
x = itpoints->rt;
136 if(spectrum->size() > 0)
140 qDebug() <<
" peak.y=" << peak.
y
141 <<
" spectrum->size()=" << spectrum->size();
146 peak.
y =
sumYTrace(spectrum->begin(), spectrum->end(), 0);
148 msrunxic_sp->push_back(peak);
156 std::vector<Xic *> &xic_list,
157 const std::vector<MzRange> &mass_range_list,
163 std::vector<DataPoint> peak_for_mass;
164 for(
const MzRange &mass_range : mass_range_list)
167 qDebug() <<
" mass_range=" << mass_range.getMz();
175 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
181 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
188 peak.x = itpoints->rt;
194 for(
auto &&spectrum_point : *(spectrum.get()))
198 for(std::size_t i = 0; i < mass_range_list.size(); i++)
200 if(mass_range_list[i].contains(spectrum_point.x))
204 if(peak_for_mass[i].
y < spectrum_point.y)
206 peak_for_mass[i].y = spectrum_point.y;
211 peak_for_mass[i].y += spectrum_point.y;
217 for(std::size_t i = 0; i < mass_range_list.size(); i++)
221 xic_list[i]->push_back(peak_for_mass[i]);
Trace & filter(Trace &trace) const override
pappso_double lower() const
pappso_double upper() const
virtual bool shouldIstop()=0
should the procces be stopped ? If true, then cancel process Use this function at strategic point of ...
virtual void count()=0
count steps report when a step is computed in an algorithm
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< MsRunReader > MsRunReaderSPtr
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
double pappso_double
A type definition for doubles.
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
double sumYTrace(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end, double init)
calculate the sum of y value of a trace
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
@ max
maximum of intensities
std::shared_ptr< XicCoord > XicCoordSPtr
coordinates of the XIC to extract and the resulting XIC after extraction
XicSPtr xicSptr
extracted xic
double rtTarget
the targeted retention time to extract around intended in seconds, and related to one msrun....
MzRange mzRange
the mass to extract