51 std::vector<unsigned int> &position_list,
const QString &peptide_str)
55 QRegularExpressionMatch match_pattern =
m_pattern.match(peptide_str, pos);
57 while(match_pattern.hasMatch())
59 pos = match_pattern.capturedStart(0);
60 if(match_pattern.lastCapturedIndex() == 0)
63 position_list.push_back(pos);
69 pos = match_pattern.capturedStart(1);
70 if((position_list.size() > 0) &&
71 (position_list.back() == (
unsigned int)pos))
73 pos = match_pattern.capturedStart(0) + 1;
77 position_list.push_back(pos);
78 pos = match_pattern.capturedStart(0) + 1;
81 match_pattern =
m_pattern.match(peptide_str, pos);
87 std::vector<unsigned int> &position_list,
90 unsigned int modification_counter)
94 const QString peptide_str = p_peptide->
getSequence();
95 QRegularExpressionMatch match_pattern =
m_pattern.match(peptide_str, pos);
97 while(match_pattern.hasMatch())
99 pos = match_pattern.capturedStart(0);
100 if(match_pattern.lastCapturedIndex() == 0)
104 modification_counter)
106 position_list.push_back(pos);
113 pos = match_pattern.capturedStart(1);
114 if((position_list.size() > 0) &&
115 (position_list.back() == (
unsigned int)pos))
117 pos = match_pattern.capturedStart(0) + 1;
122 modification_counter)
124 position_list.push_back(pos);
126 pos = match_pattern.capturedStart(0) + 1;
129 match_pattern =
m_pattern.match(peptide_str, pos);
unsigned int getNumberOfModification(AaModificationP mod) const
virtual ~PeptideModificatorBase()
virtual void setModificationPattern(QString &pattern) final
set the pattern on which the modification will be applied (usually the list of concerned AA)
QRegularExpression m_pattern
virtual void getModificationPositionList(std::vector< unsigned int > &position_list, const QString &peptide_str) final
const QString getSequence() const override
print amino acid sequence without modifications
const Aa & getConstAa(unsigned int position) const
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
base class for all peptide modification builders