29 #include "../../exception/exceptionnotimplemented.h"
37 qDebug() <<
"Now initializing the TimsFramesMsRunReader.";
54 QObject::tr(
"ERROR in TimsFramesMsRunReader::initialize "
55 "msp_timsData is null for MsRunId %1")
64 qDebug() << file_name;
71 [[maybe_unused]] std::size_t spectrum_index)
74 QObject::tr(
"Not yet implemented in TimsFramesMsRunReader %1.\n")
84 return msp_timsData->getMassSpectrumCstSPtrByRawIndex(spectrum_index);
90 bool want_binary_data)
const
96 getMsRunId(), mass_spectrum, spectrum_index, want_binary_data);
113 const std::vector<FrameIdDescr> frame_id_descr_list =
118 std::size_t scan_index = 0;
121 std::size_t frames_count =
msp_timsData->getTotalNumberOfFrames();
123 qDebug() <<
"The spectrum list has this much frames:" << frames_count;
129 for(
const FrameIdDescr ¤t_frame : frame_id_descr_list)
132 msp_timsData->getTimsFrameCstSPtrCached(current_frame.m_frameId);
137 quint32 scan_count = tims_frame->getTotalNumberOfScans();
139 Trace spectrum = tims_frame->cumulateScanToTrace(0, scan_count - 1);
150 spectrum_id.
setNativeId(QString(
"frame=%1 index=%2")
151 .arg(current_frame.m_frameId)
161 unsigned int frame_ms_level = tims_frame.get()->getMsLevel();
164 if(frame_ms_level > 1)
175 std::make_shared<MassSpectrum>(spectrum));
179 scan_index += scan_count;
187 [[maybe_unused]]
unsigned int ms_level)
228 std::size_t spectrum_index [[maybe_unused]],
289 Trace tic_chromatogram;
291 const std::vector<FrameIdDescr> frame_descr_list =
297 msp_timsData->getTimsFrameCstSPtrCached(frame_id_descr.m_frameId);
298 std::size_t scan_begin = 0;
299 std::size_t scan_end = tims_frame_csp->getTotalNumberOfScans() - 1;
302 if(tims_frame_csp->getMsLevel() == 1)
305 double rt = tims_frame_csp->getTime();
309 tims_frame_csp->cumulateScansIntensities(scan_begin, scan_end)));
315 return tic_chromatogram;
void setNativeId(const QString &native_id)
void setMsRunId(MsRunIdCstSPtr other)
void setSpectrumIndex(std::size_t index)
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
MsRunIdCstSPtr mcsp_msRunId
const MsRunIdCstSPtr & getMsRunId() const
Class representing a fully specified mass spectrum.
void setDtInMilliSeconds(pappso_double rt)
Set the drift time in milliseconds.
void setMassSpectrumId(const MassSpectrumId &iD)
Set the MassSpectrumId.
void setMsLevel(uint ms_level)
Set the mass spectrum level.
void setMassSpectrumSPtr(MassSpectrumSPtr massSpectrum)
Set the MassSpectrumSPtr.
void setRtInSeconds(pappso_double rt)
Set the retention time in seconds.
void setEmptyMassSpectrum(bool is_empty_mass_spectrum)
interface to collect spectrums from the MsRunReader class
virtual void spectrumListHasSize(std::size_t size)
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)=0
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
virtual pappso::XicCoordSPtr newXicCoordSPtrFromQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum
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
virtual Trace getTicChromatogram() override
get a TIC chromatogram
virtual bool releaseDevice() override
release data back end device if a the data back end is released, the developper has to use acquireDev...
virtual void initialize() override
virtual Trace computeTicChromatogram()
virtual TimsDataSp getTimsDataSPtr()
give an access to the underlying raw data pointer
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
virtual bool acquireDevice() override
acquire data back end device
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,...
virtual ~TimsFramesMsRunReader()
TimsFramesMsRunReader(MsRunIdCstSPtr &msrun_id_csp)
virtual pappso::XicCoordSPtr newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum index
virtual void readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler, unsigned int ms_level) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels
A simple container of DataPoint instances.
size_t append(const DataPoint &data_point)
appends a datapoint and return new size
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< TimsData > TimsDataSp
shared pointer on a TimsData object
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
std::shared_ptr< const TimsFrame > TimsFrameCstSPtr
std::shared_ptr< XicCoord > XicCoordSPtr