libpappsomspp
Library for mass spectrometry
|
Go to the documentation of this file.
31 #include "../../exception/exceptionnotimplemented.h"
33 #include <QtConcurrent/QtConcurrent>
54 mpa_timsData =
new TimsData(mcsp_msRunId.get()->getFileName());
67 QObject::tr(
"ERROR in TimsMsRunReaderMs2::setMs2FilterCstSPtr "
68 "mpa_timsData is null"));
82 QObject::tr(
"ERROR in TimsMsRunReaderMs2::setMs1FilterCstSPtr "
83 "mpa_timsData is null"));
90 qDebug() << file_name;
115 bool want_binary_data)
const
118 std::size_t precursor_index = (spectrum_index / 2) + 1;
120 if(spectrum_index % 2 == 0)
126 spectrum_index, precursor_index, want_binary_data);
133 return mass_spectrum_ms1;
140 mass_spectrum_ms2, spectrum_index, precursor_index, want_binary_data);
147 return mass_spectrum_ms2;
174 std::size_t process_list_size = 300;
180 bool want_binary_data;
183 for(std::size_t i = 0; i < spectrum_list_size; i += process_list_size)
190 qDebug() <<
"The operation was cancelled. Breaking the loop.";
193 std::vector<tmp_item> item_list;
194 for(std::size_t iter = 0;
195 (iter < process_list_size) && ((iter + i) < spectrum_list_size);
199 bool get_data = want_binary_data;
200 if((iter + i) % 2 == 0)
212 qDebug() << item_list.size();
215 QtConcurrent::blockingMap(
216 item_list.begin(), item_list.end(), [
this](tmp_item &one_item) {
217 qDebug() << one_item.iter;
218 one_item.qualified_mass_spectrum =
219 qualifiedMassSpectrum(one_item.iter, one_item.want_binary_data);
225 qDebug() << item_list.size();
226 for(
auto &item : item_list)
238 for(std::size_t iter = 0; iter < spectrum_list_size; iter++)
245 qDebug() <<
"The operation was cancelled. Breaking the loop.";
248 bool get_data = want_binary_data;
void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter)
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
MassSpectrumSPtr getMassSpectrumSPtr() const
Get the MassSpectrumSPtr.
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data=true) const override
get a QualifiedMassSpectrum class given its scan number
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
void setMs2FilterCstSPtr(pappso::FilterInterfaceCstSPtr &filter)
virtual void initialize() override
QualifiedMassSpectrum getQualifiedMs1MassSpectrumByPrecursorId(std::size_t ms2_index, std::size_t precursor_index, bool want_binary_data)
virtual void spectrumListHasSize(std::size_t size)
virtual bool isReadAhead() const
tells if we want to read ahead spectrum
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)=0
std::shared_ptr< const FilterInterface > FilterInterfaceCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr &filter)
virtual bool shouldStop()
virtual void loadingEnded()
const MsRunIdCstSPtr & getMsRunId() const
Class representing a fully specified mass spectrum.
TimsMsRunReaderMs2(MsRunIdCstSPtr &msrun_id_csp)
virtual bool needPeakList() const =0
tells if we need the peak list (if we want the binary data) for each spectrum
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
void setMassSpectrumId(const MassSpectrumId &iD)
Set the MassSpectrumId.
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
std::size_t getTotalNumberOfPrecursors() const
get the number of precursors analyzes by PASEF
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
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
virtual ~TimsMsRunReaderMs2()
void getQualifiedMs2MassSpectrumByPrecursorId(QualifiedMassSpectrum &mass_spectrum, std::size_t ms2_index, std::size_t precursor_index, bool want_binary_data)
void setMsRunId(MsRunIdCstSPtr other)
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
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,...
MSrun file reader for native Bruker TimsTOF specialized for MS2 purpose.
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
interface to collect spectrums from the MsRunReader class
void setMs2FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter)
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file