libpappsomspp
Library for mass spectrometry
pappso::PeptideBuilder Class Reference

builds a peptide shared pointer from peptide string and adds fixed modifications More...

#include <peptidebuilder.h>

Inheritance diagram for pappso::PeptideBuilder:
pappso::EnzymeProductInterface pappso::PeptideSpSinkInterface

Public Member Functions

 PeptideBuilder ()
 
virtual ~PeptideBuilder ()
 
void setPeptide (std::int8_t sequence_database_id, const ProteinSp &protein_sp, bool is_decoy, const QString &peptide_str, unsigned int start, bool is_nter, unsigned int missed_cleavage_number, bool semi_enzyme) override
 function to give the products of a protein digestion by an enzyme More...
 
void addFixedAaModification (char aa, AaModificationP modification)
 
void setSink (PeptideModificatorInterface *sink) override
 

Private Attributes

PeptideModificatorInterfacem_sink = nullptr
 
std::list< std::pair< char, AaModificationP > > m_fixedModificationList
 

Additional Inherited Members

Detailed Description

builds a peptide shared pointer from peptide string and adds fixed modifications

Definition at line 35 of file peptidebuilder.h.

Constructor & Destructor Documentation

◆ PeptideBuilder()

pappso::PeptideBuilder::PeptideBuilder ( )

Definition at line 29 of file peptidebuilder.cpp.

30 {
31 }

◆ ~PeptideBuilder()

pappso::PeptideBuilder::~PeptideBuilder ( )
virtual

Definition at line 33 of file peptidebuilder.cpp.

34 {
35 }

Member Function Documentation

◆ addFixedAaModification()

void pappso::PeptideBuilder::addFixedAaModification ( char  aa,
AaModificationP  modification 
)

Definition at line 37 of file peptidebuilder.cpp.

38 {
39 
40  m_fixedModificationList.push_back(
41  std::pair<char, AaModificationP>(aa, modification));
42 }
std::list< std::pair< char, AaModificationP > > m_fixedModificationList

References m_fixedModificationList.

◆ setPeptide()

void pappso::PeptideBuilder::setPeptide ( std::int8_t  sequence_database_id,
const ProteinSp protein_sp,
bool  is_decoy,
const QString &  peptide,
unsigned int  start,
bool  is_nter,
unsigned int  missed_cleavage_number,
bool  semi_enzyme 
)
overridevirtual

function to give the products of a protein digestion by an enzyme

Parameters
sequence_database_idinteger that references the sequence fatabase (file, stream, url...)
protein_spshared pointer on the protein that was digested
is_decoytell if the current protein is a decoy (true) or normal (false) protein
peptideamino acid sequence of the peptide (string) produced by the digestion
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::EnzymeProductInterface.

Definition at line 45 of file peptidebuilder.cpp.

53 {
54 
55  qDebug() << "PeptideBuilder::setPeptide begin";
56 
57  Peptide peptide(peptide_str);
58 
59  for(auto &&aamod_pair : m_fixedModificationList)
60  {
61  std::vector<unsigned int> position_list =
62  peptide.getAaPositionList(aamod_pair.first);
63  for(auto &&position : position_list)
64  {
65  peptide.addAaModification(aamod_pair.second, position);
66  }
67  }
68 
69  PeptideSp peptide_sp = peptide.makePeptideSp();
70  // set fixed modifications
71 
72  qDebug() << "PeptideBuilder::setPeptide m_sink->setPeptideSp";
73  m_sink->setPeptideSp(sequence_database_id,
74  protein_sp,
75  is_decoy,
76  peptide_sp,
77  start,
78  is_nter,
79  missed_cleavage_number,
80  semi_enzyme);
81  qDebug() << "PeptideBuilder::setPeptide end";
82 }
PeptideModificatorInterface * m_sink
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::Peptide::getAaPositionList(), m_fixedModificationList, m_sink, pappso::Peptide::makePeptideSp(), and pappso::PeptideModificatorInterface::setPeptideSp().

◆ setSink()

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

Implements pappso::PeptideSpSinkInterface.

Definition at line 54 of file peptidebuilder.h.

55  {
56  m_sink = sink;
57  };

Member Data Documentation

◆ m_fixedModificationList

std::list<std::pair<char, AaModificationP> > pappso::PeptideBuilder::m_fixedModificationList
private

Definition at line 62 of file peptidebuilder.h.

Referenced by addFixedAaModification(), and setPeptide().

◆ m_sink

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

Definition at line 60 of file peptidebuilder.h.

Referenced by setPeptide().


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