31 #include "../../exception/exceptionnotimplemented.h"
33 #include <QtConcurrent/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;
123 if(spectrum_index % 2 == 0)
129 spectrum_index, precursor_index, want_binary_data);
136 return mass_spectrum_ms1;
143 mass_spectrum_ms2, spectrum_index, precursor_index, want_binary_data);
150 return mass_spectrum_ms2;
171 std::vector<size_t> selected_precursor{63905,
194 std::size_t process_list_size = 300;
200 bool want_binary_data;
203 for(std::size_t i = 0; i < spectrum_list_size; i += process_list_size)
211 qDebug() <<
"The operation was cancelled. Breaking the loop.";
214 std::vector<tmp_item> item_list;
215 for(std::size_t iter = 0;
216 (iter < process_list_size) && ((iter + i) < spectrum_list_size);
219 if(std::find(selected_precursor.begin(),
220 selected_precursor.end(),
221 iter + i) != selected_precursor.end())
223 bool get_data = want_binary_data;
224 if((iter + i) % 2 == 0)
237 qDebug() << item_list.size();
240 QtConcurrent::blockingMap(
241 item_list.begin(), item_list.end(), [
this](tmp_item &one_item) {
242 qDebug() << one_item.iter;
243 one_item.qualified_mass_spectrum =
244 qualifiedMassSpectrum(one_item.iter, one_item.want_binary_data);
250 qDebug() << item_list.size();
251 for(
auto &item : item_list)
264 for(std::size_t iter = 0; iter < spectrum_list_size; iter++)
271 qDebug() <<
"The operation was cancelled. Breaking the loop.";
274 bool get_data = want_binary_data;
void setMsRunId(MsRunIdCstSPtr other)
const MsRunIdCstSPtr & getMsRunId() const
Class representing a fully specified mass spectrum.
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
void setMassSpectrumId(const MassSpectrumId &iD)
Set the MassSpectrumId.
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
QualifiedMassSpectrum getQualifiedMs1MassSpectrumByPrecursorId(std::size_t ms2_index, std::size_t precursor_index, bool want_binary_data)
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 ...
void getQualifiedMs2MassSpectrumByPrecursorId(QualifiedMassSpectrum &mass_spectrum, std::size_t ms2_index, std::size_t precursor_index, bool want_binary_data)
std::size_t getTotalNumberOfPrecursors() const
get the number of precursors analyzes by PASEF
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