pappsomspp
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 63 of file aa.h.

Constructor & Destructor Documentation

◆ Aa() [1/4]

pappso::Aa::Aa ( char  aa_letter)

Definition at line 61 of file aa.cpp.

61 {
62 }
63 

◆ Aa() [2/4]

pappso::Aa::Aa ( AminoAcidChar  aa_char)

Definition at line 66 of file aa.cpp.

66 {
67  m_aaLetter = toCopy.m_aaLetter;
68  m_listMod = toCopy.m_listMod;

References pappso::AaBase::m_aaLetter, and m_listMod.

◆ Aa() [3/4]

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

Definition at line 70 of file aa.cpp.

◆ Aa() [4/4]

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

Definition at line 75 of file aa.cpp.

◆ ~Aa()

pappso::Aa::~Aa ( )
virtual

Definition at line 80 of file aa.cpp.

80 {
81  qDebug() << "Aa::getMass() begin";

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

Member Function Documentation

◆ addAaModification()

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

◆ getInternalCterModification()

AaModificationP pappso::Aa::getInternalCterModification ( ) const

Definition at line 237 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

References pappso::AaModificationP, and m_listMod.

◆ getInternalNterModification()

AaModificationP pappso::Aa::getInternalNterModification ( ) const

Definition at line 226 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 }

References pappso::AaModificationP, and m_listMod.

◆ getMass()

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

Reimplemented from pappso::AaBase.

Definition at line 99 of file aa.cpp.

99  {
100  QStringList modification_str_list;
101  while(it != m_listMod.end())
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 }

References m_listMod.

◆ getModificationList()

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

Definition at line 93 of file aa.cpp.

94 {
95  QString seq = "";
96  seq += this->getLetter();

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

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

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

207 {
208  for(auto &&modb : m_listMod)
209  {

◆ getNumberOfModification()

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

Definition at line 212 of file aa.cpp.

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

◆ isAaEqual()

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

Definition at line 291 of file aa.cpp.

◆ isLesser()

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

Definition at line 266 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 }

◆ operator=()

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

Definition at line 85 of file aa.cpp.

◆ removeAaModification()

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

Definition at line 157 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);

References m_listMod.

◆ removeInternalCterModification()

void pappso::Aa::removeInternalCterModification ( )

Definition at line 257 of file aa.cpp.

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

◆ removeInternalNterModification()

void pappso::Aa::removeInternalNterModification ( )

Definition at line 248 of file aa.cpp.

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

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

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

References m_listMod.

◆ toAbsoluteString()

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

Definition at line 113 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(","));

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

◆ toString()

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

Definition at line 133 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();

Member Data Documentation

◆ m_listMod


The documentation for this class was generated from the following files:
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:67
pappso::operator<
bool operator<(Aa const &l, Aa const &r)
Definition: aa.cpp:305
pappso::AaBase::getMass
virtual pappso_double getMass() const
Definition: aabase.cpp:385
pappso::PeptideIonNter::a
pappso::operator==
bool operator==(Aa const &l, Aa const &r)
Definition: aa.cpp:299
pappso::Aa::addAaModification
void addAaModification(AaModificationP aaModification)
Definition: aa.cpp:170
pappso::Aa::Aa
Aa(char aa_letter)
Definition: aa.cpp:61
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:185
pappso::AaBase::getLetter
virtual const char & getLetter() const
Definition: aabase.cpp:432
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 typedef AaModification * AaModificationP
Definition: aamodification.h:71
pappso::PeptideIonNter::b
pappso::AaBase::m_aaLetter
char m_aaLetter
Definition: aabase.h:104
pappso::Aa::m_listMod
std::vector< AaModificationP > m_listMod
Definition: aa.h:128
pappso::AtomIsotopeSurvey
AtomIsotopeSurvey
Definition: types.h:94