Loading...
Searching...
No Matches
msrunpeptidelist.h
Go to the documentation of this file.
/**
* \file pappsomspp/masschroq/msrunpeptidelist.h
* \date 25/09/2024
* \author Olivier Langella
* \brief msrun model including fragmented peptides 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/>.
*
******************************************************************************/
#pragma once
#include "msrun.h"
#include "peptidelabel.h"
#include "peptideobservation.h"
#include "peptidemeasurements.h"
#include "mbrpeptidemeasurements.h"
#include <cstdint>
#include "alignmentmethod.h"
#include "quantificationmethod.h"
#include "pappsomspp/core/msrun/alignment/msrunretentiontime.h"
namespace pappso::masschroq
{
class CborOutputStream;
class MsRunPeptideList;
typedef std::shared_ptr<MsRunPeptideList> MsRunPeptideListSp;
/**
* group together an msrun, available peptide observations, and peptide
* measurements
*/
class MsRunPeptideList
{
public:
/**
* Default constructor
*/
MsRunPeptideList(MsRunSp msrun);
/**
* Copy constructor
*
* @param other TODO
*/
MsRunPeptideList(const MsRunPeptideList &other);
/**
* Destructor
*/
virtual ~MsRunPeptideList();
void addPeptideSpectrumIndexObservation(PeptideSp peptide_sp,
PeptideLabel *p_label,
std::size_t spectrum_index,
std::uint8_t charge);
void addPeptideScanNumberObservation(PeptideSp peptide_sp,
PeptideLabel *p_label,
std::size_t spectrum_index,
std::uint8_t charge);
void quantify(const MsRunGroup *msrun_group_p,
const QString &tmp_dir,
pappso::UiMonitorInterface &m_uiMonitor,
const QuantificationMethodSp &quantification_method);
void quantifyMatchBetweenRun(const MsRunGroup *msrun_group_p,
const std::vector<PeptideSp> &peptide_mbr_list,
const QString &tmp_dir,
pappso::UiMonitorInterface &m_uiMonitor,
const QuantificationMethodSp &quantification_method);
const MsRunSp &getMsRunSp() const;
/** flush (remove) transient chromatogram traces after peak detection to save
* space in memory
*/
void flushChromatogramTraces();
/** @brief clear all measurements MBR or not
* Clearing measurements also removes every chromatogram
*/
void clearMeasurements();
/** @brief build a retention time vector with seamarks using MS2 best
* intensities
* @param alignment_method parameters to use for alignment
*/
std::shared_ptr<pappso::MsRunRetentionTime<QString>> &
buildMsRunRetentionTimeSpOnPeptideObservations(const AlignmentMethodSp &alignment_method);
/** @brief collect peak retention times
* collect all quantified peptides retention times and convert it to the
* reference time to store it for each peptides
*/
void collectPeptidePeakRetentionTime(
const pappso::MsRunRetentionTime<QString> *msrun_retention_time_reference_p) const;
/** @brief collect ms2 retention times
* collect all MS2 events retention times and convert it to the
* reference time to store it for each peptides
*/
void collectPeptideMs2RetentionTime(
const pappso::MsRunRetentionTime<QString> *msrun_retention_time_reference_p) const;
const pappso::MsRunRetentionTime<QString> *getMsRunRetentionTimeConstPtr() const;
pappso::MsRunRetentionTime<QString> *getMsRunRetentionTimePtr() const;
const std::vector<PeptideMeasurementsSp> &getPeptideMeasurementsList() const;
const std::vector<MbrPeptideMeasurementsSp> &getMbrPeptideMeasurementsList() const;
private:
std::vector<pappso::XicCoordSPtr>
buildXicCoordList(const MsRunGroup *msrun_group_p,
const QuantificationMethodSp &quantification_method);
void detectQuantifyPeaks(pappso::UiMonitorInterface &m_uiMonitor,
const QuantificationMethodSp &quantification_method);
void mbrDetectQuantifyPeaks(pappso::UiMonitorInterface &m_uiMonitor,
const QuantificationMethodSp &quantification_method);
void addPeptideObservation2XicCoordList(const MsRunGroup *msrun_group_p,
const QuantificationMethodSp &quantification_method,
const PeptideObservationSp &peptide_events_sp,
std::vector<pappso::XicCoordSPtr> &xic_coord_list);
void addMbrPeptideMeasurementsSp2XicCoordList(const MsRunGroup *msrun_group_p,
const QuantificationMethodSp &quantification_method,
const PeptideSp &peptide,
std::vector<pappso::XicCoordSPtr> &xic_coord_list);
private:
MsRunSp msp_msRun;
std::map<Peptide *, PeptideObservationSp> m_peptideObservationList;
std::vector<PeptideMeasurementsSp> m_peptideMeasurementsList;
std::shared_ptr<pappso::MsRunRetentionTime<QString>> msp_msRunRetentionTime = nullptr;
std::vector<MbrPeptideMeasurementsSp> m_mbrPeptideMeasurementsList;
};
} // namespace pappso::masschroq
alignmentmethod.h
pappso::MsRunRetentionTime
Definition msrunretentiontime.h:43
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::masschroq::CborOutputStream
Definition cboroutputstream.h:51
pappso::masschroq::MsRunGroup
Definition msrungroup.h:48
pappso::masschroq::MsRunPeptideList
Definition msrunpeptidelist.h:54
pappso::masschroq::MsRunPeptideList::m_peptideMeasurementsList
std::vector< PeptideMeasurementsSp > m_peptideMeasurementsList
Definition msrunpeptidelist.h:164
pappso::masschroq::MsRunPeptideList::addMbrPeptideMeasurementsSp2XicCoordList
void addMbrPeptideMeasurementsSp2XicCoordList(const MsRunGroup *msrun_group_p, const QuantificationMethodSp &quantification_method, const PeptideSp &peptide, std::vector< pappso::XicCoordSPtr > &xic_coord_list)
Definition msrunpeptidelist.cpp:438
pappso::masschroq::MsRunPeptideList::quantify
void quantify(const MsRunGroup *msrun_group_p, const QString &tmp_dir, pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
Definition msrunpeptidelist.cpp:92
pappso::masschroq::MsRunPeptideList::detectQuantifyPeaks
void detectQuantifyPeaks(pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
Definition msrunpeptidelist.cpp:193
pappso::masschroq::MsRunPeptideList::quantifyMatchBetweenRun
void quantifyMatchBetweenRun(const MsRunGroup *msrun_group_p, const std::vector< PeptideSp > &peptide_mbr_list, const QString &tmp_dir, pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
Definition msrunpeptidelist.cpp:347
pappso::masschroq::MsRunPeptideList::m_peptideObservationList
std::map< Peptide *, PeptideObservationSp > m_peptideObservationList
Definition msrunpeptidelist.h:162
pappso::masschroq::MsRunPeptideList::getMbrPeptideMeasurementsList
const std::vector< MbrPeptideMeasurementsSp > & getMbrPeptideMeasurementsList() const
Definition msrunpeptidelist.cpp:507
pappso::masschroq::MsRunPeptideList::getMsRunSp
const MsRunSp & getMsRunSp() const
Definition msrunpeptidelist.cpp:222
pappso::masschroq::MsRunPeptideList::msp_msRunRetentionTime
std::shared_ptr< pappso::MsRunRetentionTime< QString > > msp_msRunRetentionTime
Definition msrunpeptidelist.h:166
pappso::masschroq::MsRunPeptideList::m_mbrPeptideMeasurementsList
std::vector< MbrPeptideMeasurementsSp > m_mbrPeptideMeasurementsList
Definition msrunpeptidelist.h:169
pappso::masschroq::MsRunPeptideList::msp_msRun
MsRunSp msp_msRun
Definition msrunpeptidelist.h:160
pappso::masschroq::MsRunPeptideList::MsRunPeptideList
MsRunPeptideList(MsRunSp msrun)
Definition msrunpeptidelist.cpp:34
pappso::masschroq::MsRunPeptideList::buildXicCoordList
std::vector< pappso::XicCoordSPtr > buildXicCoordList(const MsRunGroup *msrun_group_p, const QuantificationMethodSp &quantification_method)
Definition msrunpeptidelist.cpp:154
pappso::masschroq::MsRunPeptideList::~MsRunPeptideList
virtual ~MsRunPeptideList()
Definition msrunpeptidelist.cpp:45
pappso::masschroq::MsRunPeptideList::collectPeptideMs2RetentionTime
void collectPeptideMs2RetentionTime(const pappso::MsRunRetentionTime< QString > *msrun_retention_time_reference_p) const
collect ms2 retention times collect all MS2 events retention times and convert it to the reference ti...
Definition msrunpeptidelist.cpp:320
pappso::masschroq::MsRunPeptideList::addPeptideScanNumberObservation
void addPeptideScanNumberObservation(PeptideSp peptide_sp, PeptideLabel *p_label, std::size_t spectrum_index, std::uint8_t charge)
Definition msrunpeptidelist.cpp:71
pappso::masschroq::MsRunPeptideList::buildMsRunRetentionTimeSpOnPeptideObservations
std::shared_ptr< pappso::MsRunRetentionTime< QString > > & buildMsRunRetentionTimeSpOnPeptideObservations(const AlignmentMethodSp &alignment_method)
build a retention time vector with seamarks using MS2 best intensities
Definition msrunpeptidelist.cpp:243
pappso::masschroq::MsRunPeptideList::flushChromatogramTraces
void flushChromatogramTraces()
Definition msrunpeptidelist.cpp:228
pappso::masschroq::MsRunPeptideList::addPeptideObservation2XicCoordList
void addPeptideObservation2XicCoordList(const MsRunGroup *msrun_group_p, const QuantificationMethodSp &quantification_method, const PeptideObservationSp &peptide_events_sp, std::vector< pappso::XicCoordSPtr > &xic_coord_list)
Definition msrunpeptidelist.cpp:174
pappso::masschroq::MsRunPeptideList::getMsRunRetentionTimePtr
pappso::MsRunRetentionTime< QString > * getMsRunRetentionTimePtr() const
Definition msrunpeptidelist.cpp:490
pappso::masschroq::MsRunPeptideList::addPeptideSpectrumIndexObservation
void addPeptideSpectrumIndexObservation(PeptideSp peptide_sp, PeptideLabel *p_label, std::size_t spectrum_index, std::uint8_t charge)
Definition msrunpeptidelist.cpp:50
pappso::masschroq::MsRunPeptideList::mbrDetectQuantifyPeaks
void mbrDetectQuantifyPeaks(pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
Definition msrunpeptidelist.cpp:458
pappso::masschroq::MsRunPeptideList::clearMeasurements
void clearMeasurements()
clear all measurements MBR or not Clearing measurements also removes every chromatogram
Definition msrunpeptidelist.cpp:513
pappso::masschroq::MsRunPeptideList::getPeptideMeasurementsList
const std::vector< PeptideMeasurementsSp > & getPeptideMeasurementsList() const
Definition msrunpeptidelist.cpp:501
pappso::masschroq::MsRunPeptideList::getMsRunRetentionTimeConstPtr
const pappso::MsRunRetentionTime< QString > * getMsRunRetentionTimeConstPtr() const
Definition msrunpeptidelist.cpp:495
pappso::masschroq::MsRunPeptideList::collectPeptidePeakRetentionTime
void collectPeptidePeakRetentionTime(const pappso::MsRunRetentionTime< QString > *msrun_retention_time_reference_p) const
collect peak retention times collect all quantified peptides retention times and convert it to the re...
Definition msrunpeptidelist.cpp:292
pappso::masschroq::PeptideLabel
Definition peptidelabel.h:40
mbrpeptidemeasurements.h
msrun.h
msrunretentiontime.h
pappso::masschroq
Definition alignmentmethod.h:38
pappso::masschroq::QuantificationMethodSp
std::shared_ptr< QuantificationMethod > QuantificationMethodSp
Definition quantificationmethod.h:46
pappso::masschroq::MsRunPeptideListSp
std::shared_ptr< MsRunPeptideList > MsRunPeptideListSp
Definition msrunpeptidelist.h:47
pappso::masschroq::AlignmentMethodSp
std::shared_ptr< AlignmentMethod > AlignmentMethodSp
Definition alignmentmethod.h:42
pappso::masschroq::PeptideSp
std::shared_ptr< Peptide > PeptideSp
Definition peptide.h:46
pappso::masschroq::PeptideObservationSp
std::shared_ptr< PeptideObservation > PeptideObservationSp
Definition peptidemeasurements.h:45
pappso::masschroq::MsRunSp
std::shared_ptr< MsRun > MsRunSp
Definition msrun.h:44
peptidelabel.h
peptidemeasurements.h
peptideobservation.h
quantificationmethod.h