35 #include "../../pappsoexception.h"
36 #include "../../exception/exceptioninterrupted.h"
37 #include "../../processing/filters/filterresample.h"
59 QObject::tr(
"error extracting XIC: no MS level 1 in data file"));
77 std::vector<XicCoordSPtr>::iterator it_xic_coord_list_begin,
78 std::vector<XicCoordSPtr>::iterator it_xic_coord_list_end)
82 std::sort(it_xic_coord_list_begin,
83 it_xic_coord_list_end,
85 return a.get()->rtTarget <
b.get()->rtTarget;
88 for(
auto it = it_xic_coord_list_begin; it != it_xic_coord_list_end; it++)
96 QObject::tr(
"Xic extraction process interrupted"));
107 std::shared_ptr<Xic> msrunxic_sp = xic_coord.
xicSptr;
116 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
122 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
129 qDebug() <<
" spectrum->size()=" << spectrum->size();
130 keep_range.
filter(*(spectrum.get()));
131 qDebug() <<
" spectrum->size()=" << spectrum->size();
133 peak.
x = itpoints->rt;
138 if(spectrum->size() > 0)
142 qDebug() <<
" peak.y=" << peak.
y
143 <<
" spectrum->size()=" << spectrum->size();
148 peak.
y =
sumYTrace(spectrum->begin(), spectrum->end(), 0);
150 msrunxic_sp->push_back(peak);
158 std::vector<Xic *> &xic_list,
159 const std::vector<MzRange> &mass_range_list,
165 std::vector<DataPoint> peak_for_mass;
166 for(
const MzRange &mass_range : mass_range_list)
169 qDebug() <<
" mass_range=" << mass_range.getMz();
177 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
183 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
190 peak.x = itpoints->rt;
196 for(
auto &&spectrum_point : *(spectrum.get()))
200 for(std::size_t i = 0; i < mass_range_list.size(); i++)
202 if(mass_range_list[i].contains(spectrum_point.x))
206 if(peak_for_mass[i].
y < spectrum_point.y)
208 peak_for_mass[i].y = spectrum_point.y;
213 peak_for_mass[i].y += spectrum_point.y;
219 for(std::size_t i = 0; i < mass_range_list.size(); i++)
223 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