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_"))
84 else if(mod.startsWith(
"C13N15:"))
86 qDebug() <<
"PeptideStrParser::parseString pos-1 "
87 << (pos - 1 - matched_length_cumul);
89 pos - 1 - matched_length_cumul);
93 qDebug() <<
"mod=" << mod;
94 QRegularExpressionMatch match_modmass =
_rx_modmass.match(mod);
95 if(match_modmass.hasMatch())
98 qDebug() <<
"number mod=" << mod
99 <<
" cap=" << match_modmass.captured(0);
100 if(!mod.contains(
"."))
103 qDebug() <<
"integer mod=" << mod;
104 mod =
"MOD:0000" + mod;
105 while(mod.size() > 9)
107 mod = mod.replace(4, 1,
"");
111 pos - 1 - matched_length_cumul);
115 qDebug() <<
"double mod=" << mod;
119 pos - 1 - matched_length_cumul);
124 qDebug() <<
"not a number mod=" << mod;
132 pos - 1 - matched_length_cumul);
136 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