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

#include <peptide.h>

Inheritance diagram for pappso::Peptide:
pappso::PeptideInterface pappso::Ion pappso::AtomNumberInterface

Public Member Functions

 Peptide (const QString &pepstr)
 
virtual ~Peptide ()
 
 Peptide (const Peptide &peptide)
 
 Peptide (Peptide &&toCopy)
 
PeptideSp makePeptideSp () const
 
NoConstPeptideSp makeNoConstPeptideSp () const
 
void addAaModification (AaModificationP aaModification, unsigned int position)
 adds a modification to amino acid sequence
 
void addAaModificationOnAllAminoAcid (AaModificationP aaModification, AminoAcidChar amino_acid)
 adds a modification to all amino acid of the sequence
 
std::vector< Aa >::iterator begin ()
 
std::vector< Aa >::iterator end ()
 
std::vector< Aa >::const_iterator begin () const
 
std::vector< Aa >::const_iterator end () const
 
std::vector< Aa >::const_reverse_iterator rbegin () const
 
std::vector< Aa >::const_reverse_iterator rend () const
 
AagetAa (unsigned int position)
 
const AagetConstAa (unsigned int position) const
 
pappso_double getMass ()
 
pappso_double getMass () const override
 
virtual int getNumberOfAtom (AtomIsotopeSurvey atom) const override
 get the number of atom C, O, N, H in the molecule
 
virtual int getNumberOfIsotope (Isotope isotope) const override
 get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
 
const QString getSequence () const override
 print amino acid sequence without modifications
 
unsigned int size () const override
 
unsigned int getNumberOfModification (AaModificationP mod) const
 count modification occurence
 
unsigned int countModificationOnAa (AaModificationP mod, const std::vector< char > &aa_list) const
 count modification occurence
 
void replaceAaModification (AaModificationP oldmod, AaModificationP newmod)
 replaces all occurences of a modification by a new one
 
void removeAaModification (AaModificationP mod)
 removes all occurences of a modification
 
std::vector< unsigned int > getModificationPositionList (AaModificationP mod) const
 get modification positions
 
std::vector< unsigned int > getModificationPositionList (AaModificationP mod, const std::vector< char > &aa_list) const
 get modification positions
 
std::vector< unsigned int > getAaPositionList (char aa) const
 get positions of one amino acid in peptide
 
std::vector< unsigned int > getAaPositionList (std::list< char > list_aa) const
 
const QString toString () const
 print modification except internal modifications
 
const QString toAbsoluteString () const
 print all modifications
 
const QString getLiAbsoluteString () const
 get all sequence string with modifications and converting Leucine to Isoleucine
 
AaModificationP getInternalNterModification () const
 
AaModificationP getInternalCterModification () const
 
void removeInternalNterModification ()
 
void removeInternalCterModification ()
 
void setInternalNterModification (AaModificationP mod)
 
void setInternalCterModification (AaModificationP mod)
 
void rotate ()
 
void reverse ()
 
virtual bool isPalindrome () const override
 tells if the peptide sequence is a palindrome
 
void replaceLeucineIsoleucine ()
 
void removeNterAminoAcid ()
 
void removeCterAminoAcid ()
 
QString toProForma () const
 get the peptide model in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README.md
 
- Public Member Functions inherited from pappso::PeptideInterface
virtual const QString getSequenceLi () const
 amino acid sequence without modification where L are replaced by I
 
virtual const QString getName () const
 
virtual const QString getFormula (unsigned int charge) const final
 
virtual bool matchPeak (PrecisionPtr precision, pappso_double peak_mz, unsigned int charge) const final
 
- Public Member Functions inherited from pappso::Ion
 Ion ()
 
 ~Ion ()
 
virtual pappso_double getMz (unsigned int charge) const final
 

Protected Attributes

std::vector< Aam_aaVec
 
pappso_double m_proxyMass = -1
 

Friends

class PeptideProFormaParser
 
bool operator< (const Peptide &l, const Peptide &r)
 
bool operator== (const Peptide &l, const Peptide &r)
 

Detailed Description

Definition at line 99 of file peptide.h.

Constructor & Destructor Documentation

◆ Peptide() [1/3]

pappso::Peptide::Peptide ( const QString &  pepstr)

Definition at line 79 of file peptide.cpp.

80{
81
82 QString::const_iterator it(pepstr.begin());
83 if(it != pepstr.end())
84 {
85 // first amino acid is the Nter one
86 // by default, it is obtained by hydrolytic cleavage in normal water
87 // and it is loaded with one Hydrogen
88 Aa nter_aa(it->toLatin1());
89 nter_aa.addAaModification(
90 AaModification::getInstance("internal:Nter_hydrolytic_cleavage_H"));
91 m_aaVec.push_back(nter_aa);
92 it++;
93
94 while(it != pepstr.end())
95 {
96 m_aaVec.push_back(Aa(it->toLatin1()));
97 it++;
98 }
99 // by default, Nter aa is obtained by hydrolytic cleavage in normal water
100 // and it is loaded with Hydrogen + Oxygen
101 m_aaVec.back().addAaModification(
102 AaModification::getInstance("internal:Cter_hydrolytic_cleavage_HO"));
103 getMass();
104 qDebug() << "blabla " << m_aaVec.back().toString();
105 }
106}
static AaModificationP getInstance(const QString &accession)
pappso_double getMass()
Definition peptide.cpp:274
std::vector< Aa > m_aaVec
Definition peptide.h:244

References pappso::Aa::addAaModification(), pappso::AaModification::getInstance(), getMass(), and m_aaVec.

◆ ~Peptide()

pappso::Peptide::~Peptide ( )
virtual

Definition at line 108 of file peptide.cpp.

109{
110}

◆ Peptide() [2/3]

pappso::Peptide::Peptide ( const Peptide peptide)

Definition at line 112 of file peptide.cpp.

113 : m_aaVec(peptide.m_aaVec), m_proxyMass(peptide.m_proxyMass)
114{
115}
pappso_double m_proxyMass
Definition peptide.h:245

◆ Peptide() [3/3]

pappso::Peptide::Peptide ( Peptide &&  toCopy)

Definition at line 118 of file peptide.cpp.

119 : m_aaVec(std::move(toCopy.m_aaVec)), m_proxyMass(toCopy.m_proxyMass)
120{
121}

Member Function Documentation

◆ addAaModification()

void pappso::Peptide::addAaModification ( AaModificationP  aaModification,
unsigned int  position 
)

adds a modification to amino acid sequence

Parameters
aaModificationpointer on modification to add
positionposition in the amino acid sequence (starts at 0)

Definition at line 187 of file peptide.cpp.

189{
190 if(position >= size())
191 {
192 throw ExceptionOutOfRange(
193 QObject::tr("position (%1) > size (%2)").arg(position).arg(size()));
194 }
195 m_proxyMass = -1;
196 qDebug() << "Peptide::addAaModification begin " << position;
197 std::vector<Aa>::iterator it = m_aaVec.begin() + position;
198 it->addAaModification(aaModification);
199 getMass();
200 qDebug() << "Peptide::addAaModification end";
201}
unsigned int size() const override
Definition peptide.cpp:182

References getMass(), m_aaVec, m_proxyMass, and size().

Referenced by pappso::PeptideStrParser::parseStringToPeptide(), reverse(), rotate(), pappso::PeptideBuilder::setPeptide(), pappso::PeptideFixedModificationBuilder::setPeptideSp(), and pappso::PeptideVariableModificationBuilder::setPeptideSp().

◆ addAaModificationOnAllAminoAcid()

void pappso::Peptide::addAaModificationOnAllAminoAcid ( AaModificationP  aaModification,
AminoAcidChar  amino_acid 
)

adds a modification to all amino acid of the sequence

Parameters
aaModificationpointer on modification to add
AminoAcidCharamino_acid to apply the modification

Definition at line 204 of file peptide.cpp.

206{
207
208 for(auto &aa : *this)
209 {
210 if(aa.getAminoAcidChar() == amino_acid)
211 {
212 aa.addAaModification(aaModification);
213 }
214 }
215
216
217 m_proxyMass = -1;
218 getMass();
219}

References getMass(), and m_proxyMass.

◆ begin() [1/2]

std::vector< Aa >::iterator pappso::Peptide::begin ( )

Definition at line 138 of file peptide.cpp.

139{
140 return m_aaVec.begin();
141}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

◆ begin() [2/2]

std::vector< Aa >::const_iterator pappso::Peptide::begin ( ) const

Definition at line 150 of file peptide.cpp.

151{
152 return m_aaVec.begin();
153}

References m_aaVec.

◆ countModificationOnAa()

unsigned int pappso::Peptide::countModificationOnAa ( AaModificationP  mod,
const std::vector< char > &  aa_list 
) const

count modification occurence

Parameters
modmodification to look for
aa_listamino acid list targets (one letter code)
Returns
number of occurences

Definition at line 333 of file peptide.cpp.

335{
336 unsigned int number = 0;
337 std::vector<Aa>::const_iterator it(m_aaVec.begin());
338 while(it != m_aaVec.end())
339 {
340 if(std::find(aa_list.begin(), aa_list.end(), it->getLetter()) !=
341 aa_list.end())
342 {
343 number += it->getNumberOfModification(mod);
344 }
345 it++;
346 }
347 // qDebug() << "Aa::getMass() end " << mass;
348 return number;
349}

References m_aaVec.

◆ end() [1/2]

std::vector< Aa >::iterator pappso::Peptide::end ( )

Definition at line 144 of file peptide.cpp.

145{
146 return m_aaVec.end();
147}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

◆ end() [2/2]

std::vector< Aa >::const_iterator pappso::Peptide::end ( ) const

Definition at line 156 of file peptide.cpp.

157{
158 return m_aaVec.end();
159}

References m_aaVec.

◆ getAa()

Aa & pappso::Peptide::getAa ( unsigned int  position)

Definition at line 602 of file peptide.cpp.

603{
604 if(position >= m_aaVec.size())
605 {
606 throw ExceptionOutOfRange(
607 QObject::tr("no AA at position %1").arg(position));
608 }
609 return m_aaVec.at(position);
610}

References m_aaVec.

Referenced by pappso::PeptideVariableModificationReplacement::replaceModificationsAtPosition().

◆ getAaPositionList() [1/2]

std::vector< unsigned int > pappso::Peptide::getAaPositionList ( char  aa) const

get positions of one amino acid in peptide

Parameters
aathe one letter code of the amino acid
Returns
vector containing positions (from 0 to size-1)

Definition at line 427 of file peptide.cpp.

428{
429 std::vector<unsigned int> position_list;
430 unsigned int number = 0;
431 std::vector<Aa>::const_iterator it(m_aaVec.begin());
432 while(it != m_aaVec.end())
433 {
434 if(it->getLetter() == aa)
435 position_list.push_back(number);
436 number++;
437 it++;
438 }
439 // qDebug() << "Aa::getMass() end " << mass;
440 return position_list;
441}

References m_aaVec.

Referenced by pappso::PeptideBuilder::setPeptide().

◆ getAaPositionList() [2/2]

std::vector< unsigned int > pappso::Peptide::getAaPositionList ( std::list< char >  list_aa) const

Definition at line 444 of file peptide.cpp.

445{
446 std::vector<unsigned int> position_list;
447 unsigned int number = 0;
448 std::vector<Aa>::const_iterator it(m_aaVec.begin());
449 while(it != m_aaVec.end())
450 {
451
452 bool found =
453 (std::find(list_aa.begin(), list_aa.end(), it->getLetter()) !=
454 list_aa.end());
455 if(found)
456 {
457 position_list.push_back(number);
458 }
459 number++;
460 it++;
461 }
462 // qDebug() << "Aa::getMass() end " << mass;
463 return position_list;
464}

References m_aaVec.

◆ getConstAa()

const Aa & pappso::Peptide::getConstAa ( unsigned int  position) const

Definition at line 612 of file peptide.cpp.

613{
614 if(position >= m_aaVec.size())
615 {
616 throw ExceptionOutOfRange(
617 QObject::tr("no AA at position %1").arg(position));
618 }
619 return m_aaVec.at(position);
620}

References m_aaVec.

Referenced by pappso::PeptideModificatorBase::getModificationPositionList().

◆ getInternalCterModification()

AaModificationP pappso::Peptide::getInternalCterModification ( ) const

Definition at line 478 of file peptide.cpp.

479{
480 std::vector<Aa>::const_iterator it(m_aaVec.end());
481 it--;
482 if(it != m_aaVec.end())
483 {
484 return it->getInternalCterModification();
485 }
486 return nullptr;
487}

References m_aaVec.

Referenced by pappso::specglob::PeptideModel::PeptideModel(), pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), removeCterAminoAcid(), reverse(), and rotate().

◆ getInternalNterModification()

AaModificationP pappso::Peptide::getInternalNterModification ( ) const

Definition at line 467 of file peptide.cpp.

468{
469 std::vector<Aa>::const_iterator it(m_aaVec.begin());
470 if(it != m_aaVec.end())
471 {
472 return it->getInternalNterModification();
473 }
474
475 return nullptr;
476}

References m_aaVec.

Referenced by pappso::specglob::PeptideModel::PeptideModel(), pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), removeNterAminoAcid(), reverse(), and rotate().

◆ getLiAbsoluteString()

const QString pappso::Peptide::getLiAbsoluteString ( ) const

get all sequence string with modifications and converting Leucine to Isoleucine

Definition at line 247 of file peptide.cpp.

248{
249 QString seq = "";
250 std::vector<Aa>::const_iterator it(m_aaVec.begin());
251 while(it != m_aaVec.end())
252 {
253 seq += it->toAbsoluteString();
254 it++;
255 }
256 return seq.replace("L", "I");
257}

References m_aaVec.

◆ getMass() [1/2]

pappso_double pappso::Peptide::getMass ( )

Definition at line 274 of file peptide.cpp.

275{
276 qDebug() << "Aa::getMass() begin";
277 if(m_proxyMass < 0)
278 {
279 m_proxyMass = 0;
280 for(auto aa : m_aaVec)
281 {
282 m_proxyMass += aa.getMass();
283 }
284 }
285 qDebug() << "Aa::getMass() end " << m_proxyMass;
286 return m_proxyMass;
287}

References m_aaVec, and m_proxyMass.

Referenced by Peptide(), addAaModification(), addAaModificationOnAllAminoAcid(), pappso::Protein::getMass(), pappso::PeptideProFormaParser::parseStringToPeptide(), removeAaModification(), removeCterAminoAcid(), removeNterAminoAcid(), and replaceAaModification().

◆ getMass() [2/2]

pappso_double pappso::Peptide::getMass ( ) const
overridevirtual

Implements pappso::Ion.

Definition at line 175 of file peptide.cpp.

176{
177 return m_proxyMass;
178}

References m_proxyMass.

◆ getModificationPositionList() [1/2]

std::vector< unsigned int > pappso::Peptide::getModificationPositionList ( AaModificationP  mod) const

get modification positions

Parameters
modmodification to look for
Returns
vector containing positions (from 0 to size-1)

Definition at line 380 of file peptide.cpp.

381{
382 std::vector<unsigned int> position_list;
383 unsigned int position = 0;
384 std::vector<Aa>::const_iterator it(m_aaVec.begin());
385 while(it != m_aaVec.end())
386 {
387 unsigned int number = 0;
388 number += it->getNumberOfModification(mod);
389 for(unsigned int j = 0; j < number; j++)
390 {
391 position_list.push_back(position);
392 }
393 it++;
394 position++;
395 }
396 // qDebug() << "Aa::getMass() end " << mass;
397 return position_list;
398}

References m_aaVec.

◆ getModificationPositionList() [2/2]

std::vector< unsigned int > pappso::Peptide::getModificationPositionList ( AaModificationP  mod,
const std::vector< char > &  aa_list 
) const

get modification positions

Parameters
modmodification to look for
aa_listamino acid list targets (one letter code)
Returns
vector containing positions (from 0 to size-1)

Definition at line 401 of file peptide.cpp.

403{
404 std::vector<unsigned int> position_list;
405 unsigned int position = 0;
406 std::vector<Aa>::const_iterator it(m_aaVec.begin());
407 while(it != m_aaVec.end())
408 {
409 if(std::find(aa_list.begin(), aa_list.end(), it->getLetter()) !=
410 aa_list.end())
411 {
412 unsigned int number = 0;
413 number += it->getNumberOfModification(mod);
414 for(unsigned int j = 0; j < number; j++)
415 {
416 position_list.push_back(position);
417 }
418 }
419 it++;
420 position++;
421 }
422 // qDebug() << "Aa::getMass() end " << mass;
423 return position_list;
424}

References m_aaVec.

◆ getNumberOfAtom()

int pappso::Peptide::getNumberOfAtom ( AtomIsotopeSurvey  atom) const
overridevirtual

get the number of atom C, O, N, H in the molecule

Implements pappso::AtomNumberInterface.

Definition at line 290 of file peptide.cpp.

291{
292 int number = 0;
293 std::vector<Aa>::const_iterator it(m_aaVec.begin());
294 while(it != m_aaVec.end())
295 {
296 number += it->getNumberOfAtom(atom);
297 it++;
298 }
299 // qDebug() << "Aa::getMass() end " << mass;
300 return number;
301}

References m_aaVec.

◆ getNumberOfIsotope()

int pappso::Peptide::getNumberOfIsotope ( Isotope  isotope) const
overridevirtual

get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule

Implements pappso::AtomNumberInterface.

Definition at line 304 of file peptide.cpp.

305{
306 int number = 0;
307 std::vector<Aa>::const_iterator it(m_aaVec.begin());
308 while(it != m_aaVec.end())
309 {
310 number += it->getNumberOfIsotope(isotope);
311 it++;
312 }
313 // qDebug() << "Aa::getMass() end " << mass;
314 return number;
315}

References m_aaVec.

◆ getNumberOfModification()

unsigned int pappso::Peptide::getNumberOfModification ( AaModificationP  mod) const

count modification occurence

Parameters
modmodification to look for
Returns
number of occurences

Definition at line 319 of file peptide.cpp.

320{
321 unsigned int number = 0;
322 std::vector<Aa>::const_iterator it(m_aaVec.begin());
323 while(it != m_aaVec.end())
324 {
325 number += it->getNumberOfModification(mod);
326 it++;
327 }
328 // qDebug() << "Aa::getMass() end " << mass;
329 return number;
330}

References m_aaVec.

◆ getSequence()

const QString pappso::Peptide::getSequence ( ) const
overridevirtual

print amino acid sequence without modifications

Implements pappso::PeptideInterface.

Definition at line 222 of file peptide.cpp.

223{
224 QString seq = "";
225 std::vector<Aa>::const_iterator it(m_aaVec.begin());
226 while(it != m_aaVec.end())
227 {
228 seq += it->getLetter();
229 it++;
230 }
231 return seq;
232}

References m_aaVec.

Referenced by pappso::XtandemHyperscoreBis::computeXtandemHyperscore(), and pappso::PeptideModificatorBase::getModificationPositionList().

◆ isPalindrome()

bool pappso::Peptide::isPalindrome ( ) const
overridevirtual

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 587 of file peptide.cpp.

588{
589 std::size_t size = m_aaVec.size();
590 std::size_t k = (size - 1);
591 for(std::size_t i = 0; i < (size / 2); i++, k--)
592 {
593 if(m_aaVec[i].getLetter() != m_aaVec[k].getLetter())
594 {
595 return false;
596 }
597 }
598 return true;
599}

References m_aaVec, and size().

◆ makeNoConstPeptideSp()

NoConstPeptideSp pappso::Peptide::makeNoConstPeptideSp ( ) const

Definition at line 131 of file peptide.cpp.

132{
133 return std::make_shared<Peptide>(*this);
134}

Referenced by pappso::PeptideProFormaParser::parseNoConstString(), and pappso::PeptideStrParser::parseNoConstString().

◆ makePeptideSp()

◆ rbegin()

std::vector< Aa >::const_reverse_iterator pappso::Peptide::rbegin ( ) const

Definition at line 162 of file peptide.cpp.

163{
164 return m_aaVec.rbegin();
165}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

◆ removeAaModification()

void pappso::Peptide::removeAaModification ( AaModificationP  mod)

removes all occurences of a modification

Parameters
modmodification to remove

Definition at line 366 of file peptide.cpp.

367{
368 std::vector<Aa>::iterator it(m_aaVec.begin());
369 while(it != m_aaVec.end())
370 {
371 it->removeAaModification(mod);
372 qDebug() << it->toString() << " " << toAbsoluteString();
373 it++;
374 }
375 m_proxyMass = -1;
376 getMass();
377 // qDebug() << "Aa::getMass() end " << mass;
378}
const QString toAbsoluteString() const
print all modifications
Definition peptide.cpp:234

References getMass(), m_aaVec, m_proxyMass, and toAbsoluteString().

◆ removeCterAminoAcid()

void pappso::Peptide::removeCterAminoAcid ( )

Definition at line 660 of file peptide.cpp.

661{
662 std::vector<Aa>::iterator it(m_aaVec.end());
663 it--;
664 if(it != m_aaVec.end())
665 {
666 AaModificationP cter_modification = getInternalCterModification();
667 m_aaVec.erase(it);
668 if(cter_modification != nullptr)
669 {
670 it = m_aaVec.end();
671 it--;
672 it->addAaModification(cter_modification);
673 }
674 m_proxyMass = -1;
675 getMass();
676 }
677 else
678 {
679 throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
680 }
681}
AaModificationP getInternalCterModification() const
Definition peptide.cpp:478
const AaModification * AaModificationP

References getInternalCterModification(), getMass(), m_aaVec, and m_proxyMass.

◆ removeInternalCterModification()

void pappso::Peptide::removeInternalCterModification ( )

Definition at line 500 of file peptide.cpp.

501{
502 std::vector<Aa>::iterator it(m_aaVec.end());
503 it--;
504 if(it != m_aaVec.end())
505 {
506 m_proxyMass -= it->getMass();
507 it->removeInternalCterModification();
508 m_proxyMass += it->getMass();
509 }
510}

References m_aaVec, and m_proxyMass.

Referenced by reverse(), rotate(), and setInternalCterModification().

◆ removeInternalNterModification()

void pappso::Peptide::removeInternalNterModification ( )

Definition at line 489 of file peptide.cpp.

490{
491 std::vector<Aa>::iterator it(m_aaVec.begin());
492 if(it != m_aaVec.end())
493 {
494 m_proxyMass -= it->getMass();
495 it->removeInternalNterModification();
496 m_proxyMass += it->getMass();
497 }
498}

References m_aaVec, and m_proxyMass.

Referenced by setInternalNterModification().

◆ removeNterAminoAcid()

void pappso::Peptide::removeNterAminoAcid ( )

Definition at line 637 of file peptide.cpp.

638{
639 std::vector<Aa>::iterator it(m_aaVec.begin());
640 if(it != m_aaVec.end())
641 {
642 AaModificationP nter_modification = getInternalNterModification();
643 m_aaVec.erase(it);
644 if(nter_modification != nullptr)
645 {
646 m_aaVec.begin()->addAaModification(nter_modification);
647 }
648
649 m_proxyMass = -1;
650 getMass();
651 }
652 else
653 {
654 throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
655 }
656}
AaModificationP getInternalNterModification() const
Definition peptide.cpp:467

References getInternalNterModification(), getMass(), m_aaVec, and m_proxyMass.

◆ rend()

std::vector< Aa >::const_reverse_iterator pappso::Peptide::rend ( ) const

Definition at line 168 of file peptide.cpp.

169{
170 return m_aaVec.rend();
171}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

◆ replaceAaModification()

void pappso::Peptide::replaceAaModification ( AaModificationP  oldmod,
AaModificationP  newmod 
)

replaces all occurences of a modification by a new one

Parameters
oldmodmodification to change
newmodnew modification

Definition at line 352 of file peptide.cpp.

353{
354 if(oldmod == newmod)
355 return;
356 std::vector<Aa>::iterator it(m_aaVec.begin());
357 while(it != m_aaVec.end())
358 {
359 it->replaceAaModification(oldmod, newmod);
360 it++;
361 }
362 m_proxyMass = -1;
363 getMass();
364}

References getMass(), m_aaVec, and m_proxyMass.

◆ replaceLeucineIsoleucine()

void pappso::Peptide::replaceLeucineIsoleucine ( )

Definition at line 624 of file peptide.cpp.

625{
626
627 std::vector<Aa>::iterator it(m_aaVec.begin());
628 std::vector<Aa>::iterator itend(m_aaVec.end());
629 for(; it != itend; it++)
630 {
631 it->replaceLeucineIsoleucine();
632 }
633}

References m_aaVec.

◆ reverse()

void pappso::Peptide::reverse ( )

Definition at line 574 of file peptide.cpp.

575{
578 m_aaVec.begin()->removeInternalNterModification();
580 std::reverse(m_aaVec.begin(), m_aaVec.end());
581 m_aaVec.begin()->addAaModification(modNter);
582 (m_aaVec.end() - 1)->addAaModification(modCter);
583}
void removeInternalCterModification()
Definition peptide.cpp:500
void addAaModification(AaModificationP aaModification, unsigned int position)
adds a modification to amino acid sequence
Definition peptide.cpp:187

References addAaModification(), getInternalCterModification(), getInternalNterModification(), m_aaVec, and removeInternalCterModification().

◆ rotate()

void pappso::Peptide::rotate ( )

Definition at line 562 of file peptide.cpp.

563{
566 m_aaVec.begin()->removeInternalNterModification();
568 std::rotate(m_aaVec.begin(), m_aaVec.begin() + 1, m_aaVec.end());
569 m_aaVec.begin()->addAaModification(modNter);
570 (m_aaVec.end() - 1)->addAaModification(modCter);
571}

References addAaModification(), getInternalCterModification(), getInternalNterModification(), m_aaVec, and removeInternalCterModification().

◆ setInternalCterModification()

void pappso::Peptide::setInternalCterModification ( AaModificationP  mod)

Definition at line 537 of file peptide.cpp.

538{
539 if(mod->getAccession().startsWith("internal:Cter_"))
540 {
542 std::vector<Aa>::iterator it(m_aaVec.end());
543 it--;
544 if(it != m_aaVec.end())
545 {
546 it->addAaModification(mod);
547 }
548 else
549 {
550 throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
551 }
552 }
553 else
554 {
555 throw ExceptionNotPossible(
556 QObject::tr("modification is not an internal Cter modification : %1")
557 .arg(mod->getAccession()));
558 }
559}

References pappso::AaModification::getAccession(), m_aaVec, and removeInternalCterModification().

Referenced by pappso::PeptideStrParser::parseStringToPeptide().

◆ setInternalNterModification()

void pappso::Peptide::setInternalNterModification ( AaModificationP  mod)

Definition at line 514 of file peptide.cpp.

515{
516 if(mod->getAccession().startsWith("internal:Nter_"))
517 {
519 std::vector<Aa>::iterator it(m_aaVec.begin());
520 if(it != m_aaVec.end())
521 {
522 it->addAaModification(mod);
523 }
524 else
525 {
526 throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
527 }
528 }
529 else
530 {
531 throw ExceptionNotPossible(
532 QObject::tr("modification is not an internal Nter modification : %1")
533 .arg(mod->getAccession()));
534 }
535}
void removeInternalNterModification()
Definition peptide.cpp:489

References pappso::AaModification::getAccession(), m_aaVec, and removeInternalNterModification().

Referenced by pappso::PeptideStrParser::parseStringToPeptide().

◆ size()

unsigned int pappso::Peptide::size ( ) const
overridevirtual

◆ toAbsoluteString()

const QString pappso::Peptide::toAbsoluteString ( ) const

print all modifications

Definition at line 234 of file peptide.cpp.

235{
236 QString seq = "";
237 std::vector<Aa>::const_iterator it(m_aaVec.begin());
238 while(it != m_aaVec.end())
239 {
240 seq += it->toAbsoluteString();
241 it++;
242 }
243 return seq;
244}

References m_aaVec.

Referenced by removeAaModification().

◆ toProForma()

QString pappso::Peptide::toProForma ( ) const

get the peptide model in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README.md

Returns
QString as described in ProForma

Definition at line 684 of file peptide.cpp.

685{
686
687 QString seq = "";
688 std::vector<Aa>::const_iterator it(m_aaVec.begin());
689 while(it != m_aaVec.end())
690 {
691 seq += it->toProForma();
692 it++;
693 }
694 return seq;
695}

References m_aaVec.

◆ toString()

const QString pappso::Peptide::toString ( ) const

print modification except internal modifications

Definition at line 261 of file peptide.cpp.

262{
263 QString seq = "";
264 std::vector<Aa>::const_iterator it(m_aaVec.begin());
265 while(it != m_aaVec.end())
266 {
267 seq += it->toString();
268 it++;
269 }
270 return seq;
271}

References m_aaVec.

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const Peptide l,
const Peptide r 
)
friend

Definition at line 107 of file peptide.h.

109 {
110 return (l.m_aaVec < r.m_aaVec);
111 }

◆ operator==

bool operator== ( const Peptide l,
const Peptide r 
)
friend

Definition at line 113 of file peptide.h.

114 {
115 return (l.m_aaVec == r.m_aaVec);
116 }

◆ PeptideProFormaParser

friend class PeptideProFormaParser
friend

Definition at line 101 of file peptide.h.

Member Data Documentation

◆ m_aaVec

◆ m_proxyMass


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