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 78 of file peptideobservation.cpp.

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

References m_observationList.

◆ getBestXicCoord()

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

Definition at line 121 of file peptideobservation.cpp.

122{
123
124 // get XIC coordinates of the most intense precursor
125 pappso::pappso_double intensity = -1;
126 pappso::XicCoordSPtr best_xic_coord;
127
128 for(auto &observation : m_observationList)
129 {
130 if(observation.msp_precursor.get()->getIntensity() > intensity)
131 {
132 intensity = observation.msp_precursor.get()->getIntensity();
133 best_xic_coord = observation.msp_precursor.get()->getXicCoordSPtr();
134 qDebug();
135 }
136 }
137 return best_xic_coord;
138}
double pappso_double
A type definition for doubles.
Definition types.h:61
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 96 of file peptideobservation.cpp.

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

References m_observationList.

◆ getObservationList()

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

Definition at line 155 of file peptideobservation.cpp.

156{
157 return m_observationList;
158}

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

References m_observationList.

◆ getObservedRetentionTimesOverallChargeStates()

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

Definition at line 142 of file peptideobservation.cpp.

143{
144 std::vector<double> rt_list;
145 for(auto &observation : m_observationList)
146 {
147 rt_list.push_back(
148 observation.msp_precursor.get()->getXicCoordSPtr().get()->rtTarget);
149 }
150
151 return rt_list;
152}

References m_observationList.

◆ getPeptideSp()

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

Definition at line 72 of file peptideobservation.cpp.

73{
74 return msp_peptide;
75}

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: