libpappsomspp
Library for mass spectrometry
|
Go to the documentation of this file.
31 #include "../../exception/exceptionnotimplemented.h"
33 #include <QtConcurrent/QtConcurrent>
54 msp_timsData = std::make_shared<TimsData>(mcsp_msRunId.get()->getFileName());
68 QObject::tr(
"ERROR in TimsMsRunReaderMs2::setMs2BuiltinCentroid "
69 "msp_timsData is null"));
84 QObject::tr(
"ERROR in TimsMsRunReaderMs2::setMs2FilterCstSPtr "
85 "msp_timsData is null"));
100 QObject::tr(
"ERROR in TimsMsRunReaderMs2::setMs1FilterCstSPtr "
101 "msp_timsData is null"));
108 qDebug() << file_name;
133 bool want_binary_data)
const
136 std::size_t precursor_index = (spectrum_index / 2) + 1;
138 if(spectrum_index % 2 == 0)
144 spectrum_index, precursor_index, want_binary_data);
151 return mass_spectrum_ms1;
158 mass_spectrum_ms2, spectrum_index, precursor_index, want_binary_data);
165 return mass_spectrum_ms2;
192 std::size_t process_list_size = 300;
198 bool want_binary_data;
201 for(std::size_t i = 0; i < spectrum_list_size; i += process_list_size)
208 qDebug() <<
"The operation was cancelled. Breaking the loop.";
211 std::vector<tmp_item> item_list;
212 for(std::size_t iter = 0;
213 (iter < process_list_size) && ((iter + i) < spectrum_list_size);
217 bool get_data = want_binary_data;
218 if((iter + i) % 2 == 0)
230 qDebug() << item_list.size();
233 QtConcurrent::blockingMap(
234 item_list.begin(), item_list.end(), [
this](tmp_item &one_item) {
235 qDebug() << one_item.iter;
236 one_item.qualified_mass_spectrum =
237 qualifiedMassSpectrum(one_item.iter, one_item.want_binary_data);
243 qDebug() << item_list.size();
244 for(
auto &item : item_list)
256 for(std::size_t iter = 0; iter < spectrum_list_size; iter++)
263 qDebug() <<
"The operation was cancelled. Breaking the loop.";
266 bool get_data = want_binary_data;
295 return (
msp_timsData->getTotalNumberOfPrecursors() * 2);
326 std::vector<std::size_t>
332 return msp_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
virtual void initialize() override
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 and changes multichar...
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 setMs2BuiltinCentroid(bool centroid)
enable or disable simple centroid filter on raw tims data for MS2
bool m_builtinMs2Centroid
enable builtin centroid on raw tims integers by default
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.
virtual TimsDataSp getTimsDataSPtr()
give an access to the underlying raw data pointer
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
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.
std::shared_ptr< TimsData > TimsDataSp
shared pointer on a TimsData object
virtual ~TimsMsRunReaderMs2()
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