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

`#include <peptidemodificatorbase.h>`

Inheritance diagram for pappso::PeptideModificatorBase:

## Public Member Functions

| PeptideModificatorBase ()
virtual | ~PeptideModificatorBase ()
virtual void | setModificationPattern (QString &pattern) final
| set the pattern on which the modification will be applied (usually the list of concerned AA)
Public Member Functions inherited from pappso::PeptideModificatorInterface
virtual | ~PeptideModificatorInterface ()
virtual void | setPeptideSp (std::int8_t sequence_database_id, const ProteinSp &protein_sp, bool is_decoy, const PeptideSp &peptide_sp, unsigned int start, bool is_nter, unsigned int missed_cleavage_number, bool semi_enzyme)=0
| function to give the products of modifications for a digested peptide
Public Member Functions inherited from pappso::PeptideSpSinkInterface
virtual void | setSink (PeptideModificatorInterface *sink)=0

## Protected Member Functions

virtual void | getModificationPositionList (std::vector< unsigned int > &position_list, const QString &peptide_str) final
virtual void | getModificationPositionList (std::vector< unsigned int > &position_list, const Peptide *p_peptide, AaModificationP mod, unsigned int modification_counter)

## Protected Attributes

QRegularExpression | m_pattern

## Detailed Description

Definition at line 40 of file peptidemodificatorbase.h.

## Constructor & Destructor Documentation

## PeptideModificatorBase()

pappso::PeptideModificatorBase::PeptideModificatorBase | ( |  | ) |

Definition at line 35 of file peptidemodificatorbase.cpp.

{
}

## ~PeptideModificatorBase()

pappso::PeptideModificatorBase::~PeptideModificatorBase | ( |  | ) |

virtual

Definition at line 39 of file peptidemodificatorbase.cpp.

{
}

## Member Function Documentation

## getModificationPositionList() [1/2]

void pappso::PeptideModificatorBase::getModificationPositionList | ( | std::vector< unsigned int > & | position_list,
|  | const Peptide * | p_peptide,
|  | AaModificationP | mod,
|  | unsigned int | modification_counter )

protected virtual

Definition at line 85 of file peptidemodificatorbase.cpp.

{
int pos = 0;
const QString peptide_str = p_peptide->getSequence();
QRegularExpressionMatch match_pattern = m_pattern.match(peptide_str, pos);
while(match_pattern.hasMatch())
{
pos = match_pattern.capturedStart(0);
if(match_pattern.lastCapturedIndex() == 0)
{
// no motif, just push position
if(p_peptide->getConstAa(pos).getNumberOfModification(mod) == modification_counter)
{
position_list.push_back(pos);
}
pos++;
}
else
{
// there is a motif : target this position
pos = match_pattern.capturedStart(1);
if((position_list.size() > 0) && (position_list.back() == (unsigned int)pos))
{
pos = match_pattern.capturedStart(0) + 1;
}
else
{
if(p_peptide->getConstAa(pos).getNumberOfModification(mod) == modification_counter)
{
position_list.push_back(pos);
}
pos = match_pattern.capturedStart(0) + 1;
}
}
match_pattern = m_pattern.match(peptide_str, pos);
}
}
pappso::PeptideModificatorBase::m_pattern
QRegularExpression m_pattern
Definition peptidemodificatorbase.h:66

References pappso::Peptide::getConstAa(), pappso::Aa::getNumberOfModification(), pappso::Peptide::getSequence(), and m_pattern.

## getModificationPositionList() [2/2]

void pappso::PeptideModificatorBase::getModificationPositionList | ( | std::vector< unsigned int > & | position_list,
|  | const QString & | peptide_str )

final protected virtual

Definition at line 50 of file peptidemodificatorbase.cpp.

{
int pos = 0;
QRegularExpressionMatch match_pattern = m_pattern.match(peptide_str, pos);
while(match_pattern.hasMatch())
{
pos = match_pattern.capturedStart(0);
if(match_pattern.lastCapturedIndex() == 0)
{
// no motif, just push position
position_list.push_back(pos);
pos++;
}
else
{
// there is a motif : target this position
pos = match_pattern.capturedStart(1);
if((position_list.size() > 0) && (position_list.back() == (unsigned int)pos))
{
pos = match_pattern.capturedStart(0) + 1;
}
else
{
position_list.push_back(pos);
pos = match_pattern.capturedStart(0) + 1;
}
}
match_pattern = m_pattern.match(peptide_str, pos);
}
}

References m_pattern.

Referenced by pappso::PeptideFixedModificationBuilder::setPeptideSp(), pappso::PeptideVariableModificationBuilder::setPeptideSp(), and pappso::PeptideVariableModificationReplacement::setPeptideSp().

## setModificationPattern()

void pappso::PeptideModificatorBase::setModificationPattern | ( | QString & | pattern | ) |

final virtual

set the pattern on which the modification will be applied (usually the list of concerned AA)

the pattern is a standard regular expression : it describes the target site to modify. This standard regular expression is used to make a replacement of all motifs describes by an underscore ("_") The underscore is taken as a landmark to apply the modification.

Parameters

  pattern | the regular expression pattern ( [YST] to replace Y, S and T with _ and modify it ). The pattern can also contain the / separator to eventually specify the replacement motif. This can be used to described very complex modification patterns

Definition at line 44 of file peptidemodificatorbase.cpp.

{
m_pattern.setPattern(pattern);
}

References m_pattern.

Referenced by pappso::PeptideModificatorPipeline::parseFixedModification(), pappso::PeptideModificatorPipeline::parseLabeledModification(), and pappso::PeptideModificatorPipeline::parsePotentialModification().

## Member Data Documentation

## m_pattern

QRegularExpression pappso::PeptideModificatorBase::m_pattern

protected

Definition at line 66 of file peptidemodificatorbase.h.

Referenced by pappso::PeptideFixedModificationBuilder::addAa(), pappso::PeptideVariableModificationBuilder::addAa(), getModificationPositionList(), getModificationPositionList(), and setModificationPattern().

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

- pappsomspp/core/protein/peptidemodificatorbase.h
- pappsomspp/core/protein/peptidemodificatorbase.cpp