Loading...
Searching...
No Matches
timsmsrunreaderms2.h
Go to the documentation of this file.
/**
* \file pappsomspp/msrun/private/timsmsrunreaderms2.h
* \date 10/09/2019
* \author Olivier Langella
* \brief MSrun file reader for native Bruker TimsTOF specialized for MS2
* purpose
*/
/*******************************************************************************
* Copyright (c) 2019 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/>.
*
******************************************************************************/
#pragma once
#include "../../types.h"
#include "pappsomspp/core/msrun/private/timsmsrunreaderbase.h"
namespace pappso
{
class PMSPP_LIB_DECL TimsMsRunReaderMs2 : public TimsMsRunReaderBase
{
friend class MsFileAccessor;
/**
* @todo write docs
*/
public:
TimsMsRunReaderMs2(MsRunIdCstSPtr &msrun_id_csp);
TimsMsRunReaderMs2(const TimsMsRunReaderBase &msrun_reader_base);
virtual ~TimsMsRunReaderMs2();
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 hasScanNumbers() const override;
void setMs2FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter);
void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter);
/** @brief enable or disable simple centroid filter on raw tims data for MS2
*/
void setMs2BuiltinCentroid(bool centroid);
/** @brief Get all the precursors id which match the values
* @return list of precursors Ids
*/
virtual std::vector<std::size_t>
getPrecursorsIDFromMzRt(int charge, double mz_val, double rt_sec, double k0);
virtual bool releaseDevice() override;
virtual bool acquireDevice() override;
/** @brief give an access to the underlying raw data pointer
*/
virtual TimsDataSp getTimsDataSPtr() override;
/** @brief retention timeline
* get retention times along the MSrun in seconds
* @return vector of retention times (seconds)
*/
virtual std::vector<double> getRetentionTimeLine() override;
virtual Trace getTicChromatogram() override;
virtual std::size_t
spectrumStringIdentifier2SpectrumIndex(const QString &spectrum_identifier) override;
protected:
virtual void initialize() override;
virtual bool accept(const QString &file_name) const override;
TimsDdaPrecursors *mp_timsDdaPrecursors = nullptr;
private:
TimsDataSp msp_timsData = nullptr;
pappso::FilterInterfaceCstSPtr msp_ms1Filter;
pappso::FilterInterfaceCstSPtr msp_ms2Filter;
/** @brief enable builtin centroid on raw tims integers by default
*/
bool m_builtinMs2Centroid = true;
};
} // namespace pappso
pappso::MsRunReadConfig
Definition msrunreadconfig.h:62
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
pappso::TimsDdaPrecursors
Definition timsddaprecursors.h:38
pappso::TimsMsRunReaderBase::TimsMsRunReaderBase
TimsMsRunReaderBase(MsRunIdCstSPtr &msrun_id_csp)
Definition timsmsrunreaderbase.cpp:38
pappso::TimsMsRunReaderMs2::setMs2FilterCstSPtr
void setMs2FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter)
Definition timsmsrunreaderms2.cpp:92
pappso::TimsMsRunReaderMs2::setMs1FilterCstSPtr
void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter)
Definition timsmsrunreaderms2.cpp:108
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:148
pappso::TimsMsRunReaderMs2::MsFileAccessor
friend class MsFileAccessor
Definition timsmsrunreaderms2.h:40
pappso::TimsMsRunReaderMs2::TimsMsRunReaderMs2
TimsMsRunReaderMs2(MsRunIdCstSPtr &msrun_id_csp)
Definition timsmsrunreaderms2.cpp:39
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:296
pappso::TimsMsRunReaderMs2::msp_timsData
TimsDataSp msp_timsData
Definition timsmsrunreaderms2.h:117
pappso::TimsMsRunReaderMs2::massSpectrumSPtr
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
Definition timsmsrunreaderms2.cpp:132
pappso::TimsMsRunReaderMs2::msp_ms2Filter
pappso::FilterInterfaceCstSPtr msp_ms2Filter
Definition timsmsrunreaderms2.h:120
pappso::TimsMsRunReaderMs2::mp_timsDdaPrecursors
TimsDdaPrecursors * mp_timsDdaPrecursors
Definition timsmsrunreaderms2.h:114
pappso::TimsMsRunReaderMs2::spectrumListSize
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
Definition timsmsrunreaderms2.cpp:245
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:259
pappso::TimsMsRunReaderMs2::msp_ms1Filter
pappso::FilterInterfaceCstSPtr msp_ms1Filter
Definition timsmsrunreaderms2.h:119
pappso::TimsMsRunReaderMs2::readSpectrumCollection
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
Definition timsmsrunreaderms2.cpp:204
pappso::TimsMsRunReaderMs2::getPrecursorsIDFromMzRt
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.
Definition timsmsrunreaderms2.cpp:279
pappso::TimsMsRunReaderMs2::initialize
virtual void initialize() override
Definition timsmsrunreaderms2.cpp:60
pappso::TimsMsRunReaderMs2::getTimsDataSPtr
virtual TimsDataSp getTimsDataSPtr() override
give an access to the underlying raw data pointer
Definition timsmsrunreaderms2.cpp:288
pappso::TimsMsRunReaderMs2::getRetentionTimeLine
virtual std::vector< double > getRetentionTimeLine() override
retention timeline get retention times along the MSrun in seconds
Definition timsmsrunreaderms2.cpp:322
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:340
pappso::TimsMsRunReaderMs2::m_builtinMs2Centroid
bool m_builtinMs2Centroid
enable builtin centroid on raw tims integers by default
Definition timsmsrunreaderms2.h:123
pappso::TimsMsRunReaderMs2::getTicChromatogram
virtual Trace getTicChromatogram() override
get a TIC chromatogram
Definition timsmsrunreaderms2.cpp:328
pappso::TimsMsRunReaderMs2::setMs2BuiltinCentroid
void setMs2BuiltinCentroid(bool centroid)
enable or disable simple centroid filter on raw tims data for MS2
Definition timsmsrunreaderms2.cpp:76
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:210
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:218
pappso::TimsMsRunReaderMs2::acquireDevice
virtual bool acquireDevice() override
acquire data back end device
Definition timsmsrunreaderms2.cpp:266
pappso::TimsMsRunReaderMs2::hasScanNumbers
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
Definition timsmsrunreaderms2.cpp:252
pappso::TimsMsRunReaderMs2::massSpectrumCstSPtr
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
Definition timsmsrunreaderms2.cpp:140
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:124
pappso::TimsMsRunReaderMs2::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 timsmsrunreaderms2.cpp:314
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:152
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
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::TimsDataSp
std::shared_ptr< TimsData > TimsDataSp
shared pointer on a TimsData object
Definition timsdata.h:54
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition massspectrum.h:54
pappso::FilterInterfaceCstSPtr
std::shared_ptr< const FilterInterface > FilterInterfaceCstSPtr
Definition filterinterface.h:47
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
timsmsrunreaderbase.h
types.h