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()=" << match_mod.lastCapturedIndex();
60 QStringList mod_list =
61 captured.mid(1, captured.size() - 2).split(QRegularExpression(
"[+,\\,]"));
62 for(QString &mod : mod_list)
64 qDebug() <<
"PeptideStrParser::parseString mod " << mod;
65 QRegularExpressionMatch match_psimod =
_rx_psimod.match(mod);
66 if(match_psimod.hasMatch())
68 qDebug() <<
"PeptideStrParser::parseString pos-1 "
69 << (pos - 1 - matched_length_cumul);
71 pos - 1 - matched_length_cumul);
73 else if(mod.startsWith(
"internal:Nter_"))
77 else if(mod.startsWith(
"internal:Cter_"))
81 else if(mod.startsWith(
"C13N15:"))
83 qDebug() <<
"PeptideStrParser::parseString pos-1 "
84 << (pos - 1 - matched_length_cumul);
86 pos - 1 - matched_length_cumul);
90 qDebug() <<
"mod=" << mod;
91 QRegularExpressionMatch match_modmass =
_rx_modmass.match(mod);
92 if(match_modmass.hasMatch())
95 qDebug() <<
"number mod=" << mod <<
" cap=" << match_modmass.captured(0);
96 if(!mod.contains(
"."))
99 qDebug() <<
"integer mod=" << mod;
100 mod =
"MOD:0000" + mod;
101 while(mod.size() > 9)
103 mod = mod.replace(4, 1,
"");
106 pos - 1 - matched_length_cumul);
110 qDebug() <<
"double mod=" << mod;
113 pos - 1 - matched_length_cumul);
118 qDebug() <<
"not a number mod=" << mod;
125 pos - 1 - matched_length_cumul);
130 matched_length_cumul += captured.size();
153 QString new_pep = QString(pepstr).replace(
_mod_parser,
"");
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 setCleavageCterModification(AaModificationP mod)
void setCleavageNterModification(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