libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::IonIsotopeRatioScore Class Reference

#include <ionisotoperatioscore.h>

Public Member Functions

 IonIsotopeRatioScore (const MassSpectrum &spectrum, const PeptideSp &peptide_sp, unsigned int parent_charge, PrecisionPtr precision, std::vector< PeptideIon > ion_list)
 
virtual ~IonIsotopeRatioScore ()
 
pappso::pappso_double getIonIsotopeRatioScore () const
 

Private Attributes

pappso::pappso_double m_ionIsotopeRatioScore
 

Detailed Description

Definition at line 36 of file ionisotoperatioscore.h.

Constructor & Destructor Documentation

◆ IonIsotopeRatioScore()

IonIsotopeRatioScore::IonIsotopeRatioScore ( const MassSpectrum spectrum,
const PeptideSp peptide_sp,
unsigned int  parent_charge,
PrecisionPtr  precision,
std::vector< PeptideIon ion_list 
)

Definition at line 34 of file ionisotoperatioscore.cpp.

39{
40 std::list<PeptideIon> ion_list(ion_vector.begin(), ion_vector.end());
42 spectrum, peptide_sp, parent_charge, precision, ion_list, 1, 1);
43
44 Trace scaterplot;
45
46 for(PeptideIon ion_type : ion_vector)
47 {
48 std::vector<double> mono_th_intensities(peptide_sp.get()->size(), 0);
49 std::vector<double> isotope_th_intensities(peptide_sp.get()->size(), 0);
50
51 std::vector<double> mono_exp_intensities(peptide_sp.get()->size(), 0);
52 std::vector<double> isotope_exp_intensities(peptide_sp.get()->size(), 0);
53 for(const PeakIonIsotopeMatch &peak_ion_match :
54 psm_match.getPeakIonIsotopeMatchList())
55 {
56 if(peak_ion_match.getPeptideIonType() == ion_type)
57 {
58 std::size_t vector_position =
59 peak_ion_match.getPeptideFragmentIonSp().get()->size() - 1;
60 PeptideNaturalIsotopeAverageSp iso_average_sp =
61 peak_ion_match.getPeptideNaturalIsotopeAverageSp();
62 if(iso_average_sp.get()->getIsotopeNumber() == 0)
63 {
64 mono_th_intensities[vector_position] =
65 iso_average_sp.get()->getIntensityRatio();
66 mono_exp_intensities[vector_position] =
67 peak_ion_match.getPeak().y;
68 }
69 else if(iso_average_sp.get()->getIsotopeNumber() == 1)
70 {
71 isotope_th_intensities[vector_position] =
72 iso_average_sp.get()->getIntensityRatio();
73 isotope_exp_intensities[vector_position] =
74 peak_ion_match.getPeak().y;
75 }
76 }
77 }
78
79 for(std::size_t i = 0; i < mono_th_intensities.size(); i++)
80 {
81 if((mono_th_intensities[i] != 0) && (isotope_th_intensities[i] != 0))
82 {
83 DataPoint xy(mono_th_intensities[i] / isotope_th_intensities[i],
84 mono_exp_intensities[i] /
85 isotope_exp_intensities[i]);
86 scaterplot.push_back(xy);
87 }
88 }
89 }
90
91 scaterplot.sortX();
92
93 LinearRegression linear_regression(scaterplot);
94
95 m_ionIsotopeRatioScore = linear_regression.getCoefficientOfDetermination();
96}
pappso::pappso_double m_ionIsotopeRatioScore
A simple container of DataPoint instances.
Definition trace.h:148
void sortX(SortOrder sort_order=SortOrder::ascending)
Definition trace.cpp:1086
PeptideIon
PeptideIon enum defines all types of ions (Nter or Cter)
Definition types.h:432
@ xy
(x,y) format
std::shared_ptr< const PeptideNaturalIsotopeAverage > PeptideNaturalIsotopeAverageSp

References pappso::LinearRegression::getCoefficientOfDetermination(), pappso::PeptideIsotopeSpectrumMatch::getPeakIonIsotopeMatchList(), m_ionIsotopeRatioScore, pappso::Trace::sortX(), and pappso::xy.

◆ ~IonIsotopeRatioScore()

IonIsotopeRatioScore::~IonIsotopeRatioScore ( )
virtual

Definition at line 99 of file ionisotoperatioscore.cpp.

100{
101}

Member Function Documentation

◆ getIonIsotopeRatioScore()

pappso::pappso_double IonIsotopeRatioScore::getIonIsotopeRatioScore ( ) const

Definition at line 104 of file ionisotoperatioscore.cpp.

105{
107}

References m_ionIsotopeRatioScore.

Member Data Documentation

◆ m_ionIsotopeRatioScore

pappso::pappso_double pappso::IonIsotopeRatioScore::m_ionIsotopeRatioScore
private

Definition at line 49 of file ionisotoperatioscore.h.

Referenced by IonIsotopeRatioScore(), and getIonIsotopeRatioScore().


The documentation for this class was generated from the following files: