libpappsomspp
Library for mass spectrometry
pappso::PeptideFixedModificationBuilder Class Reference

#include <peptidefixedmodificationbuilder.h>

Inheritance diagram for pappso::PeptideFixedModificationBuilder:
pappso::PeptideModificatorBase pappso::PeptideModificatorInterface pappso::PeptideSpSinkInterface

Public Member Functions

 PeptideFixedModificationBuilder (AaModificationP p_mod)
 
virtual ~PeptideFixedModificationBuilder ()
 
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 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 ()
 

Private Attributes

PeptideModificatorInterfacem_sink = nullptr
 
const AaModificationP mp_mod
 
bool m_isProtNterMod = true
 
bool m_isProtCterMod = true
 
bool m_isProtElseMod = true
 
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)
 
- Protected Attributes inherited from pappso::PeptideModificatorBase
QRegularExpression m_pattern
 

Detailed Description

Definition at line 33 of file peptidefixedmodificationbuilder.h.

Constructor & Destructor Documentation

◆ PeptideFixedModificationBuilder()

PeptideFixedModificationBuilder::PeptideFixedModificationBuilder ( AaModificationP  p_mod)

Definition at line 29 of file peptidefixedmodificationbuilder.cpp.

31  : mp_mod(p_mod)
32 {
33 }

◆ ~PeptideFixedModificationBuilder()

PeptideFixedModificationBuilder::~PeptideFixedModificationBuilder ( )
virtual

Definition at line 35 of file peptidefixedmodificationbuilder.cpp.

36 {
37 }

Member Function Documentation

◆ addAa()

void PeptideFixedModificationBuilder::addAa ( char  aa)

Definition at line 40 of file peptidefixedmodificationbuilder.cpp.

41 {
42 
43 
44  m_aaModificationList.append(aa);
45 
46  m_pattern.setPattern(QString("[%1]").arg(m_aaModificationList));
47 }

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

◆ setPeptideSp()

void PeptideFixedModificationBuilder::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 
)
overridevirtual

function to give the products of modifications for a digested peptide

Parameters
sequence_database_idinteger that references the sequence fatabase (file, stream, url...)
protein_spshared pointer on the protein that was initialy digested
is_decoytell if the current protein is a decoy (true) or normal (false) protein
peptidePeptide object containing sequence and possible modifications
startthe 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_nterboolean to tell if the peptide is an Nter peptide (to allow Methionin Nter removal)
missed_cleavage_numbernumber of missed cleavage sites (that the enzyme has not cut) fot the product
semi_enzymeboolean that tells if this peptide is the produce of a semi enzymatic lysis

Implements pappso::PeptideModificatorInterface.

Definition at line 51 of file peptidefixedmodificationbuilder.cpp.

60 {
61 
62  qDebug() << "PeptideFixedModificationBuilder::setPeptide begin";
63 
64  std::vector<unsigned int> position_list;
65  getModificationPositionList(position_list,
66  peptide_sp_original.get()->getSequence());
67 
68  Peptide peptide(*peptide_sp_original.get());
69  unsigned int size = peptide.size();
70 
71  for(unsigned int pos : position_list)
72  {
73  if((m_isProtNterMod) && (is_nter))
74  {
75  peptide.addAaModification(mp_mod, pos);
76  }
77  else if((m_isProtCterMod) && (protein_sp.get()->size() == (start + size)))
78  {
79  peptide.addAaModification(mp_mod, pos);
80  }
81  else if(m_isProtElseMod)
82  {
83  peptide.addAaModification(mp_mod, pos);
84  }
85  }
86 
87  PeptideSp peptide_sp = peptide.makePeptideSp();
88  // set fixed modifications
89  m_sink->setPeptideSp(sequence_database_id,
90  protein_sp,
91  is_decoy,
92  peptide_sp,
93  start,
94  is_nter,
95  missed_cleavage_number,
96  semi_enzyme);
97  qDebug() << "PeptideFixedModificationBuilder::setPeptide end";
98 }
virtual void getModificationPositionList(std::vector< unsigned int > &position_list, const QString &peptide_str) final
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
std::shared_ptr< const Peptide > PeptideSp

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

◆ setProtCter()

void pappso::PeptideFixedModificationBuilder::setProtCter ( bool  arg1)
inline

this modification concerns the Cter peptide

Definition at line 65 of file peptidefixedmodificationbuilder.h.

66  {
67  m_isProtCterMod = arg1;
68  };

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

◆ setProtElse()

void pappso::PeptideFixedModificationBuilder::setProtElse ( bool  arg1)
inline

this modification concerns all peptides between Nter and Cter

Definition at line 72 of file peptidefixedmodificationbuilder.h.

73  {
74  m_isProtElseMod = arg1;
75  };

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

◆ setProtNter()

void pappso::PeptideFixedModificationBuilder::setProtNter ( bool  arg1)
inline

this modification concerns the Nter peptide

Definition at line 58 of file peptidefixedmodificationbuilder.h.

59  {
60  m_isProtNterMod = arg1;
61  };

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

◆ setSink()

void pappso::PeptideFixedModificationBuilder::setSink ( PeptideModificatorInterface sink)
inlineoverridevirtual

Member Data Documentation

◆ m_aaModificationList

QString pappso::PeptideFixedModificationBuilder::m_aaModificationList
private

Definition at line 89 of file peptidefixedmodificationbuilder.h.

Referenced by addAa().

◆ m_isProtCterMod

bool pappso::PeptideFixedModificationBuilder::m_isProtCterMod = true
private

Definition at line 85 of file peptidefixedmodificationbuilder.h.

Referenced by setPeptideSp().

◆ m_isProtElseMod

bool pappso::PeptideFixedModificationBuilder::m_isProtElseMod = true
private

Definition at line 87 of file peptidefixedmodificationbuilder.h.

Referenced by setPeptideSp().

◆ m_isProtNterMod

bool pappso::PeptideFixedModificationBuilder::m_isProtNterMod = true
private

Definition at line 83 of file peptidefixedmodificationbuilder.h.

Referenced by setPeptideSp().

◆ m_sink

PeptideModificatorInterface* pappso::PeptideFixedModificationBuilder::m_sink = nullptr
private

Definition at line 78 of file peptidefixedmodificationbuilder.h.

Referenced by setPeptideSp().

◆ mp_mod

const AaModificationP pappso::PeptideFixedModificationBuilder::mp_mod
private

Definition at line 80 of file peptidefixedmodificationbuilder.h.

Referenced by setPeptideSp().


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