libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
peptideobservation.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/masschroq/peptideobservation.cpp
3 * \date 24/09/2024
4 * \author Olivier Langella
5 * \brief peptide model in masschroqlite
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2024 Olivier Langella
10 *<Olivier.Langella@universite-paris-saclay.fr>.
11 *
12 * This file is part of MassChroQ.
13 *
14 * MassChroQ is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * MassChroQ is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with MassChroQ. If not, see <http://www.gnu.org/licenses/>.
26 *
27 ******************************************************************************/
28
29
30#include "peptideobservation.h"
32
33
38
39
45
49
50void
56std::vector<std::uint8_t>
58{
59 std::vector<std::uint8_t> charge_list;
60 for(auto &observation : m_observationList)
61 {
62 charge_list.push_back(observation.m_charge);
63 }
64 std::sort(charge_list.begin(), charge_list.end());
65
66 charge_list.erase(std::unique(charge_list.begin(), charge_list.end()), charge_list.end());
67 return charge_list;
68}
69
75
76double
78{
79 double best_rt = 0;
80 double intensity = -1;
81 for(auto &observation : m_observationList)
82 {
83 if(observation.msp_precursor.get()->getIntensity() > intensity)
84 {
85 best_rt = observation.msp_precursor.get()->getXicCoordSPtr().get()->rtTarget;
86 intensity = observation.msp_precursor.get()->getIntensity();
87 }
88 }
89
90 return best_rt;
91}
92
95{
96
97 // get XIC coordinates of the most intense precursor
98 pappso::pappso_double intensity = -1;
99 pappso::XicCoordSPtr best_xic_coord;
100
101 for(auto &observation : m_observationList)
102 {
103 if(observation.m_charge == charge)
104 {
105 if(observation.msp_precursor.get()->getIntensity() > intensity)
106 {
107 intensity = observation.msp_precursor.get()->getIntensity();
108 best_xic_coord = observation.msp_precursor.get()->getXicCoordSPtr();
109 qDebug();
110 }
111 }
112 }
113 return best_xic_coord;
114}
115
118{
119
120 // get XIC coordinates of the most intense precursor
121 pappso::pappso_double intensity = -1;
122 pappso::XicCoordSPtr best_xic_coord;
123
124 for(auto &observation : m_observationList)
125 {
126 if(observation.msp_precursor.get()->getIntensity() > intensity)
127 {
128 intensity = observation.msp_precursor.get()->getIntensity();
129 best_xic_coord = observation.msp_precursor.get()->getXicCoordSPtr();
130 qDebug();
131 }
132 }
133 return best_xic_coord;
134}
135
136
137std::vector<double>
139{
140 std::vector<double> rt_list;
141 for(auto &observation : m_observationList)
142 {
143 rt_list.push_back(observation.msp_precursor.get()->getXicCoordSPtr().get()->rtTarget);
144 }
145
146 return rt_list;
147}
148
149const std::vector<pappso::masschroq::PeptideObservation::Observation> &
const std::vector< Observation > & getObservationList() const
pappso::XicCoordSPtr getBestXicCoord() const
std::vector< double > getObservedRetentionTimesOverallChargeStates() const
void addObservation(const PeptideObservation::Observation &observation)
std::vector< std::uint8_t > getObservedChargeStates() const
std::vector< Observation > m_observationList
pappso::XicCoordSPtr getBestXicCoordSPtrForCharge(std::uint8_t charge) const
std::shared_ptr< Peptide > PeptideSp
Definition peptide.h:46
double pappso_double
A type definition for doubles.
Definition types.h:60
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44