33 #include "../../pappsoexception.h"
34 #include "../../processing/filters/filterresample.h"
56 QObject::tr(
"error extracting XIC: no MS level 1 in data file"));
76 std::shared_ptr<Xic> msrunxic_sp = std::make_shared<Xic>(
Xic());
81 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
87 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
94 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
95 <<
" spectrum->size()=" << spectrum->size();
96 keep_range.
filter(*(spectrum.get()));
97 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
98 <<
" spectrum->size()=" << spectrum->size();
100 peak.
x = itpoints->rt;
105 if(spectrum->size() > 0)
109 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
110 <<
" peak.y=" << peak.
y
111 <<
" spectrum->size()=" << spectrum->size();
116 peak.
y =
sumYTrace(spectrum->begin(), spectrum->end(), 0);
118 msrunxic_sp->push_back(peak);
124 return (msrunxic_sp);
127 std::vector<XicCstSPtr>
131 std::vector<std::shared_ptr<Xic>> xic_list_return;
132 std::vector<Xic *> xic_list;
133 for(std::size_t i = 0; i < mz_range_list.size(); i++)
135 xic_list_return.push_back(std::make_shared<Xic>(
Xic()));
136 xic_list.push_back(xic_list_return.back().get());
140 std::vector<XicCstSPtr> xic_list_return_b;
141 for(
auto &xic : xic_list_return)
143 xic_list_return_b.push_back(xic);
145 return xic_list_return_b;
150 std::vector<Xic *> &xic_list,
151 const std::vector<MzRange> &mass_range_list,
155 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
157 std::vector<DataPoint> peak_for_mass;
158 for(
const MzRange &mass_range : mass_range_list)
161 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
162 <<
" mass_range=" << mass_range.getMz();
166 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
170 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt < rt_begin))
176 while((itpoints !=
m_msrun_points.end()) && (itpoints->rt <= rt_end))
183 peak.x = itpoints->rt;
189 for(
auto &&spectrum_point : *(spectrum.get()))
193 for(std::size_t i = 0; i < mass_range_list.size(); i++)
195 if(mass_range_list[i].contains(spectrum_point.x))
199 if(peak_for_mass[i].
y < spectrum_point.y)
201 peak_for_mass[i].y = spectrum_point.y;
206 peak_for_mass[i].y += spectrum_point.y;
212 for(std::size_t i = 0; i < mass_range_list.size(); i++)
216 xic_list[i]->push_back(peak_for_mass[i]);
223 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
Trace & filter(Trace &trace) const override
pappso_double lower() const
pappso_double upper() const
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)
std::shared_ptr< const Xic > XicCstSPtr
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