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()),
67 charge_list.end());
68 return charge_list;
69}
70
76
77double
79{
80 double best_rt = 0;
81 double intensity = -1;
82 for(auto &observation : m_observationList)
83 {
84 if(observation.msp_precursor.get()->getIntensity() > intensity)
85 {
86 best_rt =
87 observation.msp_precursor.get()->getXicCoordSPtr().get()->rtTarget;
88 intensity = observation.msp_precursor.get()->getIntensity();
89 }
90 }
91
92 return best_rt;
93}
94
97 std::uint8_t charge) const
98{
99
100 // get XIC coordinates of the most intense precursor
101 pappso::pappso_double intensity = -1;
102 pappso::XicCoordSPtr best_xic_coord;
103
104 for(auto &observation : m_observationList)
105 {
106 if(observation.m_charge == charge)
107 {
108 if(observation.msp_precursor.get()->getIntensity() > intensity)
109 {
110 intensity = observation.msp_precursor.get()->getIntensity();
111 best_xic_coord =
112 observation.msp_precursor.get()->getXicCoordSPtr();
113 qDebug();
114 }
115 }
116 }
117 return best_xic_coord;
118}
119
122{
123
124 // get XIC coordinates of the most intense precursor
125 pappso::pappso_double intensity = -1;
126 pappso::XicCoordSPtr best_xic_coord;
127
128 for(auto &observation : m_observationList)
129 {
130 if(observation.msp_precursor.get()->getIntensity() > intensity)
131 {
132 intensity = observation.msp_precursor.get()->getIntensity();
133 best_xic_coord = observation.msp_precursor.get()->getXicCoordSPtr();
134 qDebug();
135 }
136 }
137 return best_xic_coord;
138}
139
140
141std::vector<double>
143{
144 std::vector<double> rt_list;
145 for(auto &observation : m_observationList)
146 {
147 rt_list.push_back(
148 observation.msp_precursor.get()->getXicCoordSPtr().get()->rtTarget);
149 }
150
151 return rt_list;
152}
153
154const 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:61
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44