35 #include "../pappsoexception.h"
72 const std::list<PeptideIon> &
80 : msp_peptide(peptide), m_ionList(ions)
85 <<
"PeptideFragmentIonListBase::PeptideFragmentIonListBase begin "
87 std::list<PeptideFragmentSp> fragment_list =
90 m_phosphorylationNumber = 0;
94 for(
auto &&fragment_sp : fragment_list)
98 if(fragment_sp.get()->getPeptideIonDirection() ==
101 for(
auto &&ion_type : m_ionList)
111 msp_peptide_fragment_ion_list.push_back(
112 std::make_shared<PeptideFragmentIon>(fragment_sp,
117 if(phosphorylation_mod ==
nullptr)
119 phosphorylation_mod =
121 m_phosphorylationNumber =
122 peptide.get()->getNumberOfModification(
123 phosphorylation_mod);
125 for(
unsigned int i = 0; i < m_phosphorylationNumber; i++)
127 msp_peptide_fragment_ion_list.push_back(
128 std::make_shared<PeptideFragmentIon>(
129 fragment_sp, ion_type, i + 1));
136 for(
auto &&ion_type : m_ionList)
144 msp_peptide_fragment_ion_list.push_back(
145 std::make_shared<PeptideFragmentIon>(fragment_sp,
150 if(phosphorylation_mod ==
nullptr)
152 phosphorylation_mod =
154 m_phosphorylationNumber =
155 peptide.get()->getNumberOfModification(
156 phosphorylation_mod);
158 for(
unsigned int i = 0; i < m_phosphorylationNumber; i++)
160 msp_peptide_fragment_ion_list.push_back(
161 std::make_shared<PeptideFragmentIon>(
162 fragment_sp, ion_type, i + 1));
168 qDebug() <<
"PeptideFragmentIonListBase::PeptideFragmentIonListBase end "
171 catch(PappsoException &exception_pappso)
175 "ERROR building PeptideFragmentIonListBase, PAPPSO exception:\n%1")
176 .arg(exception_pappso.qwhat());
177 qDebug() <<
"PeptideFragmentIonListBase::PeptideFragmentIonListBase "
178 "PappsoException :\n"
180 throw PappsoException(errorStr);
182 catch(std::exception &exception_std)
186 "ERROR building PeptideFragmentIonListBase, std exception:\n%1")
187 .arg(exception_std.what());
188 qDebug() <<
"PeptideFragmentIonListBase::PeptideFragmentIonListBase "
191 throw PappsoException(errorStr);
196 const PeptideFragmentIonListBase &other)
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)
208 return std::make_shared<const PeptideFragmentIonListBase>(*
this);
216 const std::list<PeptideFragmentSp>
219 std::list<PeptideFragmentSp> peptide_fragment_list;
221 unsigned int max = peptide.get()->size() - 1;
222 for(
unsigned int i = 0; i <
max; i++)
225 peptide_fragment_list.push_back(std::make_shared<PeptideFragment>(
227 peptide_fragment_list.push_back(std::make_shared<PeptideFragment>(
230 return peptide_fragment_list;
233 const std::list<PeptideFragmentIonSp>
236 std::list<PeptideFragmentIonSp> ion_list;
239 if(peptide_fragment_ion_sp.get()->getPeptideIonType() == ion_type)
241 ion_list.push_back(peptide_fragment_ion_sp);
249 unsigned int size)
const
259 unsigned int number_of_neutral_phospho_loss)
const
263 if(peptide_fragment_ion_sp.get()->getPeptideIonType() == ion_type)
265 if(peptide_fragment_ion_sp.get()->size() ==
size)
267 if(peptide_fragment_ion_sp.get()
268 ->getNumberOfNeutralPhosphoLoss() ==
269 number_of_neutral_phospho_loss)
271 return (peptide_fragment_ion_sp);