Loading...
Searching...
No Matches
psmfeatures.h
Go to the documentation of this file.
/**
* \file pappsomspp/psm/features/psmfeatures.h
* \date 19/07/2022
* \author Olivier Langella
* \brief comutes various PSM (Peptide Spectrum Match) features
*/
/*******************************************************************************
* Copyright (c) 2022 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of PAPPSOms-tools.
*
* PAPPSOms-tools 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.
*
* PAPPSOms-tools 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 PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "pappsomspp/core/massspectrum/massspectrum.h"
#include "../../mzrange.h"
#include "../../peptide/peptidefragmention.h"
#include "pappsomspp/core/processing/filters/filterchargedeconvolution.h"
#include "pappsomspp/core/processing/filters/filterexclusionmz.h"
#include "pappsomspp/core/processing/filters/filterresample.h"
#include "../peptideisotopespectrummatch.h"
#include "../../trace/linearregression.h"
namespace pappso
{
/**
* @todo write docs
*/
class PMSPP_LIB_DECL PsmFeatures
{
public:
/** @brief compute psm features
* @param ms2precision precision of mass measurements for MS2 fragments
* @param minimumMz ignore mz values under this threshold
*/
PsmFeatures(PrecisionPtr ms2precision, double minimumMz);
/**
* Destructor
*/
~PsmFeatures();
void setPeptideSpectrumCharge(const pappso::PeptideSp peptideSp,
const MassSpectrum *p_spectrum,
unsigned int parent_charge,
unsigned int max_isotope_number);
/** @brief get the sum of intensity of a specific ion
* @param ion_type ion species (y, b, ...)
*/
double getIntensityOfMatchedIon(Enums::PeptideIon ion_type);
/** @brief sum of all peak intensities (matched or not)
*/
double getTotalIntensity() const;
/** @brief sum of matched peak intensities
*/
double getTotalIntensityOfMatchedIons() const;
/** @brief number of matched ions (peaks)
*/
std::size_t getNumberOfMatchedIons() const;
/** @brief count the number of matched ion complement
*
* matched ion complement are ions with a sum compatible to the precursor mass
*
*/
std::size_t countMatchedIonComplementPairs() const;
/** @brief intensity of matched ion complement
*/
double getTotalIntensityOfMatchedIonComplementPairs() const;
const std::vector<std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch>> &
getPeakIonPairs() const;
/** @brief get mean deviation of matched peak mass delta
*/
double getMatchedMzDiffMean() const;
/** @brief get standard deviation of matched peak mass delta
*/
double getMatchedMzDiffSd() const;
/** @brief get the precursor mass delta of the maximum intensity pair of
* complement ions
*/
double getMaxIntensityMatchedIonComplementPairPrecursorMassDelta() const;
/** @brief get the maximum consecutive fragments of one ion type
* @param ion_type ion species (y, b, ...)
*/
std::size_t getMaxConsecutiveIon(Enums::PeptideIon ion_type);
/** @brief number of amino acid covered by matched ions
*/
std::size_t getAaSequenceCoverage(Enums::PeptideIon ion_type);
/** @brief number of amino acid covered by matched complement pairs of ions
*/
std::size_t getComplementPairsAaSequenceCoverage();
double getMaxIntensityPeakIonMatch(Enums::PeptideIon ion_type) const;
double getIonPairPrecursorMassDelta(
const std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch> &ion_pair) const;
/** experimental use with caution
*/
LinearRegression getIonIsotopeLinearRegression() const;
private:
void findComplementIonPairs(const pappso::PeptideSp &peptideSp);
private:
// std::shared_ptr<FilterChargeDeconvolution> msp_filterChargeDeconvolution;
// std::shared_ptr<FilterMzExclusion> msp_filterMzExclusion;
std::shared_ptr<FilterResampleKeepGreater> msp_filterKeepGreater;
std::shared_ptr<PeptideIsotopeSpectrumMatch> msp_peptideSpectrumMatch;
pappso::PeptideSp msp_peptide;
PrecisionPtr m_ms2precision;
std::list<Enums::PeptideIon> m_ionList;
double m_spectrumSumIntensity;
double m_precursorTheoreticalMz;
double m_precursorTheoreticalMass;
unsigned int m_parentCharge = 1;
std::vector<std::pair<pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch>> m_peakIonPairs;
double m_matchedMzDiffMean = 0;
double m_matchedMzDiffMedian = 0;
double m_matchedMzDiffSd = 0;
};
} // namespace pappso
pappso::LinearRegression
Definition linearregression.h:33
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition massspectrum.h:70
pappso::PsmFeatures::getMaxIntensityPeakIonMatch
double getMaxIntensityPeakIonMatch(Enums::PeptideIon ion_type) const
Definition psmfeatures.cpp:290
pappso::PsmFeatures::getIntensityOfMatchedIon
double getIntensityOfMatchedIon(Enums::PeptideIon ion_type)
get the sum of intensity of a specific ion
Definition psmfeatures.cpp:128
pappso::PsmFeatures::getNumberOfMatchedIons
std::size_t getNumberOfMatchedIons() const
number of matched ions (peaks)
Definition psmfeatures.cpp:196
pappso::PsmFeatures::getAaSequenceCoverage
std::size_t getAaSequenceCoverage(Enums::PeptideIon ion_type)
number of amino acid covered by matched ions
Definition psmfeatures.cpp:254
pappso::PsmFeatures::findComplementIonPairs
void findComplementIonPairs(const pappso::PeptideSp &peptideSp)
Definition psmfeatures.cpp:343
pappso::PsmFeatures::getTotalIntensity
double getTotalIntensity() const
sum of all peak intensities (matched or not)
Definition psmfeatures.cpp:152
pappso::PsmFeatures::getMatchedMzDiffMean
double getMatchedMzDiffMean() const
get mean deviation of matched peak mass delta
Definition psmfeatures.cpp:189
pappso::PsmFeatures::getTotalIntensityOfMatchedIonComplementPairs
double getTotalIntensityOfMatchedIonComplementPairs() const
intensity of matched ion complement
Definition psmfeatures.cpp:170
pappso::PsmFeatures::getPeakIonPairs
const std::vector< std::pair< pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch > > & getPeakIonPairs() const
Definition psmfeatures.cpp:164
pappso::PsmFeatures::m_peakIonPairs
std::vector< std::pair< pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch > > m_peakIonPairs
Definition psmfeatures.h:157
pappso::PsmFeatures::msp_filterKeepGreater
std::shared_ptr< FilterResampleKeepGreater > msp_filterKeepGreater
Definition psmfeatures.h:143
pappso::PsmFeatures::getIonPairPrecursorMassDelta
double getIonPairPrecursorMassDelta(const std::pair< pappso::PeakIonIsotopeMatch, pappso::PeakIonIsotopeMatch > &ion_pair) const
Definition psmfeatures.cpp:327
pappso::PsmFeatures::m_precursorTheoreticalMz
double m_precursorTheoreticalMz
Definition psmfeatures.h:153
pappso::PsmFeatures::getMaxIntensityMatchedIonComplementPairPrecursorMassDelta
double getMaxIntensityMatchedIonComplementPairPrecursorMassDelta() const
get the precursor mass delta of the maximum intensity pair of complement ions
Definition psmfeatures.cpp:309
pappso::PsmFeatures::countMatchedIonComplementPairs
std::size_t countMatchedIonComplementPairs() const
count the number of matched ion complement
Definition psmfeatures.cpp:158
pappso::PsmFeatures::getComplementPairsAaSequenceCoverage
std::size_t getComplementPairsAaSequenceCoverage()
number of amino acid covered by matched complement pairs of ions
Definition psmfeatures.cpp:273
pappso::PsmFeatures::m_matchedMzDiffMean
double m_matchedMzDiffMean
Definition psmfeatures.h:159
pappso::PsmFeatures::getTotalIntensityOfMatchedIons
double getTotalIntensityOfMatchedIons() const
sum of matched peak intensities
Definition psmfeatures.cpp:141
pappso::PsmFeatures::getMaxConsecutiveIon
std::size_t getMaxConsecutiveIon(Enums::PeptideIon ion_type)
get the maximum consecutive fragments of one ion type
Definition psmfeatures.cpp:202
pappso::PsmFeatures::getIonIsotopeLinearRegression
LinearRegression getIonIsotopeLinearRegression() const
Definition psmfeatures.cpp:365
pappso::PsmFeatures::m_parentCharge
unsigned int m_parentCharge
Definition psmfeatures.h:155
pappso::PsmFeatures::m_matchedMzDiffMedian
double m_matchedMzDiffMedian
Definition psmfeatures.h:160
pappso::PsmFeatures::m_ionList
std::list< Enums::PeptideIon > m_ionList
Definition psmfeatures.h:149
pappso::PsmFeatures::msp_peptideSpectrumMatch
std::shared_ptr< PeptideIsotopeSpectrumMatch > msp_peptideSpectrumMatch
Definition psmfeatures.h:145
pappso::PsmFeatures::setPeptideSpectrumCharge
void setPeptideSpectrumCharge(const pappso::PeptideSp peptideSp, const MassSpectrum *p_spectrum, unsigned int parent_charge, unsigned int max_isotope_number)
Definition psmfeatures.cpp:57
pappso::PsmFeatures::m_ms2precision
PrecisionPtr m_ms2precision
Definition psmfeatures.h:148
pappso::PsmFeatures::msp_peptide
pappso::PeptideSp msp_peptide
Definition psmfeatures.h:146
pappso::PsmFeatures::m_precursorTheoreticalMass
double m_precursorTheoreticalMass
Definition psmfeatures.h:154
pappso::PsmFeatures::PsmFeatures
PsmFeatures(PrecisionPtr ms2precision, double minimumMz)
compute psm features
Definition psmfeatures.cpp:35
pappso::PsmFeatures::getMatchedMzDiffSd
double getMatchedMzDiffSd() const
get standard deviation of matched peak mass delta
Definition psmfeatures.cpp:183
pappso::PsmFeatures::m_spectrumSumIntensity
double m_spectrumSumIntensity
Definition psmfeatures.h:151
pappso::PsmFeatures::m_matchedMzDiffSd
double m_matchedMzDiffSd
Definition psmfeatures.h:161
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
filterchargedeconvolution.h
filterexclusionmz.h
filterresample.h
linearregression.h
massspectrum.h
mzrange.h
pappso::Enums::PeptideIon
PeptideIon
Enums::PeptideIon enum defines all types of ions (Nter or Cter).
Definition types.h:286
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
peptidefragmention.h
peptideisotopespectrummatch.h