libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
psmfeatures.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/psm/features/psmfeatures.h
3 * \date 19/07/2022
4 * \author Olivier Langella
5 * \brief comutes various PSM (Peptide Spectrum Match) features
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2022 Olivier Langella <Olivier.Langella@u-psud.fr>.
10 *
11 * This file is part of PAPPSOms-tools.
12 *
13 * PAPPSOms-tools is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms-tools is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27
28#pragma once
29
30#include "../../massspectrum/massspectrum.h"
31#include "../../mzrange.h"
32#include "../../peptide/peptidefragmention.h"
33#include "../../processing/filters/filterchargedeconvolution.h"
34#include "../../processing/filters/filterexclusionmz.h"
35#include "../../processing/filters/filterresample.h"
36#include "../peptideisotopespectrummatch.h"
37#include "../../trace/linearregression.h"
38
39
40namespace pappso
41{
42/**
43 * @todo write docs
44 */
46{
47 public:
48 /** @brief compute psm features
49 * @param ms2precision precision of mass measurements for MS2 fragments
50 * @param minimumMz ignore mz values under this threshold
51 */
52 PsmFeatures(PrecisionPtr ms2precision, double minimumMz);
53
54 /**
55 * Destructor
56 */
58
59 void setPeptideSpectrumCharge(const pappso::PeptideSp peptideSp,
60 const MassSpectrum *p_spectrum,
61 unsigned int parent_charge,
62 unsigned int max_isotope_number);
63
64 /** @brief get the sum of intensity of a specific ion
65 * @param ion_type ion species (y, b, ...)
66 */
67 double getIntensityOfMatchedIon(PeptideIon ion_type);
68
69 /** @brief sum of all peak intensities (matched or not)
70 */
71 double getTotalIntensity() const;
72
73
74 /** @brief sum of matched peak intensities
75 */
76 double getTotalIntensityOfMatchedIons() const;
77
78 /** @brief number of matched ions (peaks)
79 */
80 std::size_t getNumberOfMatchedIons() const;
81
82 /** @brief count the number of matched ion complement
83 *
84 * matched ion complement are ions with a sum compatible to the precursor mass
85 *
86 */
87 std::size_t countMatchedIonComplementPairs() const;
88
89 /** @brief intensity of matched ion complement
90 */
91 double getTotalIntensityOfMatchedIonComplementPairs() const;
92
93 const std::vector<
94 std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch>> &
95 getPeakIonPairs() const;
96
97
98 /** @brief get mean deviation of matched peak mass delta
99 */
100 double getMatchedMzDiffMean() const;
101
102
103 /** @brief get standard deviation of matched peak mass delta
104 */
105 double getMatchedMzDiffSd() const;
106
107
108 /** @brief get the precursor mass delta of the maximum intensity pair of
109 * complement ions
110 */
111 double getMaxIntensityMatchedIonComplementPairPrecursorMassDelta() const;
112
113
114 /** @brief get the maximum consecutive fragments of one ion type
115 * @param ion_type ion species (y, b, ...)
116 */
117 std::size_t getMaxConsecutiveIon(PeptideIon ion_type);
118
119 /** @brief number of amino acid covered by matched ions
120 */
121 std::size_t getAaSequenceCoverage(PeptideIon ion_type);
122
123
124 /** @brief number of amino acid covered by matched complement pairs of ions
125 */
126 std::size_t getComplementPairsAaSequenceCoverage();
127
128 double getMaxIntensityPeakIonMatch(PeptideIon ion_type) const;
129
130
131 double getIonPairPrecursorMassDelta(
132 const std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch>
133 &ion_pair) const;
134
135 /** experimental use with caution
136 */
137 LinearRegression getIonIsotopeLinearRegression() const;
138
139 private:
140 void findComplementIonPairs(const pappso::PeptideSp &peptideSp);
141
142 private:
143 std::shared_ptr<FilterChargeDeconvolution> msp_filterChargeDeconvolution;
144 std::shared_ptr<FilterMzExclusion> msp_filterMzExclusion;
145 std::shared_ptr<FilterResampleKeepGreater> msp_filterKeepGreater;
146
147 std::shared_ptr<PeptideIsotopeSpectrumMatch> msp_peptideSpectrumMatch;
149
151 std::list<PeptideIon> m_ionList;
152
154
157 unsigned int m_parentCharge = 1;
158
159 std::vector<
160 std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch>>
162
163 double m_matchedMzDiffMean = 0;
164 double m_matchedMzDiffMedian = 0;
165 double m_matchedMzDiffSd = 0;
166};
167} // namespace pappso
Class to represent a mass spectrum.
std::vector< std::pair< pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch > > m_peakIonPairs
std::shared_ptr< FilterChargeDeconvolution > msp_filterChargeDeconvolution
std::shared_ptr< FilterResampleKeepGreater > msp_filterKeepGreater
std::shared_ptr< FilterMzExclusion > msp_filterMzExclusion
double m_precursorTheoreticalMz
std::list< PeptideIon > m_ionList
std::shared_ptr< PeptideIsotopeSpectrumMatch > msp_peptideSpectrumMatch
PrecisionPtr m_ms2precision
pappso::PeptideSp msp_peptide
double m_precursorTheoreticalMass
double m_spectrumSumIntensity
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
PeptideIon
PeptideIon enum defines all types of ions (Nter or Cter)
Definition types.h:425
std::shared_ptr< const Peptide > PeptideSp