pappso::PeptideVariableModificationBuilder Class Reference

Modify a peptide shared pointer with a variable modification on one AA. More...

`#include <peptidevariablemodificationbuilder.h>`

Inheritance diagram for pappso::PeptideVariableModificationBuilder:

## Public Member Functions

| PeptideVariableModificationBuilder (AaModificationP mod)
virtual | ~PeptideVariableModificationBuilder ()
void | setPeptideSp (std::int8_t sequence_database_id, const ProteinSp &protein_sp, bool is_decoy, const PeptideSp &peptide_sp_original, unsigned int start, bool is_nter, unsigned int missed_cleavage_number, bool semi_enzyme) override
| function to give the products of modifications for a digested peptide More...
void | addAa (char aa)
void | setMaxNumberMod (unsigned int max_num)
void | setMinNumberMod (unsigned int min_num)
void | setModificationCounter (unsigned int counter)
void | setSink (PeptideModificatorInterface *sink) override
void | setProtNter (bool arg1)
| this modification concerns the Nter peptide More...
void | setProtCter (bool arg1)
| this modification concerns the Cter peptide More...
void | setProtElse (bool arg1)
| this modification concerns all peptides between Nter and Cter More...
Public Member Functions inherited from pappso::PeptideModificatorBase
| 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) More...
Public Member Functions inherited from pappso::PeptideModificatorInterface
virtual | ~PeptideModificatorInterface ()

## Static Protected Member Functions

static bool | next_combination (const std::vector< unsigned int >::iterator first, std::vector< unsigned int >::iterator k, const std::vector< unsigned int >::iterator last)

## Protected Attributes

PeptideModificatorInterface * | m_sink = nullptr
AaModificationP | mp_mod
unsigned int | m_minNumberMod = 0
unsigned int | m_maxNumberMod = 30000
unsigned int | m_modificationCount = 0
bool | m_isProtNterMod = true
bool | m_isProtCterMod = true
bool | m_isProtElseMod = true
Protected Attributes inherited from pappso::PeptideModificatorBase
QRegExp | m_pattern

## Private Attributes

QString | m_aaModificationList

## Additional Inherited Members

Protected Member Functions inherited from pappso::PeptideModificatorBase
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)

## Detailed Description

Modify a peptide shared pointer with a variable modification on one AA.

Definition at line 36 of file peptidevariablemodificationbuilder.h.

## Constructor & Destructor Documentation

## PeptideVariableModificationBuilder()

pappso::PeptideVariableModificationBuilder::PeptideVariableModificationBuilder | ( | AaModificationP | mod | ) |

Definition at line 72 of file peptidevariablemodificationbuilder.cpp.

: mp_mod(mod)
{
}
pappso::PeptideVariableModificationBuilder::mp_mod
AaModificationP mp_mod
Definition: peptidevariablemodificationbuilder.h:104

## ~PeptideVariableModificationBuilder()

pappso::PeptideVariableModificationBuilder::~PeptideVariableModificationBuilder | ( |  | ) |

virtual

Definition at line 78 of file peptidevariablemodificationbuilder.cpp.

{
}

## Member Function Documentation

## addAa()

void pappso::PeptideVariableModificationBuilder::addAa | ( | char | aa | ) |

Definition at line 83 of file peptidevariablemodificationbuilder.cpp.

{
m_aaModificationList.append(aa);
m_pattern.setPattern(QString("[%1]").arg(m_aaModificationList));
}
pappso::PeptideModificatorBase::m_pattern
QRegExp m_pattern
Definition: peptidemodificatorbase.h:66
pappso::PeptideVariableModificationBuilder::m_aaModificationList
QString m_aaModificationList
Definition: peptidevariablemodificationbuilder.h:121

References m_aaModificationList, and pappso::PeptideModificatorBase::m_pattern.

## next_combination()

bool pappso::PeptideVariableModificationBuilder::next_combination | ( | const std::vector< unsigned int >::iterator | first,
|  | std::vector< unsigned int >::iterator | k,
|  | const std::vector< unsigned int >::iterator | last
| ) |  |

static protected

Definition at line 30 of file peptidevariablemodificationbuilder.cpp.

{
/* Credits: Mark Nelson http://marknelson.us */
if((first == last) || (first == k) || (last == k))
return false;
std::vector<unsigned int>::iterator i1 = first;
std::vector<unsigned int>::iterator i2 = last;
++i1;
if(last == i1)
return false;
i1 = last;
--i1;
i1 = k;
--i2;
while(first != i1)
{
if(*--i1 < *i2)
{
std::vector<unsigned int>::iterator j = k;
while(!(*i1 < *j))
++j;
std::iter_swap(i1, j);
++i1;
++j;
i2 = k;
std::rotate(i1, j, last);
while(last != j)
{
++j;
++i2;
}
std::rotate(k, i2, last);
return true;
}
}
std::rotate(first, k, last);
return false;
}
pappso::QualifiedMassSpectrumParameter::last
@ last

References pappso::last.

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

## setMaxNumberMod()

void pappso::PeptideVariableModificationBuilder::setMaxNumberMod | ( | unsigned int | max_num | ) |

inline

Definition at line 54 of file peptidevariablemodificationbuilder.h.

{
m_maxNumberMod = max_num;
};
pappso::PeptideVariableModificationBuilder::m_maxNumberMod
unsigned int m_maxNumberMod
Definition: peptidevariablemodificationbuilder.h:108

Referenced by pappso::PeptideModificatorPipeline::parsePotentialModification().

## setMinNumberMod()

void pappso::PeptideVariableModificationBuilder::setMinNumberMod | ( | unsigned int | min_num | ) |

inline

Definition at line 59 of file peptidevariablemodificationbuilder.h.

{
m_minNumberMod = min_num;
};
pappso::PeptideVariableModificationBuilder::m_minNumberMod
unsigned int m_minNumberMod
Definition: peptidevariablemodificationbuilder.h:106

Referenced by pappso::PeptideModificatorPipeline::parsePotentialModification().

## setModificationCounter()

void pappso::PeptideVariableModificationBuilder::setModificationCounter | ( | unsigned int | counter | ) |

inline

Definition at line 64 of file peptidevariablemodificationbuilder.h.

{
m_modificationCount = counter;
};
pappso::PeptideVariableModificationBuilder::m_modificationCount
unsigned int m_modificationCount
Definition: peptidevariablemodificationbuilder.h:110

Referenced by pappso::PeptideModificatorPipeline::parsePotentialModification().

## setPeptideSp()

void pappso::PeptideVariableModificationBuilder::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
| ) |  |

override virtual

function to give the products of modifications for a digested peptide

Parameters

  sequence_database_id | integer that references the sequence fatabase (file, stream, url...)
  protein_sp | shared pointer on the protein that was initialy digested
  is_decoy | tell if the current protein is a decoy (true) or normal (false) protein
  peptide | Peptide object containing sequence and possible modifications
  start | the position of the first amino acid of the peptide in the original protein sequence. the first amino acid of the protein is at position 1.
  is_nter | boolean to tell if the peptide is an Nter peptide (to allow Methionin Nter removal)
  missed_cleavage_number | number of missed cleavage sites (that the enzyme has not cut) fot the product
  semi_enzyme | boolean that tells if this peptide is the produce of a semi enzymatic lysis

Implements pappso::PeptideModificatorInterface.

Reimplemented in pappso::PeptideVariableModificationReplacement.

Definition at line 92 of file peptidevariablemodificationbuilder.cpp.

{
// QString s = "Banana";
// s.replace(QRegExp("a[mn]"), "ox");
bool modify_this_peptide = true;
if(m_isProtNterMod || m_isProtCterMod)
{
modify_this_peptide = false;
if((m_isProtNterMod) && (is_nter))
{
// this an Nter peptide
modify_this_peptide = true;
}
else if((m_isProtCterMod) &&
(protein_sp.get()->size() ==
(start + peptide_sp_original.get()->size())))
{
// this is a Cter peptide
modify_this_peptide = true;
}
else if(m_isProtElseMod)
{
modify_this_peptide = true;
}
}
if(modify_this_peptide)
{
std::vector<unsigned int> position_list;
getModificationPositionList(
position_list, peptide_sp_original.get(), mp_mod, m_modificationCount);
// std::vector< unsigned int > position_list =
// peptide_sp_original.get()->getAaPositionList(m_aaModificationList);
// std::string s = "12345";
// no AA modification :
if(m_minNumberMod == 0)
{
m_sink->setPeptideSp(sequence_database_id,
protein_sp,
is_decoy,
peptide_sp_original,
start,
is_nter,
missed_cleavage_number,
semi_enzyme);
}
unsigned int nb_pos = position_list.size();
if(nb_pos > 0)
{
// loop to find 1 to n-1 AA modification combinations
unsigned int comb_size = 1;
while((comb_size < nb_pos) && (comb_size <= m_maxNumberMod))
{
do
{
// std::cout << std::string(being,begin + comb_size) <<
// std::endl;
Peptide new_peptide(*(peptide_sp_original.get()));
for(unsigned int i = 0; i < comb_size; i++)
{
new_peptide.addAaModification(mp_mod, position_list[i]);
}
PeptideSp new_peptide_sp = new_peptide.makePeptideSp();
m_sink->setPeptideSp(sequence_database_id,
protein_sp,
is_decoy,
new_peptide_sp,
start,
is_nter,
missed_cleavage_number,
semi_enzyme);
}
while(next_combination(position_list.begin(),
position_list.begin() + comb_size,
position_list.end()));
comb_size++;
}
if(nb_pos <= m_maxNumberMod)
{
// the last combination : all aa are modified :
Peptide new_peptide(*(peptide_sp_original.get()));
for(unsigned int i = 0; i < nb_pos; i++)
{
new_peptide.addAaModification(mp_mod, position_list[i]);
}
PeptideSp new_peptide_sp = new_peptide.makePeptideSp();
m_sink->setPeptideSp(sequence_database_id,
protein_sp,
is_decoy,
new_peptide_sp,
start,
is_nter,
missed_cleavage_number,
semi_enzyme);
}
}
}
else
{
// no modification
m_sink->setPeptideSp(sequence_database_id,
protein_sp,
is_decoy,
peptide_sp_original,
start,
is_nter,
missed_cleavage_number,
semi_enzyme);
}
}
pappso::PeptideModificatorBase::getModificationPositionList
virtual void getModificationPositionList(std::vector< unsigned int > &position_list, const QString &peptide_str) final
Definition: peptidemodificatorbase.cpp:50
pappso::PeptideModificatorInterface::setPeptideSp
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
pappso::PeptideVariableModificationBuilder::m_isProtNterMod
bool m_isProtNterMod
Definition: peptidevariablemodificationbuilder.h:113
pappso::PeptideVariableModificationBuilder::m_sink
PeptideModificatorInterface * m_sink
Definition: peptidevariablemodificationbuilder.h:103
pappso::PeptideVariableModificationBuilder::m_isProtElseMod
bool m_isProtElseMod
Definition: peptidevariablemodificationbuilder.h:117
pappso::PeptideVariableModificationBuilder::next_combination
static bool next_combination(const std::vector< unsigned int >::iterator first, std::vector< unsigned int >::iterator k, const std::vector< unsigned int >::iterator last)
Definition: peptidevariablemodificationbuilder.cpp:30
pappso::PeptideVariableModificationBuilder::m_isProtCterMod
bool m_isProtCterMod
Definition: peptidevariablemodificationbuilder.h:115
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition: aamodification.h:47

References pappso::Peptide::addAaModification(), pappso::PeptideModificatorBase::getModificationPositionList(), m_isProtCterMod, m_isProtElseMod, m_isProtNterMod, m_maxNumberMod, m_minNumberMod, m_modificationCount, m_sink, pappso::Peptide::makePeptideSp(), mp_mod, next_combination(), and pappso::PeptideModificatorInterface::setPeptideSp().

## setProtCter()

void pappso::PeptideVariableModificationBuilder::setProtCter | ( | bool | arg1 | ) |

inline

this modification concerns the Cter peptide

Definition at line 86 of file peptidevariablemodificationbuilder.h.

{
m_isProtCterMod = arg1;
};

Referenced by pappso::PeptideModificatorPipeline::parsePotentialModification().

## setProtElse()

void pappso::PeptideVariableModificationBuilder::setProtElse | ( | bool | arg1 | ) |

inline

this modification concerns all peptides between Nter and Cter

Definition at line 93 of file peptidevariablemodificationbuilder.h.

{
m_isProtElseMod = arg1;
};

Referenced by pappso::PeptideModificatorPipeline::parsePotentialModification().

## setProtNter()

void pappso::PeptideVariableModificationBuilder::setProtNter | ( | bool | arg1 | ) |

inline

this modification concerns the Nter peptide

Definition at line 79 of file peptidevariablemodificationbuilder.h.

{
m_isProtNterMod = arg1;
};

Referenced by pappso::PeptideModificatorPipeline::parsePotentialModification().

## setSink()

void pappso::PeptideVariableModificationBuilder::setSink | ( | PeptideModificatorInterface * | sink | ) |

inline override virtual

Implements pappso::PeptideSpSinkInterface.

Definition at line 70 of file peptidevariablemodificationbuilder.h.

{
m_sink = sink;
};

Referenced by pappso::PeptideModificatorPipeline::parsePotentialModification().

## Member Data Documentation

## m_aaModificationList

QString pappso::PeptideVariableModificationBuilder::m_aaModificationList

private

Definition at line 121 of file peptidevariablemodificationbuilder.h.

Referenced by addAa().

## m_isProtCterMod

bool pappso::PeptideVariableModificationBuilder::m_isProtCterMod = true

protected

Definition at line 115 of file peptidevariablemodificationbuilder.h.

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

## m_isProtElseMod

bool pappso::PeptideVariableModificationBuilder::m_isProtElseMod = true

protected

Definition at line 117 of file peptidevariablemodificationbuilder.h.

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

## m_isProtNterMod

bool pappso::PeptideVariableModificationBuilder::m_isProtNterMod = true

protected

Definition at line 113 of file peptidevariablemodificationbuilder.h.

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

## m_maxNumberMod

unsigned int pappso::PeptideVariableModificationBuilder::m_maxNumberMod = 30000

protected

Definition at line 108 of file peptidevariablemodificationbuilder.h.

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

## m_minNumberMod

unsigned int pappso::PeptideVariableModificationBuilder::m_minNumberMod = 0

protected

Definition at line 106 of file peptidevariablemodificationbuilder.h.

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

## m_modificationCount

unsigned int pappso::PeptideVariableModificationBuilder::m_modificationCount = 0

protected

Definition at line 110 of file peptidevariablemodificationbuilder.h.

Referenced by pappso::PeptideVariableModificationReplacement::PeptideVariableModificationReplacement(), pappso::PeptideVariableModificationReplacement::replaceModificationsAtPosition(), setPeptideSp(), and pappso::PeptideVariableModificationReplacement::setPeptideSp().

## m_sink

PeptideModificatorInterface* pappso::PeptideVariableModificationBuilder::m_sink = nullptr

protected

Definition at line 103 of file peptidevariablemodificationbuilder.h.

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

## mp_mod

AaModificationP pappso::PeptideVariableModificationBuilder::mp_mod

protected

Definition at line 104 of file peptidevariablemodificationbuilder.h.

Referenced by pappso::PeptideVariableModificationReplacement::replaceModificationsAtPosition(), setPeptideSp(), and pappso::PeptideVariableModificationReplacement::setPeptideSp().

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

- pappsomspp/protein/peptidevariablemodificationbuilder.h
- pappsomspp/protein/peptidevariablemodificationbuilder.cpp