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

#include <peptidefragmentionlistbase.h>

Public Member Functions

 PeptideFragmentIonListBase (const PeptideSp &peptide, const IonList &ions)
 
 PeptideFragmentIonListBase (const PeptideFragmentIonListBase &other)
 
virtual ~PeptideFragmentIonListBase ()
 
PeptideFragmentIonListBaseSp makePeptideFragmentIonListBaseSp () const
 
const std::list< PeptideIon > & getIonList () const
 
unsigned int getPhosphorylationNumber () const
 
virtual const PeptideSpgetPeptideSp () const
 
const std::list< PeptideFragmentIonSpgetPeptideFragmentIonSp (PeptideIon ion_type) const
 
const PeptideFragmentIonSpgetPeptideFragmentIonSp (PeptideIon ion_type, unsigned int size) const
 
const PeptideFragmentIonSpgetPeptideFragmentIonSp (PeptideIon ion_type, unsigned int size, unsigned int number_of_neutral_phospho_loss) const
 
std::list< PeptideFragmentIonSp >::const_iterator begin () const
 
std::list< PeptideFragmentIonSp >::const_iterator end () const
 
const std::list< PeptideFragmentIonSp > & getPeptideFragmentIonList () const
 
unsigned int size () const
 

Static Public Member Functions

static std::list< PeptideIongetCIDionList ()
 
static std::list< PeptideIongetETDionList ()
 

Static Protected Member Functions

static const std::list< PeptideFragmentSpgetPeptideFragmentList (const PeptideSp &peptide)
 

Protected Attributes

const PeptideSp msp_peptide
 
std::list< PeptideFragmentIonSpmsp_peptide_fragment_ion_list
 
IonList m_ionList
 
unsigned int m_phosphorylationNumber
 

Private Types

using IonList = std::list<PeptideIon>
 

Detailed Description

Definition at line 45 of file peptidefragmentionlistbase.h.

Member Typedef Documentation

◆ IonList

Definition at line 47 of file peptidefragmentionlistbase.h.

Constructor & Destructor Documentation

◆ PeptideFragmentIonListBase() [1/2]

pappso::PeptideFragmentIonListBase::PeptideFragmentIonListBase ( const PeptideSp & peptide,
const IonList & ions )

Definition at line 78 of file peptidefragmentionlistbase.cpp.

80 : msp_peptide(peptide), m_ionList(ions)
81{
82 try
83 {
84 qDebug()
85 << "PeptideFragmentIonListBase::PeptideFragmentIonListBase begin "
86 << ions.size();
87 std::list<PeptideFragmentSp> fragment_list =
89
91 AaModificationP phosphorylation_mod = nullptr;
92
93
94 for(auto &&fragment_sp : fragment_list)
95 {
96 // qDebug()<< "PeptideFragmentIonListBase::PeptideFragmentIonListBase
97 // ition";
98 if(fragment_sp.get()->getPeptideIonDirection() ==
100 {
101 for(auto &&ion_type : m_ionList)
102 {
103 // qDebug()<<
104 // "PeptideFragmentIonListBase::PeptideFragmentIonListBase
105 // ition";
106 if((ion_type == PeptideIon::y) ||
107 (ion_type == PeptideIon::ystar) ||
108 (ion_type == PeptideIon::yo) ||
109 (ion_type == PeptideIon::z))
110 {
112 std::make_shared<PeptideFragmentIon>(fragment_sp,
113 ion_type));
114 }
115 else if(ion_type == PeptideIon::yp)
116 {
117 if(phosphorylation_mod == nullptr)
118 {
119 phosphorylation_mod =
120 AaModification::getInstance("MOD:00696");
122 peptide.get()->getNumberOfModification(
123 phosphorylation_mod);
124 }
125 for(unsigned int i = 0; i < m_phosphorylationNumber; i++)
126 {
128 std::make_shared<PeptideFragmentIon>(
129 fragment_sp, ion_type, i + 1));
130 }
131 }
132 }
133 }
134 else
135 {
136 for(auto &&ion_type : m_ionList)
137 {
138 // b, bstar, bo, a
139 if((ion_type == PeptideIon::b) ||
140 (ion_type == PeptideIon::bstar) ||
141 (ion_type == PeptideIon::bo) ||
142 (ion_type == PeptideIon::a) || (ion_type == PeptideIon::c))
143 {
145 std::make_shared<PeptideFragmentIon>(fragment_sp,
146 ion_type));
147 }
148 else if(ion_type == PeptideIon::bp)
149 {
150 if(phosphorylation_mod == nullptr)
151 {
152 phosphorylation_mod =
153 AaModification::getInstance("MOD:00696");
155 peptide.get()->getNumberOfModification(
156 phosphorylation_mod);
157 }
158 for(unsigned int i = 0; i < m_phosphorylationNumber; i++)
159 {
161 std::make_shared<PeptideFragmentIon>(
162 fragment_sp, ion_type, i + 1));
163 }
164 }
165 }
166 }
167 }
168 qDebug() << "PeptideFragmentIonListBase::PeptideFragmentIonListBase end "
169 << ions.size();
170 }
171 catch(PappsoException &exception_pappso)
172 {
173 QString errorStr =
174 QObject::tr(
175 "ERROR building PeptideFragmentIonListBase, PAPPSO exception:\n%1")
176 .arg(exception_pappso.qwhat());
177 qDebug() << "PeptideFragmentIonListBase::PeptideFragmentIonListBase "
178 "PappsoException :\n"
179 << errorStr;
180 throw PappsoException(errorStr);
181 }
182 catch(std::exception &exception_std)
183 {
184 QString errorStr =
185 QObject::tr(
186 "ERROR building PeptideFragmentIonListBase, std exception:\n%1")
187 .arg(exception_std.what());
188 qDebug() << "PeptideFragmentIonListBase::PeptideFragmentIonListBase "
189 "std::exception :\n"
190 << errorStr;
191 throw PappsoException(errorStr);
192 }
193}
static AaModificationP getInstance(const QString &accession)
std::list< PeptideFragmentIonSp > msp_peptide_fragment_ion_list
static const std::list< PeptideFragmentSp > getPeptideFragmentList(const PeptideSp &peptide)
@ a
Nter aldimine ions.
@ y
Cter amino ions.
@ c
Nter amino ions.
@ ystar
Cter amino ions + NH3 loss.
@ yo
Cter amino ions + H2O loss.
@ bstar
Nter acylium ions + NH3 loss.
@ b
Nter acylium ions.
@ bo
Nter acylium ions + H2O loss.
@ z
Cter carbocations.
const AaModification * AaModificationP

References pappso::a, pappso::b, pappso::bo, pappso::bp, pappso::bstar, pappso::c, pappso::Cter, pappso::AaModification::getInstance(), getPeptideFragmentList(), m_ionList, m_phosphorylationNumber, msp_peptide, msp_peptide_fragment_ion_list, pappso::PappsoException::qwhat(), pappso::y, pappso::yo, pappso::yp, pappso::ystar, and pappso::z.

◆ PeptideFragmentIonListBase() [2/2]

pappso::PeptideFragmentIonListBase::PeptideFragmentIonListBase ( const PeptideFragmentIonListBase & other)

Definition at line 195 of file peptidefragmentionlistbase.cpp.

197 : msp_peptide(other.msp_peptide),
198 msp_peptide_fragment_ion_list(other.msp_peptide_fragment_ion_list),
199 m_ionList(other.m_ionList),
200 m_phosphorylationNumber(other.m_phosphorylationNumber)
201{
202}

◆ ~PeptideFragmentIonListBase()

pappso::PeptideFragmentIonListBase::~PeptideFragmentIonListBase ( )
virtual

Definition at line 212 of file peptidefragmentionlistbase.cpp.

213{
214}

Member Function Documentation

◆ begin()

std::list< PeptideFragmentIonSp >::const_iterator pappso::PeptideFragmentIonListBase::begin ( ) const
inline

Definition at line 88 of file peptidefragmentionlistbase.h.

89 {
90 return msp_peptide_fragment_ion_list.begin();
91 }

◆ end()

std::list< PeptideFragmentIonSp >::const_iterator pappso::PeptideFragmentIonListBase::end ( ) const
inline

Definition at line 94 of file peptidefragmentionlistbase.h.

95 {
97 }

◆ getCIDionList()

std::list< PeptideIon > pappso::PeptideFragmentIonListBase::getCIDionList ( )
static

Definition at line 41 of file peptidefragmentionlistbase.cpp.

42{
43 IonList ret;
44 // populate ret
45
46 ret.push_back(PeptideIon::y);
47 ret.push_back(PeptideIon::yp);
48 ret.push_back(PeptideIon::ystar);
49 ret.push_back(PeptideIon::yo);
50 ret.push_back(PeptideIon::b);
51 ret.push_back(PeptideIon::bp);
52 ret.push_back(PeptideIon::a);
53 ret.push_back(PeptideIon::bstar);
54 ret.push_back(PeptideIon::bo);
55 return ret;
56}

References pappso::a, pappso::b, pappso::bo, pappso::bp, pappso::bstar, pappso::y, pappso::yo, pappso::yp, and pappso::ystar.

Referenced by pappso::MassSpectrumWidget::MassSpectrumWidget().

◆ getETDionList()

std::list< PeptideIon > pappso::PeptideFragmentIonListBase::getETDionList ( )
static

Definition at line 59 of file peptidefragmentionlistbase.cpp.

60{
61 IonList ret;
62 // populate ret
63
64 ret.push_back(PeptideIon::y);
65 ret.push_back(PeptideIon::c);
66 ret.push_back(PeptideIon::z);
67 ret.push_back(PeptideIon::ystar);
68 ret.push_back(PeptideIon::yo);
69 return ret;
70}

References pappso::c, pappso::y, pappso::yo, pappso::ystar, and pappso::z.

◆ getIonList()

const std::list< PeptideIon > & pappso::PeptideFragmentIonListBase::getIonList ( ) const

Definition at line 73 of file peptidefragmentionlistbase.cpp.

74{
75 return m_ionList;
76}

References m_ionList.

◆ getPeptideFragmentIonList()

const std::list< PeptideFragmentIonSp > & pappso::PeptideFragmentIonListBase::getPeptideFragmentIonList ( ) const
inline

Definition at line 101 of file peptidefragmentionlistbase.h.

102 {
104 }

◆ getPeptideFragmentIonSp() [1/3]

const std::list< PeptideFragmentIonSp > pappso::PeptideFragmentIonListBase::getPeptideFragmentIonSp ( PeptideIon ion_type) const

Definition at line 234 of file peptidefragmentionlistbase.cpp.

235{
236 std::list<PeptideFragmentIonSp> ion_list;
237 for(auto &&peptide_fragment_ion_sp : msp_peptide_fragment_ion_list)
238 {
239 if(peptide_fragment_ion_sp.get()->getPeptideIonType() == ion_type)
240 {
241 ion_list.push_back(peptide_fragment_ion_sp);
242 }
243 }
244 return (ion_list);
245}

References msp_peptide_fragment_ion_list.

Referenced by pappso::PeptideIsotopeSpectrumMatch::PeptideIsotopeSpectrumMatch(), pappso::specglob::PeptideSpectrum::PeptideSpectrum(), getPeptideFragmentIonSp(), and pappso::PeptideSpectrumMatch::privMatchIonList().

◆ getPeptideFragmentIonSp() [2/3]

const PeptideFragmentIonSp & pappso::PeptideFragmentIonListBase::getPeptideFragmentIonSp ( PeptideIon ion_type,
unsigned int size ) const

Definition at line 248 of file peptidefragmentionlistbase.cpp.

250{
251
252 return getPeptideFragmentIonSp(ion_type, size, 0);
253}
const std::list< PeptideFragmentIonSp > getPeptideFragmentIonSp(PeptideIon ion_type) const

References getPeptideFragmentIonSp(), and size().

◆ getPeptideFragmentIonSp() [3/3]

const PeptideFragmentIonSp & pappso::PeptideFragmentIonListBase::getPeptideFragmentIonSp ( PeptideIon ion_type,
unsigned int size,
unsigned int number_of_neutral_phospho_loss ) const

Definition at line 256 of file peptidefragmentionlistbase.cpp.

260{
261 for(auto &&peptide_fragment_ion_sp : msp_peptide_fragment_ion_list)
262 {
263 if(peptide_fragment_ion_sp.get()->getPeptideIonType() == ion_type)
264 {
265 if(peptide_fragment_ion_sp.get()->size() == size)
266 {
267 if(peptide_fragment_ion_sp.get()
268 ->getNumberOfNeutralPhosphoLoss() ==
269 number_of_neutral_phospho_loss)
270 {
271 return (peptide_fragment_ion_sp);
272 }
273 }
274 }
275 }
276
277 throw PappsoException(QString("PeptideFragmentIon %1 of size %2 not found")
279 .arg(size));
280}
const QString getPeptideIonName() const

References pappso::PeptideFragmentIon::getPeptideIonName(), msp_peptide_fragment_ion_list, and size().

◆ getPeptideFragmentList()

const std::list< PeptideFragmentSp > pappso::PeptideFragmentIonListBase::getPeptideFragmentList ( const PeptideSp & peptide)
staticprotected

Definition at line 217 of file peptidefragmentionlistbase.cpp.

218{
219 std::list<PeptideFragmentSp> peptide_fragment_list;
220
221 unsigned int max = peptide.get()->size() - 1;
222 for(unsigned int i = 0; i < max; i++)
223 {
224
225 peptide_fragment_list.push_back(std::make_shared<PeptideFragment>(
226 peptide, PeptideDirection::Nter, i + 1));
227 peptide_fragment_list.push_back(std::make_shared<PeptideFragment>(
228 peptide, PeptideDirection::Cter, i + 1));
229 }
230 return peptide_fragment_list;
231}
@ max
maximum of intensities

References pappso::Cter, pappso::max, and pappso::Nter.

Referenced by PeptideFragmentIonListBase().

◆ getPeptideSp()

virtual const PeptideSp & pappso::PeptideFragmentIonListBase::getPeptideSp ( ) const
inlinevirtual

Definition at line 72 of file peptidefragmentionlistbase.h.

73 {
74 return msp_peptide;
75 };

◆ getPhosphorylationNumber()

unsigned int pappso::PeptideFragmentIonListBase::getPhosphorylationNumber ( ) const
inline

Definition at line 66 of file peptidefragmentionlistbase.h.

67 {
69 };

◆ makePeptideFragmentIonListBaseSp()

PeptideFragmentIonListBaseSp pappso::PeptideFragmentIonListBase::makePeptideFragmentIonListBaseSp ( ) const

Definition at line 206 of file peptidefragmentionlistbase.cpp.

207{
208 return std::make_shared<const PeptideFragmentIonListBase>(*this);
209}

◆ size()

unsigned int pappso::PeptideFragmentIonListBase::size ( ) const
inline

Member Data Documentation

◆ m_ionList

IonList pappso::PeptideFragmentIonListBase::m_ionList
protected

Definition at line 52 of file peptidefragmentionlistbase.h.

Referenced by PeptideFragmentIonListBase(), and getIonList().

◆ m_phosphorylationNumber

unsigned int pappso::PeptideFragmentIonListBase::m_phosphorylationNumber
protected

Definition at line 53 of file peptidefragmentionlistbase.h.

Referenced by PeptideFragmentIonListBase().

◆ msp_peptide

const PeptideSp pappso::PeptideFragmentIonListBase::msp_peptide
protected

Definition at line 50 of file peptidefragmentionlistbase.h.

Referenced by PeptideFragmentIonListBase().

◆ msp_peptide_fragment_ion_list

std::list<PeptideFragmentIonSp> pappso::PeptideFragmentIonListBase::msp_peptide_fragment_ion_list
protected

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