pwizmsrunreader.h
Go to the documentation of this file.
/**
* \file pappsomspp/msrun/private/pwizmsrunreader.h
* \date 29/05/2018
* \author Olivier Langella
* \brief MSrun file reader base on proteowizard library
*/
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/
#pragma once
#include <pwiz/data/msdata/MSData.hpp>
#include <pwiz/data/msdata/MSDataFile.hpp>
#include "../../types.h"
#include "../../msfile/msfileaccessor.h"
#include "../../msfile/msfilereader.h"
namespace pappso
{
class PwizMsRunReader : public MsRunReader
{
friend class MsFileAccessor;
public:
PwizMsRunReader(MsRunIdCstSPtr &msrun_id_csp);
virtual ~PwizMsRunReader();
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 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 hasScanNumbers() const override;
virtual bool releaseDevice() override;
virtual bool acquireDevice() override;
protected:
pwiz::msdata::MSDataPtr msp_msData = nullptr;
virtual void initialize() override;
virtual bool accept(const QString &file_name) const override;
bool
processRetentionTime(pwiz::msdata::Spectrum *spectrum_p,
QualifiedMassSpectrum &qualified_mass_spectrum) const;
bool processDriftTime(pwiz::msdata::Spectrum *spectrum_p,
QualifiedMassSpectrum &qualified_mass_spectrum) const;
QualifiedMassSpectrum qualifiedMassSpectrumFromPwizMSData(
std::size_t spectrum_index, bool want_binary_data, bool &ok) const;
QualifiedMassSpectrum
qualifiedMassSpectrumFromPwizSpectrumPtr(const MassSpectrumId &massSpectrumId,
pwiz::msdata::Spectrum *spectrum_p,
bool want_binary_data,
bool &ok) const;
pwiz::msdata::SpectrumPtr
getPwizSpectrumPtr(pwiz::msdata::SpectrumList *p_spectrum_list,
std::size_t spectrum_index,
bool want_binary_data) const;
private:
bool m_hasScanNumbers = false;
};
} // namespace pappso
// Q_DECLARE_METATYPE(pappso::PwizMsRunReader);
// extern int pwizMsRunReaderMetaTypeId;
pappso::MassSpectrumId
Definition: massspectrumid.h:40
pappso::MsFileAccessor
Definition: msfileaccessor.h:35
pappso::MsRunReader
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
Definition: msrunreader.h:191
pappso::PrecisionBase
Definition: precision.h:44
pappso::PwizMsRunReader
Definition: pwizmsrunreader.h:46
pappso::PwizMsRunReader::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: pwizmsrunreader.cpp:963
pappso::PwizMsRunReader::msp_msData
pwiz::msdata::MSDataPtr msp_msData
Definition: pwizmsrunreader.h:87
pappso::PwizMsRunReader::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: pwizmsrunreader.cpp:795
pappso::PwizMsRunReader::processDriftTime
bool processDriftTime(pwiz::msdata::Spectrum *spectrum_p, QualifiedMassSpectrum &qualified_mass_spectrum) const
Definition: pwizmsrunreader.cpp:290
pappso::PwizMsRunReader::massSpectrumCstSPtr
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
Definition: pwizmsrunreader.cpp:754
pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizMSData
QualifiedMassSpectrum qualifiedMassSpectrumFromPwizMSData(std::size_t spectrum_index, bool want_binary_data, bool &ok) const
Definition: pwizmsrunreader.cpp:678
pappso::PwizMsRunReader::PwizMsRunReader
PwizMsRunReader(MsRunIdCstSPtr &msrun_id_csp)
Definition: pwizmsrunreader.cpp:53
pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr
QualifiedMassSpectrum qualifiedMassSpectrumFromPwizSpectrumPtr(const MassSpectrumId &massSpectrumId, pwiz::msdata::Spectrum *spectrum_p, bool want_binary_data, bool &ok) const
Definition: pwizmsrunreader.cpp:358
pappso::PwizMsRunReader::m_hasScanNumbers
bool m_hasScanNumbers
Definition: pwizmsrunreader.h:113
pappso::PwizMsRunReader::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: pwizmsrunreader.cpp:761
pappso::PwizMsRunReader::hasScanNumbers
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
Definition: pwizmsrunreader.cpp:939
pappso::PwizMsRunReader::processRetentionTime
bool processRetentionTime(pwiz::msdata::Spectrum *spectrum_p, QualifiedMassSpectrum &qualified_mass_spectrum) const
Definition: pwizmsrunreader.cpp:222
pappso::PwizMsRunReader::acquireDevice
virtual bool acquireDevice() override
acquire data back end device
Definition: pwizmsrunreader.cpp:952
pappso::PwizMsRunReader::~PwizMsRunReader
virtual ~PwizMsRunReader()
Definition: pwizmsrunreader.cpp:171
pappso::PwizMsRunReader::initialize
virtual void initialize() override
Definition: pwizmsrunreader.cpp:65
pappso::PwizMsRunReader::readSpectrumCollection
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
Definition: pwizmsrunreader.cpp:787
pappso::PwizMsRunReader::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: pwizmsrunreader.cpp:732
pappso::PwizMsRunReader::spectrumListSize
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
Definition: pwizmsrunreader.cpp:933
pappso::PwizMsRunReader::getPwizSpectrumPtr
pwiz::msdata::SpectrumPtr getPwizSpectrumPtr(pwiz::msdata::SpectrumList *p_spectrum_list, std::size_t spectrum_index, bool want_binary_data) const
Definition: pwizmsrunreader.cpp:177
pappso::PwizMsRunReader::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: pwizmsrunreader.cpp:945
pappso::PwizMsRunReader::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: pwizmsrunreader.cpp:974
pappso::PwizMsRunReader::massSpectrumSPtr
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
Definition: pwizmsrunreader.cpp:747
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:85
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition: msrunreader.h:56
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:44
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:55
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:54
pappso::XicCoordSPtr
std::shared_ptr< XicCoord > XicCoordSPtr
Definition: xiccoord.h:41