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

#include <peptideobservation.h>

Classes

struct  Observation

Public Member Functions

 PeptideObservation (PeptideSp peptide)
 PeptideObservation (const PeptideObservation &other)
virtual ~PeptideObservation ()
const PeptideSpgetPeptideSp () const
void addObservation (const PeptideObservation::Observation &observation)
std::vector< std::uint8_t > getObservedChargeStates () const
double getBestRtOverallChargeStates () const
std::vector< double > getObservedRetentionTimesOverallChargeStates () const
pappso::XicCoordSPtr getBestXicCoordSPtrForCharge (std::uint8_t charge) const
pappso::XicCoordSPtr getBestXicCoord () const
const std::vector< Observation > & getObservationList () const

Private Attributes

PeptideSp msp_peptide
std::vector< Observationm_observationList

Detailed Description

Todo
group together one Peptide and observations on this peptide

Definition at line 47 of file peptideobservation.h.

Constructor & Destructor Documentation

◆ PeptideObservation() [1/2]

pappso::masschroq::PeptideObservation::PeptideObservation ( PeptideSp peptide)

Default constructor

Definition at line 34 of file peptideobservation.cpp.

35 : msp_peptide(peptide)
36{
37}

References msp_peptide.

Referenced by PeptideObservation().

◆ PeptideObservation() [2/2]

pappso::masschroq::PeptideObservation::PeptideObservation ( const PeptideObservation & other)

Copy constructor

Parameters
otherTODO

Definition at line 40 of file peptideobservation.cpp.

41 : msp_peptide(other.msp_peptide)
42{
43 m_observationList = other.m_observationList;
44}
std::vector< Observation > m_observationList

References PeptideObservation(), m_observationList, and msp_peptide.

◆ ~PeptideObservation()

pappso::masschroq::PeptideObservation::~PeptideObservation ( )
virtual

Destructor

Definition at line 46 of file peptideobservation.cpp.

47{
48}

Member Function Documentation

◆ addObservation()

void pappso::masschroq::PeptideObservation::addObservation ( const PeptideObservation::Observation & observation)

Definition at line 51 of file peptideobservation.cpp.

53{
54 m_observationList.push_back(observation);
55}

References m_observationList.

◆ getBestRtOverallChargeStates()

double pappso::masschroq::PeptideObservation::getBestRtOverallChargeStates ( ) const

Definition at line 77 of file peptideobservation.cpp.

78{
79 double best_rt = 0;
80 double intensity = -1;
81 for(auto &observation : m_observationList)
82 {
83 if(observation.msp_precursor.get()->getIntensity() > intensity)
84 {
85 best_rt = observation.msp_precursor.get()->getXicCoordSPtr().get()->rtTarget;
86 intensity = observation.msp_precursor.get()->getIntensity();
87 }
88 }
89
90 return best_rt;
91}

References m_observationList.

◆ getBestXicCoord()

pappso::XicCoordSPtr pappso::masschroq::PeptideObservation::getBestXicCoord ( ) const

Definition at line 117 of file peptideobservation.cpp.

118{
119
120 // get XIC coordinates of the most intense precursor
121 pappso::pappso_double intensity = -1;
122 pappso::XicCoordSPtr best_xic_coord;
123
124 for(auto &observation : m_observationList)
125 {
126 if(observation.msp_precursor.get()->getIntensity() > intensity)
127 {
128 intensity = observation.msp_precursor.get()->getIntensity();
129 best_xic_coord = observation.msp_precursor.get()->getXicCoordSPtr();
130 qDebug();
131 }
132 }
133 return best_xic_coord;
134}
double pappso_double
A type definition for doubles.
Definition types.h:60
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44

References m_observationList.

Referenced by pappso::masschroq::Peptide::addAlignedPeptideObservation().

◆ getBestXicCoordSPtrForCharge()

pappso::XicCoordSPtr pappso::masschroq::PeptideObservation::getBestXicCoordSPtrForCharge ( std::uint8_t charge) const

Definition at line 94 of file peptideobservation.cpp.

95{
96
97 // get XIC coordinates of the most intense precursor
98 pappso::pappso_double intensity = -1;
99 pappso::XicCoordSPtr best_xic_coord;
100
101 for(auto &observation : m_observationList)
102 {
103 if(observation.m_charge == charge)
104 {
105 if(observation.msp_precursor.get()->getIntensity() > intensity)
106 {
107 intensity = observation.msp_precursor.get()->getIntensity();
108 best_xic_coord = observation.msp_precursor.get()->getXicCoordSPtr();
109 qDebug();
110 }
111 }
112 }
113 return best_xic_coord;
114}

References m_observationList.

◆ getObservationList()

const std::vector< pappso::masschroq::PeptideObservation::Observation > & pappso::masschroq::PeptideObservation::getObservationList ( ) const

Definition at line 150 of file peptideobservation.cpp.

151{
152 return m_observationList;
153}

References m_observationList.

◆ getObservedChargeStates()

std::vector< std::uint8_t > pappso::masschroq::PeptideObservation::getObservedChargeStates ( ) const

Definition at line 57 of file peptideobservation.cpp.

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()), charge_list.end());
67 return charge_list;
68}

References m_observationList.

◆ getObservedRetentionTimesOverallChargeStates()

std::vector< double > pappso::masschroq::PeptideObservation::getObservedRetentionTimesOverallChargeStates ( ) const

Definition at line 138 of file peptideobservation.cpp.

139{
140 std::vector<double> rt_list;
141 for(auto &observation : m_observationList)
142 {
143 rt_list.push_back(observation.msp_precursor.get()->getXicCoordSPtr().get()->rtTarget);
144 }
145
146 return rt_list;
147}

References m_observationList.

◆ getPeptideSp()

const pappso::masschroq::PeptideSp & pappso::masschroq::PeptideObservation::getPeptideSp ( ) const

Definition at line 71 of file peptideobservation.cpp.

72{
73 return msp_peptide;
74}

References msp_peptide.

Referenced by pappso::masschroq::CborOutputStream::writePeptideMeasurements().

Member Data Documentation

◆ m_observationList

◆ msp_peptide

PeptideSp pappso::masschroq::PeptideObservation::msp_peptide
private

Definition at line 98 of file peptideobservation.h.

Referenced by PeptideObservation(), PeptideObservation(), and getPeptideSp().


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