Loading...
Searching...
No Matches
bafasciimsrunreader.h
Go to the documentation of this file.
#pragma once
#include "pappsomspp/core/msfile/msfileaccessor.h"
namespace pappso
{
struct PMSPP_LIB_DECL MassSpectrumLineData
{
double retentionTime; // minutes
QString ionizationMode; // + or -
QString ionSourceType; // MALDI or ESI
int msLevel;
QString dash;
QString peakShapeType; // profile or line
std::pair<double, double> mz_range;
std::size_t peakCount;
QStringList peakList;
};
class PMSPP_LIB_DECL BafAsciiMsRunReader : public MsRunReader
{
friend class MsFileAccessor;
public:
BafAsciiMsRunReader(MsRunIdCstSPtr &msrun_id_csp);
virtual ~BafAsciiMsRunReader();
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override;
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override;
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index,
bool want_binary_data = true) const override;
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override;
virtual void readSpectrumCollection2(const MsRunReadConfig &config,
SpectrumCollectionHandlerInterface &handler) override;
virtual pappso::XicCoordSPtr
newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index,
pappso::PrecisionPtr precision) const override;
virtual pappso::XicCoordSPtr
newXicCoordSPtrFromQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &mass_spectrum,
pappso::PrecisionPtr precision) const override;
virtual void readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler,
unsigned int ms_level) override;
virtual std::size_t spectrumListSize() const override;
virtual bool releaseDevice() override;
virtual bool acquireDevice() override;
virtual std::size_t
spectrumStringIdentifier2SpectrumIndex(const QString &spectrum_identifier) override;
protected:
QString m_fileName;
// Set when the accept function is called.
mutable std::size_t m_spectrumCount = 0;
QString craftLineParserRegExpPattern() const;
QRegularExpression craftLineParserRegExp(QString &pattern) const;
bool parseMassSpectrumLine(QString &line,
MassSpectrumLineData &ms_line_data,
QRegularExpression &line_regexp) const;
virtual void initialize() override;
virtual bool accept(const QString &file_name) const override;
QualifiedMassSpectrum qualifiedMassSpectrumFromBafAsciiMSDataFile(std::size_t spectrum_index,
bool want_binary_data) const;
};
} // namespace pappso
CardanoResultCase::line
@ line
Definition cardano.h:42
pappso::BafAsciiMsRunReader::qualifiedMassSpectrumFromBafAsciiMSDataFile
QualifiedMassSpectrum qualifiedMassSpectrumFromBafAsciiMSDataFile(std::size_t spectrum_index, bool want_binary_data) const
Definition bafasciimsrunreader.cpp:297
pappso::BafAsciiMsRunReader::craftLineParserRegExp
QRegularExpression craftLineParserRegExp(QString &pattern) const
Definition bafasciimsrunreader.cpp:99
pappso::BafAsciiMsRunReader::MsFileAccessor
friend class MsFileAccessor
Definition bafasciimsrunreader.h:25
pappso::BafAsciiMsRunReader::readSpectrumCollectionByMsLevel
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
Definition bafasciimsrunreader.cpp:467
pappso::BafAsciiMsRunReader::BafAsciiMsRunReader
BafAsciiMsRunReader(MsRunIdCstSPtr &msrun_id_csp)
Definition bafasciimsrunreader.cpp:27
pappso::BafAsciiMsRunReader::acquireDevice
virtual bool acquireDevice() override
acquire data back end device
Definition bafasciimsrunreader.cpp:663
pappso::BafAsciiMsRunReader::spectrumStringIdentifier2SpectrumIndex
virtual std::size_t spectrumStringIdentifier2SpectrumIndex(const QString &spectrum_identifier) override
if possible, get the spectrum index given a string identifier throw a not found exception if spectrum...
Definition bafasciimsrunreader.cpp:687
pappso::BafAsciiMsRunReader::newXicCoordSPtrFromQualifiedMassSpectrum
virtual pappso::XicCoordSPtr newXicCoordSPtrFromQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum
Definition bafasciimsrunreader.cpp:678
pappso::BafAsciiMsRunReader::accept
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,...
Definition bafasciimsrunreader.cpp:220
pappso::BafAsciiMsRunReader::readSpectrumCollection2
virtual void readSpectrumCollection2(const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
Definition bafasciimsrunreader.cpp:644
pappso::BafAsciiMsRunReader::qualifiedMassSpectrum
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data=true) const override
get a QualifiedMassSpectrum class given its scan number
Definition bafasciimsrunreader.cpp:445
pappso::BafAsciiMsRunReader::readSpectrumCollection
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
Definition bafasciimsrunreader.cpp:460
pappso::BafAsciiMsRunReader::newXicCoordSPtrFromSpectrumIndex
virtual pappso::XicCoordSPtr newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum index
Definition bafasciimsrunreader.cpp:669
pappso::BafAsciiMsRunReader::massSpectrumSPtr
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
Definition bafasciimsrunreader.cpp:283
pappso::BafAsciiMsRunReader::releaseDevice
virtual bool releaseDevice() override
release data back end device if a the data back end is released, the developper has to use acquireDev...
Definition bafasciimsrunreader.cpp:657
pappso::BafAsciiMsRunReader::m_fileName
QString m_fileName
Definition bafasciimsrunreader.h:65
pappso::BafAsciiMsRunReader::massSpectrumCstSPtr
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
Definition bafasciimsrunreader.cpp:290
pappso::BafAsciiMsRunReader::initialize
virtual void initialize() override
Definition bafasciimsrunreader.cpp:37
pappso::BafAsciiMsRunReader::spectrumListSize
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
Definition bafasciimsrunreader.cpp:651
pappso::BafAsciiMsRunReader::parseMassSpectrumLine
bool parseMassSpectrumLine(QString &line, MassSpectrumLineData &ms_line_data, QRegularExpression &line_regexp) const
Definition bafasciimsrunreader.cpp:113
pappso::BafAsciiMsRunReader::craftLineParserRegExpPattern
QString craftLineParserRegExpPattern() const
Definition bafasciimsrunreader.cpp:57
pappso::BafAsciiMsRunReader::m_spectrumCount
std::size_t m_spectrumCount
Definition bafasciimsrunreader.h:68
pappso::MsRunReadConfig
Definition msrunreadconfig.h:62
pappso::MsRunReader::MsRunReader
MsRunReader(const MsRunIdCstSPtr &ms_run_id)
Definition msrunreader.cpp:43
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition qualifiedmassspectrum.h:99
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition spectrumcollectionhandlerinterface.h:52
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
msfileaccessor.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition massspectrum.h:54
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition massspectrum.h:53
pappso::XicCoordSPtr
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44
pappso::MassSpectrumLineData
Definition bafasciimsrunreader.h:11
pappso::MassSpectrumLineData::peakShapeType
QString peakShapeType
Definition bafasciimsrunreader.h:17
pappso::MassSpectrumLineData::dash
QString dash
Definition bafasciimsrunreader.h:16
pappso::MassSpectrumLineData::msLevel
int msLevel
Definition bafasciimsrunreader.h:15
pappso::MassSpectrumLineData::mz_range
std::pair< double, double > mz_range
Definition bafasciimsrunreader.h:18
pappso::MassSpectrumLineData::ionizationMode
QString ionizationMode
Definition bafasciimsrunreader.h:13
pappso::MassSpectrumLineData::ionSourceType
QString ionSourceType
Definition bafasciimsrunreader.h:14
pappso::MassSpectrumLineData::peakList
QStringList peakList
Definition bafasciimsrunreader.h:20
pappso::MassSpectrumLineData::retentionTime
double retentionTime
Definition bafasciimsrunreader.h:12
pappso::MassSpectrumLineData::peakCount
std::size_t peakCount
Definition bafasciimsrunreader.h:19