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());
68 QObject::tr(
"ERROR in TimsMsRunReaderMs2::setMs2FilterCstSPtr "
69 "mpa_timsData is null"));
84 QObject::tr(
"ERROR in TimsMsRunReaderMs2::setMs1FilterCstSPtr "
85 "mpa_timsData is null"));
92 qDebug() << file_name;
117 bool want_binary_data)
const
120 std::size_t precursor_index = (spectrum_index / 2) + 1;
122 if(spectrum_index % 2 == 0)
128 spectrum_index, precursor_index, want_binary_data);
135 return mass_spectrum_ms1;
142 mass_spectrum_ms2, spectrum_index, precursor_index, want_binary_data);
149 return mass_spectrum_ms2;
176 std::size_t process_list_size = 300;
182 bool want_binary_data;
185 for(std::size_t i = 0; i < spectrum_list_size; i += process_list_size)
192 qDebug() <<
"The operation was cancelled. Breaking the loop.";
195 std::vector<tmp_item> item_list;
196 for(std::size_t iter = 0;
197 (iter < process_list_size) && ((iter + i) < spectrum_list_size);
201 bool get_data = want_binary_data;
202 if((iter + i) % 2 == 0)
214 qDebug() << item_list.size();
217 QtConcurrent::blockingMap(
218 item_list.begin(), item_list.end(), [
this](tmp_item &one_item) {
219 qDebug() << one_item.iter;
220 one_item.qualified_mass_spectrum =
221 qualifiedMassSpectrum(one_item.iter, one_item.want_binary_data);
227 qDebug() << item_list.size();
228 for(
auto &item : item_list)
240 for(std::size_t iter = 0; iter < spectrum_list_size; iter++)
247 qDebug() <<
"The operation was cancelled. Breaking the loop.";
250 bool get_data = want_binary_data;
310 std::vector<std::size_t>
316 return mpa_timsData->getPrecursorsFromMzRtCharge(charge, mz_val, rt_sec, k0);
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
pappso::FilterInterfaceCstSPtr msp_ms1Filter
pappso::FilterInterfaceCstSPtr msp_ms2Filter
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)=0
std::shared_ptr< const FilterInterface > FilterInterfaceCstSPtr
virtual std::vector< std::size_t > getPrecursorsIDFromMzRt(int charge, double mz_val, double rt_sec, double k0)
Get all the precursors id which match the values.
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr &filter)
virtual bool shouldStop()
virtual void loadingEnded()
virtual bool acquireDevice() override
acquire data back end device
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
virtual bool releaseDevice() override
release data back end device if a the data back end is released, the developper has to use acquireDev...
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