31 #include "../../exception/exceptionnotimplemented.h"
33 #include <QtConcurrent>
55 mpa_timsData =
new TimsData(mcsp_msRunId.get()->getFileName());
69 QObject::tr(
"ERROR in TimsMsRunReaderMs2Selected::setMs2FilterCstSPtr "
70 "mpa_timsData is null"));
85 QObject::tr(
"ERROR in TimsMsRunReaderMs2Selected::setMs1FilterCstSPtr "
86 "mpa_timsData is null"));
93 qDebug() << file_name;
118 bool want_binary_data)
const
121 std::size_t precursor_index = (spectrum_index / 2) + 1;
126 if(spectrum_index % 2 == 0)
132 getMsRunId(), mass_spectrum_ms1, spectrum_descr, want_binary_data);
136 return mass_spectrum_ms1;
142 if(spectrum_descr.
ms2_index != spectrum_index)
147 "ERROR in %1 %2 %3 spectrum_descr.ms2_index != spectrum_index")
153 getMsRunId(), mass_spectrum_ms2, spectrum_descr, want_binary_data);
157 return mass_spectrum_ms2;
178 std::vector<size_t> selected_precursor{63905,
201 std::size_t process_list_size = 300;
207 bool want_binary_data;
210 for(std::size_t i = 0; i < spectrum_list_size; i += process_list_size)
218 qDebug() <<
"The operation was cancelled. Breaking the loop.";
221 std::vector<tmp_item> item_list;
222 for(std::size_t iter = 0;
223 (iter < process_list_size) && ((iter + i) < spectrum_list_size);
226 if(std::find(selected_precursor.begin(),
227 selected_precursor.end(),
228 iter + i) != selected_precursor.end())
230 bool get_data = want_binary_data;
231 if((iter + i) % 2 == 0)
244 qDebug() << item_list.size();
247 QtConcurrent::blockingMap(
248 item_list.begin(), item_list.end(), [
this](tmp_item &one_item) {
249 qDebug() << one_item.iter;
250 one_item.qualified_mass_spectrum =
251 qualifiedMassSpectrum(one_item.iter, one_item.want_binary_data);
257 qDebug() << item_list.size();
258 for(
auto &item : item_list)
271 for(std::size_t iter = 0; iter < spectrum_list_size; iter++)
278 qDebug() <<
"The operation was cancelled. Breaking the loop.";
281 bool get_data = want_binary_data;
const MsRunIdCstSPtr & getMsRunId() const
Class representing a fully specified mass spectrum.
MassSpectrumSPtr getMassSpectrumSPtr() const
Get the MassSpectrumSPtr.
interface to collect spectrums from the MsRunReader class
virtual bool shouldStop()
virtual bool isReadAhead() const
tells if we want to read ahead spectrum
virtual bool needPeakList() const =0
tells if we need the peak list (if we want the binary data) for each spectrum
virtual void loadingEnded()
virtual bool needMsLevelPeakList(unsigned int ms_level) const final
tells if we need the peak list (if we want the binary data) for each spectrum, given an MS level
virtual void spectrumListHasSize(std::size_t size)
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)=0
void getQualifiedMs1MassSpectrumByPrecursorId(const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, const SpectrumDescr &spectrum_descr, bool want_binary_data)
SpectrumDescr getSpectrumDescrWithPrecursorId(std::size_t precursor_id)
get an intermediate structure describing a spectrum
void getQualifiedMs2MassSpectrumByPrecursorId(const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, const SpectrumDescr &spectrum_descr, bool want_binary_data)
std::size_t getTotalNumberOfPrecursors() const
get the number of precursors analyzes by PASEF
void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr &filter)
filter interface to apply just after raw MS1 specturm extraction the filter can be a list of filters ...
void setMs2FilterCstSPtr(pappso::FilterInterfaceCstSPtr &filter)
filter interface to apply just after raw MS2 specturm extraction the filter can be a list of filters ...
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
virtual ~TimsMsRunReaderMs2Selected()
virtual bool accept(const QString &file_name) const override
tells if the reader is able to handle this file must be implemented by private MS run reader,...
void setMs2FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter)
void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter)
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data=true) const override
get a QualifiedMassSpectrum class given its scan number
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
TimsMsRunReaderMs2Selected(MsRunIdCstSPtr &msrun_id_csp)
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
virtual void initialize() override
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
std::shared_ptr< const FilterInterface > FilterInterfaceCstSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr