libpappsomspp
Library for mass spectrometry
pappso::Aa Class Reference

#include <aa.h>

Inheritance diagram for pappso::Aa:
pappso::AaBase pappso::AtomNumberInterface

Public Member Functions

 Aa (char aa_letter)
 
 Aa (AminoAcidChar aa_char)
 
 Aa (const Aa &aa)
 
 Aa (Aa &&toCopy)
 
Aaoperator= (const Aa &toCopy)
 
virtual ~Aa ()
 
pappso_double getMass () const override
 
int getNumberOfAtom (AtomIsotopeSurvey atom) const override final
 get the number of atom C, O, N, H in the molecule More...
 
int getNumberOfIsotope (Isotope isotope) const override final
 get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule More...
 
unsigned int getNumberOfModification (AaModificationP mod) const
 
const QString toString () const
 
const QString toAbsoluteString () const
 
void addAaModification (AaModificationP aaModification)
 
void removeAaModification (AaModificationP aaModification)
 
void replaceAaModification (AaModificationP oldmod, AaModificationP newmod)
 replaces all occurences of a modification by a new one More...
 
AaModificationP getInternalNterModification () const
 
AaModificationP getInternalCterModification () const
 
void removeInternalNterModification ()
 
void removeInternalCterModification ()
 
const std::vector< AaModificationP > & getModificationList () const
 
bool isLesser (Aa const &r) const
 
bool isAaEqual (Aa const &r) const
 
- Public Member Functions inherited from pappso::AaBase
virtual const char & getLetter () const
 
virtual void replaceLeucineIsoleucine ()
 

Private Attributes

std::vector< AaModificationPm_listMod
 

Additional Inherited Members

- Static Public Member Functions inherited from pappso::AaBase
static const std::vector< AminoAcidChar > & getAminoAcidCharList ()
 
- Protected Member Functions inherited from pappso::AaBase
 AaBase (char aa_letter)
 
 AaBase (AminoAcidChar aa_char)
 
 AaBase (const AaBase &aabase)
 
virtual ~AaBase ()
 
int getNumberOfIsotope (Isotope isotope) const override
 get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule More...
 
- Static Protected Member Functions inherited from pappso::AaBase
static pappso_double getAaMass (char aa_letter)
 
- Protected Attributes inherited from pappso::AaBase
char m_aaLetter
 

Detailed Description

Definition at line 65 of file aa.h.

Constructor & Destructor Documentation

◆ Aa() [1/4]

pappso::Aa::Aa ( char  aa_letter)

Definition at line 62 of file aa.cpp.

◆ Aa() [2/4]

pappso::Aa::Aa ( AminoAcidChar  aa_char)

Definition at line 67 of file aa.cpp.

◆ Aa() [3/4]

pappso::Aa::Aa ( const Aa aa)

Definition at line 71 of file aa.cpp.

74 {

References m_listMod.

◆ Aa() [4/4]

pappso::Aa::Aa ( Aa &&  toCopy)

Definition at line 76 of file aa.cpp.

80 {

◆ ~Aa()

pappso::Aa::~Aa ( )
virtual

Definition at line 81 of file aa.cpp.

83  : m_listMod)

Member Function Documentation

◆ addAaModification()

void pappso::Aa::addAaModification ( AaModificationP  aaModification)

◆ getInternalCterModification()

AaModificationP pappso::Aa::getInternalCterModification ( ) const

Definition at line 238 of file aa.cpp.

238 {
239  std::remove_if(
240  m_listMod.begin(), m_listMod.end(), [](AaModificationP const &mod) {
241  return mod->getAccession().startsWith("internal:Cter_");
242  });
243 }
244 
245 bool
246 Aa::isLesser(Aa const &r) const

References m_listMod.

◆ getInternalNterModification()

AaModificationP pappso::Aa::getInternalNterModification ( ) const

Definition at line 227 of file aa.cpp.

229 {
230  std::remove_if(
231  m_listMod.begin(), m_listMod.end(), [](AaModificationP const &mod) {
232  return mod->getAccession().startsWith("internal:Nter_");
233  });
234 }
235 

References m_listMod.

◆ getMass()

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

Reimplemented from pappso::AaBase.

Definition at line 100 of file aa.cpp.

102  {
103  modification_str_list << (*it)->getAccession();
104  it++;
105  }
106  if(modification_str_list.size() > 0)
107  seq += QString("(%1)").arg(modification_str_list.join(","));
108  }
109  return seq;
110 }
111 

◆ getModificationList()

const std::vector< AaModificationP > & pappso::Aa::getModificationList ( ) const

Definition at line 94 of file aa.cpp.

94 {
95  QString seq = "";
96  seq += this->getLetter();
97  auto it(m_listMod.begin());

References pappso::AaBase::getLetter(), and m_listMod.

◆ getNumberOfAtom()

int pappso::Aa::getNumberOfAtom ( AtomIsotopeSurvey  atom) const
finaloverridevirtual

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

Reimplemented from pappso::AaBase.

Definition at line 186 of file aa.cpp.

193 {
194  unsigned int number_of_mod = 0;
195  for(auto &&modb : m_listMod)
196  {

◆ getNumberOfIsotope()

int pappso::Aa::getNumberOfIsotope ( Isotope  isotope) const
finaloverridevirtual

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

Implements pappso::AtomNumberInterface.

Definition at line 200 of file aa.cpp.

207 {
208  for(auto &&modb : m_listMod)
209  {
210  if(modb->getAccession().startsWith("internal:Nter_"))

◆ getNumberOfModification()

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

Definition at line 213 of file aa.cpp.

218 {
219  for(auto &&modb : m_listMod)
220  {
221  if(modb->getAccession().startsWith("internal:Cter_"))
222  return modb;
223  }
224  return nullptr;

◆ isAaEqual()

bool pappso::Aa::isAaEqual ( Aa const &  r) const

Definition at line 292 of file aa.cpp.

◆ isLesser()

bool pappso::Aa::isLesser ( Aa const &  r) const

Definition at line 267 of file aa.cpp.

272 {
273 
274  return (std::tie(m_aaLetter, m_listMod) ==
275  std::tie(r.m_aaLetter, r.m_listMod));
276 }
277 
278 bool
279 operator==(Aa const &l, Aa const &r)
280 {
281  return l.isAaEqual(r);
282 }
283 
284 bool
285 operator<(Aa const &l, Aa const &r)
286 {
287  return l.isLesser(r);
288 }
289 } /* namespace pappso */

◆ operator=()

Aa & pappso::Aa::operator= ( const Aa toCopy)

Definition at line 86 of file aa.cpp.

◆ removeAaModification()

void pappso::Aa::removeAaModification ( AaModificationP  aaModification)

Definition at line 158 of file aa.cpp.

160 {
161  std::replace(m_listMod.begin(), m_listMod.end(), oldmod, newmod);
162 }
163 
164 int
166 {
167  int number_of_carbon = AaBase::getNumberOfAtom(atom);
168  for(auto &&mod : m_listMod)

References m_listMod.

◆ removeInternalCterModification()

void pappso::Aa::removeInternalCterModification ( )

Definition at line 258 of file aa.cpp.

260  {
261  return (a < b);
262  }
263  }
264  else

◆ removeInternalNterModification()

void pappso::Aa::removeInternalNterModification ( )

Definition at line 249 of file aa.cpp.

251  {
252  std::size_t a = m_listMod.size();
253  std::size_t b = r.m_listMod.size();
254 
255  if(a == b)

References pappso::a, pappso::b, and m_listMod.

◆ replaceAaModification()

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

replaces all occurences of a modification by a new one

Parameters
oldmodmodification to change
newmodnew modification

Definition at line 180 of file aa.cpp.

180 {
181  int number = 0;
182  for(auto &&mod : m_listMod)
183  {

References m_listMod.

◆ toAbsoluteString()

const QString pappso::Aa::toAbsoluteString ( ) const

Definition at line 114 of file aa.cpp.

114 {
115  QString seq = "";
116  seq += this->getLetter();
117  auto it(m_listMod.begin());
118  if(it != m_listMod.end())
119  {
120  QStringList modification_str_list;
121  while(it != m_listMod.end())
122  {
123  if(!(*it)->isInternal())
124  {
125  modification_str_list << (*it)->getAccession();
126  }
127  it++;
128  }
129  if(modification_str_list.size() > 0)
130  seq += QString("(%1)").arg(modification_str_list.join(","));
131  }

References pappso::AaBase::getLetter(), and m_listMod.

◆ toString()

const QString pappso::Aa::toString ( ) const

Definition at line 134 of file aa.cpp.

138 {
139  std::vector<AaModificationP>::iterator it =
140  std::find(m_listMod.begin(), m_listMod.end(), mod);
141  if(it != m_listMod.end())
142  {
143  m_listMod.erase(it);
144  }
145 
146  qDebug() << m_listMod << endl;
147 }
148 
149 void
151 {
152  qDebug() << "Aa::addAaModification begin";
153  qDebug() << aaModification->getAccession();
154  m_listMod.push_back(aaModification);

References m_listMod.

Member Data Documentation

◆ m_listMod


The documentation for this class was generated from the following files:
pappso::operator<
bool operator<(Aa const &l, Aa const &r)
Definition: aa.cpp:306
pappso::PeptideIonNter::a
@ a
pappso::operator==
bool operator==(Aa const &l, Aa const &r)
Definition: aa.cpp:300
pappso::Aa::addAaModification
void addAaModification(AaModificationP aaModification)
Definition: aa.cpp:171
pappso::Aa::Aa
Aa(char aa_letter)
Definition: aa.cpp:62
pappso::Aa::getNumberOfAtom
int getNumberOfAtom(AtomIsotopeSurvey atom) const override final
get the number of atom C, O, N, H in the molecule
Definition: aa.cpp:186
pappso::AaBase::getLetter
virtual const char & getLetter() const
Definition: aabase.cpp:432
pappso::Aa::isLesser
bool isLesser(Aa const &r) const
Definition: aa.cpp:267
pappso::AaBase::getNumberOfAtom
virtual int getNumberOfAtom(AtomIsotopeSurvey atom) const override
get the number of atom C, O, N, H in the molecule
Definition: aabase.cpp:392
pappso::AaModificationP
const AaModification * AaModificationP
Definition: aamodification.h:73
pappso::PeptideIonNter::b
@ b
pappso::AaBase::m_aaLetter
char m_aaLetter
Definition: aabase.h:107
pappso::Aa::m_listMod
std::vector< AaModificationP > m_listMod
Definition: aa.h:131
pappso::AtomIsotopeSurvey
AtomIsotopeSurvey
Definition: types.h:97