24 #include <QStringList>
26 #include "../obo/filterobopsimodtermlabel.h"
27 #include "../obo/filterobopsimodsink.h"
49 int matched_length_cumul = 0;
52 QRegularExpressionMatch match_mod =
_mod_parser.match(pepstr, pos);
54 while(match_mod.hasMatch())
56 pos = match_mod.capturedStart(0);
57 QString captured = match_mod.captured(0);
58 qDebug() <<
" captured=" << captured <<
" pos=" << pos
59 <<
" match_mod.lastCapturedIndex()="
60 << match_mod.lastCapturedIndex();
61 QStringList mod_list = captured.mid(1, captured.size() - 2)
62 .split(QRegularExpression(
"[+,\\,]"));
63 for(QString &mod : mod_list)
65 qDebug() <<
"PeptideStrParser::parseString mod " << mod;
66 QRegularExpressionMatch match_psimod =
_rx_psimod.match(mod);
67 if(match_psimod.hasMatch())
69 qDebug() <<
"PeptideStrParser::parseString pos-1 "
70 << (pos - 1 - matched_length_cumul);
72 pos - 1 - matched_length_cumul);
74 else if(mod.startsWith(
"internal:Nter_"))
79 else if(mod.startsWith(
"internal:Cter_"))
86 qDebug() <<
"mod=" << mod;
87 QRegularExpressionMatch match_modmass =
_rx_modmass.match(mod);
88 if(match_modmass.hasMatch())
91 qDebug() <<
"number mod=" << mod
92 <<
" cap=" << match_modmass.captured(0);
93 if(!mod.contains(
"."))
96 qDebug() <<
"integer mod=" << mod;
97 mod =
"MOD:0000" + mod;
100 mod = mod.replace(4, 1,
"");
104 pos - 1 - matched_length_cumul);
108 qDebug() <<
"double mod=" << mod;
112 pos - 1 - matched_length_cumul);
117 qDebug() <<
"not a number mod=" << mod;
125 pos - 1 - matched_length_cumul);
129 matched_length_cumul += captured.size();
static AaModificationP getInstance(const QString &accession)
static AaModificationP getInstanceCustomizedMod(pappso_double modificationMass)
const OboPsiModTerm & getFirst()
static NoConstPeptideSp parseNoConstString(const QString &pepstr)
static QRegularExpression _rx_psimod
static PeptideSp parseString(const QString &pepstr)
static void parseStringToPeptide(const QString &pepstr, Peptide &peptide)
static QRegularExpression _rx_modmass
static QRegularExpression _mod_parser
PeptideSp makePeptideSp() const
NoConstPeptideSp makeNoConstPeptideSp() const
void setInternalCterModification(AaModificationP mod)
void setInternalNterModification(AaModificationP mod)
void addAaModification(AaModificationP aaModification, unsigned int position)
adds a modification to amino acid sequence
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< const Peptide > PeptideSp
std::shared_ptr< Peptide > NoConstPeptideSp