Loading...
Searching...
No Matches
msrun.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/masschroq/core/msrun.cpp
* \date 24/09/2024
* \author Olivier Langella
* \brief msrun model in masschroqlite
*/
/*******************************************************************************
* Copyright (c) 2024 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of MassChroQ.
*
* MassChroQ 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.
*
* MassChroQ 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 MassChroQ. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include "msrun.h"
#include "pappsomspp/core/pappsoexception.h"
#include "pappsomspp/core/msrun/private/timsmsrunreaderms2.h"
pappso::masschroq::MsRun::MsRun(pappso::MsRunReaderSPtr msrun_reader)
: msp_msRunReader(msrun_reader)
{
pappso::TimsMsRunReaderMs2 *tims2_reader =
dynamic_cast<pappso::TimsMsRunReaderMs2 *>(msp_msRunReader.get());
if(tims2_reader != nullptr)
{
m_hasTimsTofMobilityIndex = true;
}
m_retentionTimeLine = msp_msRunReader.get()->getRetentionTimeLine();
mpa_precursorParser = new PrecursorParser(msp_msRunReader);
pappso::MsRunReadConfig config;
config.setNeedPeakList(false);
config.setMsLevels({2});
qDebug();
// msrunA01.get()->readSpectrumCollection(spectrum_list_reader);
msp_msRunReader.get()->readSpectrumCollection2(config, *mpa_precursorParser);
}
pappso::masschroq::MsRun::~MsRun()
{
delete mpa_precursorParser;
}
const pappso::MsRunReaderSPtr &
pappso::masschroq::MsRun::getMsRunReaderSPtr() const
{
return msp_msRunReader;
}
pappso::MsRunReaderSPtr &
pappso::masschroq::MsRun::getMsRunReaderSPtr()
{
return msp_msRunReader;
}
const pappso::masschroq::PrecursorSp &
pappso::masschroq::MsRun::getPrecursorSPtrByScanNumber(std::size_t scan_number) const
{
std::size_t spectrum_index = msp_msRunReader.get()->scanNumber2SpectrumIndex(scan_number);
return mpa_precursorParser->getPrecursorSPtrBySpectrumIndex(spectrum_index);
}
const pappso::masschroq::PrecursorSp &
pappso::masschroq::MsRun::getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const
{
return mpa_precursorParser->getPrecursorSPtrBySpectrumIndex(spectrum_index);
}
const std::vector<double> &
pappso::masschroq::MsRun::getRetentionTimeLine() const
{
return m_retentionTimeLine;
}
bool
pappso::masschroq::MsRun::hasTimsTofMobilityIndex() const
{
return m_hasTimsTofMobilityIndex;
}
pappso::MsRunReadConfig
Definition msrunreadconfig.h:62
pappso::MsRunReadConfig::setNeedPeakList
void setNeedPeakList(bool need_peak_list)
Definition msrunreadconfig.cpp:173
pappso::MsRunReadConfig::setMsLevels
void setMsLevels(std::vector< std::size_t > ms_levels)
Definition msrunreadconfig.cpp:89
pappso::TimsMsRunReaderMs2
Definition timsmsrunreaderms2.h:39
pappso::masschroq::MsRun::MsRun
MsRun(pappso::MsRunReaderSPtr msrun_reader)
Definition msrun.cpp:35
pappso::masschroq::MsRun::getMsRunReaderSPtr
const pappso::MsRunReaderSPtr & getMsRunReaderSPtr() const
Definition msrun.cpp:63
pappso::masschroq::MsRun::hasTimsTofMobilityIndex
bool hasTimsTofMobilityIndex() const
Definition msrun.cpp:94
pappso::masschroq::MsRun::mpa_precursorParser
PrecursorParser * mpa_precursorParser
Definition msrun.h:83
pappso::masschroq::MsRun::getPrecursorSPtrBySpectrumIndex
const PrecursorSp & getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const
Definition msrun.cpp:82
pappso::masschroq::MsRun::m_retentionTimeLine
std::vector< double > m_retentionTimeLine
Definition msrun.h:85
pappso::masschroq::MsRun::getPrecursorSPtrByScanNumber
const PrecursorSp & getPrecursorSPtrByScanNumber(std::size_t scan_number) const
Definition msrun.cpp:76
pappso::masschroq::MsRun::~MsRun
virtual ~MsRun()
Definition msrun.cpp:57
pappso::masschroq::MsRun::m_hasTimsTofMobilityIndex
bool m_hasTimsTofMobilityIndex
Definition msrun.h:87
pappso::masschroq::MsRun::msp_msRunReader
pappso::MsRunReaderSPtr msp_msRunReader
Definition msrun.h:75
pappso::masschroq::MsRun::getRetentionTimeLine
const std::vector< double > & getRetentionTimeLine() const
Definition msrun.cpp:88
pappso::masschroq::PrecursorParser
Definition precursorparser.h:41
msrun.h
pappso::masschroq::PrecursorSp
std::shared_ptr< Precursor > PrecursorSp
Definition precursor.h:39
pappso::MsRunReaderSPtr
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition msrunreader.h:57
pappsoexception.h
timsmsrunreaderms2.h