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 239 of file aa.cpp.

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

References m_listMod.

◆ getInternalNterModification()

AaModificationP pappso::Aa::getInternalNterModification ( ) const

Definition at line 228 of file aa.cpp.

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

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 187 of file aa.cpp.

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

◆ 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 201 of file aa.cpp.

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

◆ getNumberOfModification()

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

Definition at line 214 of file aa.cpp.

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

◆ isAaEqual()

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

Definition at line 293 of file aa.cpp.

◆ isLesser()

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

Definition at line 268 of file aa.cpp.

273 {
274 
275  return (std::tie(m_aaLetter, m_listMod) ==
276  std::tie(r.m_aaLetter, r.m_listMod));
277 }
278 
279 bool
280 operator==(Aa const &l, Aa const &r)
281 {
282  return l.isAaEqual(r);
283 }
284 
285 bool
286 operator<(Aa const &l, Aa const &r)
287 {
288  return l.isLesser(r);
289 }
290 } /* 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  sort(m_listMod.begin(), m_listMod.end());
163 }
164 
165 int
167 {
168  int number_of_carbon = AaBase::getNumberOfAtom(atom);

References m_listMod.

◆ removeInternalCterModification()

void pappso::Aa::removeInternalCterModification ( )

Definition at line 259 of file aa.cpp.

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

◆ removeInternalNterModification()

void pappso::Aa::removeInternalNterModification ( )

Definition at line 250 of file aa.cpp.

252  {
253  std::size_t a = m_listMod.size();
254  std::size_t b = r.m_listMod.size();
255 
256  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.

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

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:307
pappso::PeptideIonNter::a
@ a
pappso::operator==
bool operator==(Aa const &l, Aa const &r)
Definition: aa.cpp:301
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:187
pappso::AaBase::getLetter
virtual const char & getLetter() const
Definition: aabase.cpp:432
pappso::Aa::isLesser
bool isLesser(Aa const &r) const
Definition: aa.cpp:268
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