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
31#include "../../mzrange.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
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 */
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 */
92
93 const std::vector<std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch>> &
94 getPeakIonPairs() const;
95
96
97 /** @brief get mean deviation of matched peak mass delta
98 */
99 double getMatchedMzDiffMean() const;
100
101
102 /** @brief get standard deviation of matched peak mass delta
103 */
104 double getMatchedMzDiffSd() const;
105
106
107 /** @brief get the precursor mass delta of the maximum intensity pair of
108 * complement ions
109 */
111
112
113 /** @brief get the maximum consecutive fragments of one ion type
114 * @param ion_type ion species (y, b, ...)
115 */
116 std::size_t getMaxConsecutiveIon(Enums::PeptideIon ion_type);
117
118 /** @brief number of amino acid covered by matched ions
119 */
120 std::size_t getAaSequenceCoverage(Enums::PeptideIon ion_type);
121
122
123 /** @brief number of amino acid covered by matched complement pairs of ions
124 */
126
127 double getMaxIntensityPeakIonMatch(Enums::PeptideIon ion_type) const;
128
129
131 const std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch> &ion_pair) const;
132
133 /** experimental use with caution
134 */
136
137 private:
138 void findComplementIonPairs(const pappso::PeptideSp &peptideSp);
139
140 private:
141 // std::shared_ptr<FilterChargeDeconvolution> msp_filterChargeDeconvolution;
142 // std::shared_ptr<FilterMzExclusion> msp_filterMzExclusion;
143 std::shared_ptr<FilterResampleKeepGreater> msp_filterKeepGreater;
144
145 std::shared_ptr<PeptideIsotopeSpectrumMatch> msp_peptideSpectrumMatch;
147
149 std::list<Enums::PeptideIon> m_ionList;
150
152
155 unsigned int m_parentCharge = 1;
156
157 std::vector<std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch>> m_peakIonPairs;
158
162};
163} // namespace pappso
Class to represent a mass spectrum.
double getMaxIntensityPeakIonMatch(Enums::PeptideIon ion_type) const
double getIntensityOfMatchedIon(Enums::PeptideIon ion_type)
get the sum of intensity of a specific ion
std::size_t getNumberOfMatchedIons() const
number of matched ions (peaks)
std::size_t getAaSequenceCoverage(Enums::PeptideIon ion_type)
number of amino acid covered by matched ions
void findComplementIonPairs(const pappso::PeptideSp &peptideSp)
double getTotalIntensity() const
sum of all peak intensities (matched or not)
double getMatchedMzDiffMean() const
get mean deviation of matched peak mass delta
double getTotalIntensityOfMatchedIonComplementPairs() const
intensity of matched ion complement
const std::vector< std::pair< pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch > > & getPeakIonPairs() const
std::vector< std::pair< pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch > > m_peakIonPairs
std::shared_ptr< FilterResampleKeepGreater > msp_filterKeepGreater
double getIonPairPrecursorMassDelta(const std::pair< pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch > &ion_pair) const
double m_precursorTheoreticalMz
double getMaxIntensityMatchedIonComplementPairPrecursorMassDelta() const
get the precursor mass delta of the maximum intensity pair of complement ions
std::size_t countMatchedIonComplementPairs() const
count the number of matched ion complement
std::size_t getComplementPairsAaSequenceCoverage()
number of amino acid covered by matched complement pairs of ions
double getTotalIntensityOfMatchedIons() const
sum of matched peak intensities
std::size_t getMaxConsecutiveIon(Enums::PeptideIon ion_type)
get the maximum consecutive fragments of one ion type
LinearRegression getIonIsotopeLinearRegression() const
unsigned int m_parentCharge
std::list< Enums::PeptideIon > m_ionList
std::shared_ptr< PeptideIsotopeSpectrumMatch > msp_peptideSpectrumMatch
void setPeptideSpectrumCharge(const pappso::PeptideSp peptideSp, const MassSpectrum *p_spectrum, unsigned int parent_charge, unsigned int max_isotope_number)
PrecisionPtr m_ms2precision
pappso::PeptideSp msp_peptide
double m_precursorTheoreticalMass
PsmFeatures(PrecisionPtr ms2precision, double minimumMz)
compute psm features
double getMatchedMzDiffSd() const
get standard deviation of matched peak mass delta
double m_spectrumSumIntensity
#define PMSPP_LIB_DECL
PeptideIon
Enums::PeptideIon enum defines all types of ions (Nter or Cter)
Definition types.h:286
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const Peptide > PeptideSp
const PrecisionBase * PrecisionPtr
Definition precision.h:122