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"));
78 QObject::tr(
"extracting %1 XICs").arg(xic_coord_list.size()));
81 std::sort(xic_coord_list.begin(),
84 return a.get()->rtTarget < b.get()->rtTarget;
95 QObject::tr(
"Xic extraction process interrupted"));
106 std::shared_ptr<Xic> msrunxic_sp = xic_coord.
xicSptr;
115 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
121 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
128 qDebug() <<
" spectrum->size()=" << spectrum->size();
129 keep_range.
filter(*(spectrum.get()));
130 qDebug() <<
" spectrum->size()=" << spectrum->size();
132 peak.
x = itpoints->rt;
137 if(spectrum->size() > 0)
141 qDebug() <<
" peak.y=" << peak.
y
142 <<
" spectrum->size()=" << spectrum->size();
147 peak.
y =
sumYTrace(spectrum->begin(), spectrum->end(), 0);
149 msrunxic_sp->push_back(peak);
157 std::vector<Xic *> &xic_list,
158 const std::vector<MzRange> &mass_range_list,
164 std::vector<DataPoint> peak_for_mass;
165 for(
const MzRange &mass_range : mass_range_list)
168 qDebug() <<
" mass_range=" << mass_range.getMz();
176 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
182 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
189 peak.x = itpoints->rt;
195 for(
auto &&spectrum_point : *(spectrum.get()))
199 for(std::size_t i = 0; i < mass_range_list.size(); i++)
201 if(mass_range_list[i].contains(spectrum_point.x))
205 if(peak_for_mass[i].
y < spectrum_point.y)
207 peak_for_mass[i].y = spectrum_point.y;
212 peak_for_mass[i].y += spectrum_point.y;
218 for(std::size_t i = 0; i < mass_range_list.size(); i++)
222 xic_list[i]->push_back(peak_for_mass[i]);
Trace & filter(Trace &trace) const override
pappso_double lower() const
pappso_double upper() const
virtual void setStatus(const QString &status)=0
current status of the process
virtual void setTotalSteps(std::size_t total_number_of_steps)
use it if the number of steps is known in an algorithm the total number of steps is usefull to report...
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