Loading...
Searching...
No Matches
pappso::PeptideProFormaParser Class Reference

`#include <peptideproformaparser.h>`

## Static Public Member Functions

static PeptideSp | parseString (const QString &pepstr)
static NoConstPeptideSp | parseNoConstString (const QString &pepstr)

## Static Private Member Functions

static void | parseStringToPeptide (const QString &pepstr, Peptide &peptide)

## Static Private Attributes

static QRegularExpression | _rx_psimod
static QRegularExpression | _rx_modmass

## Detailed Description

Todo:
  write docs

Definition at line 38 of file peptideproformaparser.h.

## Member Function Documentation

## parseNoConstString()

NoConstPeptideSp pappso::PeptideProFormaParser::parseNoConstString | ( | const QString & | pepstr | ) |

static

Definition at line 121 of file peptideproformaparser.cpp.

{
// QMutexLocker locker(&_mutex);
Peptide peptide("");
PeptideProFormaParser::parseStringToPeptide(pepstr, peptide);
return (peptide.makeNoConstPeptideSp());
}
pappso::PeptideProFormaParser::parseStringToPeptide
static void parseStringToPeptide(const QString &pepstr, Peptide &peptide)
Definition peptideproformaparser.cpp:41

References pappso::Peptide::makeNoConstPeptideSp(), and parseStringToPeptide().

## parseString()

PeptideSp pappso::PeptideProFormaParser::parseString | ( | const QString & | pepstr | ) |

static

Definition at line 110 of file peptideproformaparser.cpp.

{
// QMutexLocker locker(&_mutex);
Peptide peptide("");
PeptideProFormaParser::parseStringToPeptide(pepstr, peptide);
// qDebug() << peptide.toProForma();
return (peptide.makePeptideSp());
}

References pappso::Peptide::makePeptideSp(), and parseStringToPeptide().

## parseStringToPeptide()

void pappso::PeptideProFormaParser::parseStringToPeptide | ( | const QString & | pepstr,
|  | Peptide & | peptide
| ) |  |

static private

Definition at line 41 of file peptideproformaparser.cpp.

{
// Peptide
// peptide2("C[MOD:00397][MOD:01160]C[MOD:00397]AADDKEAC[MOD:00397]FAVEGPK");
// CCAADDKEACFAVEGPK
/*
<psimod position="1" accession="MOD:00397"/>
<psimod position="2" accession="MOD:00397"/>
<psimod position="10" accession="MOD:00397"/>
<psimod position="1" accession="MOD:01160"/>
*/
std::size_t i = 0;
std::size_t end = pepstr.size();
while(i < end)
{
QChar aa_char = pepstr[i];
if(aa_char == '[')
{
QString mod;
i++;
aa_char = pepstr[i];
while((i < end) && (aa_char != ']'))
{
mod.append(aa_char);
i++;
aa_char = pepstr[i];
}
// we have a mod
// is it a double ?
bool is_double = false;
double mass_modif = mod.toDouble(&is_double);
if(is_double)
{
peptide.m_aaVec.back().addAaModification(
AaModification::getInstanceCustomizedMod(mass_modif));
}
else
{
peptide.m_aaVec.back().addAaModification(
AaModification::getInstance(mod));
}
}
else
{
if(aa_char.isLetter())
{
Aa pappso_aa(aa_char.toLatin1());
if(peptide.size() == 0)
{
pappso_aa.addAaModification(AaModification::getInstance(
"internal:Nter_hydrolytic_cleavage_H"));
}
peptide.m_aaVec.push_back(pappso_aa);
}
}
i++;
}
peptide.m_aaVec.back().addAaModification(
AaModification::getInstance("internal:Cter_hydrolytic_cleavage_HO"));
// qDebug() << peptide.toProForma();
peptide.m_proxyMass = -1;
peptide.getMass();
}
pappso::AaModification::getInstance
static AaModificationP getInstance(const QString &accession)
Definition aamodification.cpp:456
pappso::AaModification::getInstanceCustomizedMod
static AaModificationP getInstanceCustomizedMod(pappso_double modificationMass)
Definition aamodification.cpp:436

References pappso::Aa::addAaModification(), pappso::AaModification::getInstance(), pappso::AaModification::getInstanceCustomizedMod(), pappso::Peptide::getMass(), pappso::Peptide::m_aaVec, pappso::Peptide::m_proxyMass, and pappso::Peptide::size().

Referenced by parseNoConstString(), and parseString().

## Member Data Documentation

## _rx_modmass

QRegularExpression pappso::PeptideProFormaParser::_rx_modmass

static private

Definition at line 52 of file peptideproformaparser.h.

## _rx_psimod

QRegularExpression pappso::PeptideProFormaParser::_rx_psimod

static private

Definition at line 51 of file peptideproformaparser.h.

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

- pappsomspp/peptide/peptideproformaparser.h
- pappsomspp/peptide/peptideproformaparser.cpp