Loading...
Searching...
No Matches
peptide.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/peptide/peptide.cpp
* \date 7/3/2015
* \author Olivier Langella
* \brief peptide model
*/
/*******************************************************************************
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
*implementation
******************************************************************************/
#include <QDebug>
#include <algorithm>
#include <qobject.h>
#include "peptide.h"
#include "pappsomspp/core/exception/exceptionnotimplemented.h"
#include "pappsomspp/core/exception/exceptionoutofrange.h"
#include "pappsomspp/core/exception/exceptionnotpossible.h"
#include "pappsomspp/core/types.h"
#include "pappsomspp/core/utils.h"
namespace pappso
{
bool
operator<(const pappso::Peptide &l, const pappso::Peptide &r)
{
return (l.m_aaVec < r.m_aaVec);
}
bool
operator==(const pappso::Peptide &l, const pappso::Peptide &r)
{
if(l.getCleavageNterModification() != r.getCleavageNterModification())
return false;
if(l.getCleavageCterModification() != r.getCleavageCterModification())
return false;
if(l.getNterModification() && r.getNterModification() &&
(l.getNterModification() != r.getNterModification()))
return false;
if(l.getCterModification() && r.getCterModification() &&
(l.getCterModification() != r.getCterModification()))
return false;
return (l.m_aaVec == r.m_aaVec);
}
bool
peptideIonTypeIsComplement(Enums::PeptideIon ion_type_ref, Enums::PeptideIon ion_type)
{
if(peptideIonIsNter(ion_type))
std::swap(ion_type_ref, ion_type);
if(peptideIonIsNter(ion_type))
return false;
if((ion_type_ref == Enums::PeptideIon::b) && (ion_type == Enums::PeptideIon::y))
return true;
if((ion_type_ref == Enums::PeptideIon::ao) && (ion_type == Enums::PeptideIon::yo))
return true;
if((ion_type_ref == Enums::PeptideIon::bstar) && (ion_type == Enums::PeptideIon::ystar))
return true;
return false;
}
bool
peptideIonIsNter(Enums::PeptideIon ion_type)
{
if((std::int8_t)ion_type < (std::int8_t)8)
{
return true;
}
return false;
}
PeptideDirection
getPeptideIonDirection(Enums::PeptideIon ion_type)
{
if(peptideIonIsNter(ion_type))
{
return PeptideDirection::Nter;
}
return PeptideDirection::Cter;
}
Peptide::Peptide(const QString &pepstr)
{
qDebug();
m_cleavageNterMod = AaModification::getInstance("internal:Nter_hydrolytic_cleavage_H");
m_cleavageCterMod = AaModification::getInstance("internal:Cter_hydrolytic_cleavage_HO");
m_NterMod = nullptr;
m_CterMod = nullptr;
QString::const_iterator it(pepstr.begin());
while(it != pepstr.end())
{
qDebug() << it->toLatin1();
m_aaVec.push_back(Aa(it->toLatin1()));
it++;
}
qDebug();
getMass();
}
Peptide::~Peptide()
{
}
Peptide::Peptide(const Peptide &peptide)
: m_aaVec(peptide.m_aaVec),
m_fullC13(peptide.m_fullC13),
m_fullN15(peptide.m_fullN15),
m_fullH2(peptide.m_fullH2),
m_proxyMass(peptide.m_proxyMass),
m_cleavageNterMod(peptide.m_cleavageNterMod),
m_cleavageCterMod(peptide.m_cleavageCterMod),
m_NterMod(peptide.m_NterMod),
m_CterMod(peptide.m_CterMod)
{
qDebug();
}
Peptide::Peptide(Peptide &&toCopy) // move constructor
: m_aaVec(std::move(toCopy.m_aaVec)),
m_fullC13(toCopy.m_fullC13),
m_fullN15(toCopy.m_fullN15),
m_fullH2(toCopy.m_fullH2),
m_proxyMass(toCopy.m_proxyMass),
m_cleavageNterMod(toCopy.m_cleavageNterMod),
m_cleavageCterMod(toCopy.m_cleavageCterMod),
m_NterMod(toCopy.m_NterMod),
m_CterMod(toCopy.m_CterMod)
{
}
PeptideSp
Peptide::makePeptideSp() const
{
return std::make_shared<const Peptide>(*this);
}
NoConstPeptideSp
Peptide::makeNoConstPeptideSp() const
{
return std::make_shared<Peptide>(*this);
}
std::vector<Aa>::iterator
Peptide::begin()
{
return m_aaVec.begin();
}
std::vector<Aa>::iterator
Peptide::end()
{
return m_aaVec.end();
}
std::vector<Aa>::const_iterator
Peptide::begin() const
{
return m_aaVec.begin();
}
std::vector<Aa>::const_iterator
Peptide::end() const
{
return m_aaVec.end();
}
std::vector<Aa>::const_reverse_iterator
Peptide::rbegin() const
{
return m_aaVec.rbegin();
}
std::vector<Aa>::const_reverse_iterator
Peptide::rend() const
{
return m_aaVec.rend();
}
pappso_double
Peptide::getMass() const
{
return m_proxyMass;
}
unsigned int
Peptide::size() const
{
return m_aaVec.size();
}
void
Peptide::addAaModification(AaModificationP aaModification, unsigned int position)
{
if(position >= size())
{
throw ExceptionOutOfRange(QObject::tr("position (%1) > size (%2)").arg(position).arg(size()));
}
m_proxyMass = -1;
qDebug() << "Peptide::addAaModification begin " << position;
std::vector<Aa>::iterator it = m_aaVec.begin() + position;
it->addAaModification(aaModification);
getMass();
qDebug() << "Peptide::addAaModification end";
}
void
Peptide::addAaModificationOnAllAminoAcid(AaModificationP aaModification,
Enums::AminoAcidChar amino_acid)
{
for(auto &aa : *this)
{
if(aa.getAminoAcidChar() == amino_acid)
{
aa.addAaModification(aaModification);
}
}
m_proxyMass = -1;
getMass();
}
const QString
Peptide::getSequence() const
{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->getLetter();
it++;
}
return seq;
}
const QString
Peptide::toAbsoluteString() const
{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
QStringList modification_str_list;
modification_str_list << m_cleavageNterMod->getAccession();
if(m_NterMod != nullptr)
modification_str_list << m_NterMod->getAccession();
while(it != m_aaVec.end())
{
seq += it->getLetter();
if(it == m_aaVec.end() - 1)
{
modification_str_list << m_cleavageCterMod->getAccession();
if(m_CterMod != nullptr)
modification_str_list << m_CterMod->getAccession();
}
for(auto &pmod : it->getModificationList())
{
modification_str_list << pmod->getAccession();
}
if(modification_str_list.size() > 0)
seq += QString("(%1)").arg(modification_str_list.join(","));
modification_str_list.clear();
it++;
}
return seq;
}
const QString
Peptide::getLiAbsoluteString() const
{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->toAbsoluteString();
it++;
}
return seq.replace("L", "I");
}
const QString
Peptide::toString() const
{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->toString();
it++;
}
return seq;
}
std::vector<double>
Peptide::getRawMassArray() const
{
std::vector<double> raw_mass_arr;
for(const Aa &aa : m_aaVec)
{
raw_mass_arr.push_back(aa.getMass());
}
return raw_mass_arr;
}
std::vector<double>
Peptide::getMassIonSerie(unsigned int charge, pappso::Enums::PeptideIon ion_type) const
{
std::vector<double> mz_arr;
double mass_accumulator = 0;
double mass_shift = 0;
if(ion_type == pappso::Enums::PeptideIon::b)
{
for(const Aa &aa : m_aaVec)
{
mass_accumulator += aa.getMass();
mz_arr.push_back(mass_accumulator);
}
}
else if(ion_type == pappso::Enums::PeptideIon::y)
{
std::vector<Aa>::const_reverse_iterator it(m_aaVec.rbegin());
while(it != m_aaVec.rend())
{
mass_accumulator += it->getMass();
mz_arr.push_back(mass_accumulator);
it++;
}
mass_shift = MASSH2O;
}
else
{
throw pappso::ExceptionNotImplemented(
QObject::tr("Peptide::getMassIonSerie not implemented for ion type %1")
.arg(Utils::toString(ion_type)));
}
for(double &mass : mz_arr)
{
mass = (mass + mass_shift + (MHPLUS * (double)charge)) / (double)charge;
}
return mz_arr;
}
pappso_double
Peptide::getMass()
{
qDebug() << "begin";
if(m_proxyMass < 0)
{
if(m_fullC13 || m_fullH2 || m_fullN15)
{
ChemicalFormula formula = getChemicalFormula();
m_proxyMass = formula.getMass();
}
else
{
m_proxyMass = m_cleavageNterMod->getMass() + m_cleavageCterMod->getMass();
if(m_NterMod != nullptr)
m_proxyMass += m_NterMod->getMass();
if(m_CterMod != nullptr)
m_proxyMass += m_CterMod->getMass();
for(auto aa : m_aaVec)
{
m_proxyMass += aa.getMass();
}
}
}
qDebug() << "end " << m_proxyMass;
return m_proxyMass;
}
int
Peptide::getNumberOfAtom(Enums::AtomIsotopeSurvey atom) const
{
int number = m_cleavageNterMod->getNumberOfAtom(atom);
number += m_cleavageCterMod->getNumberOfAtom(atom);
if(m_NterMod != nullptr)
number += m_NterMod->getNumberOfAtom(atom);
if(m_CterMod != nullptr)
number += m_CterMod->getNumberOfAtom(atom);
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
number += it->getNumberOfAtom(atom);
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}
int
Peptide::getNumberOfIsotope(Enums::Isotope isotope) const
{
int number = m_cleavageNterMod->getNumberOfIsotope(isotope);
number += m_cleavageCterMod->getNumberOfIsotope(isotope);
if(m_NterMod != nullptr)
number += m_NterMod->getNumberOfIsotope(isotope);
if(m_CterMod != nullptr)
number += m_CterMod->getNumberOfIsotope(isotope);
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
number += it->getNumberOfIsotope(isotope);
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}
unsigned int
Peptide::getNumberOfModification(AaModificationP mod) const
{
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
number += it->getNumberOfModification(mod);
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}
unsigned int
Peptide::countModificationOnAa(AaModificationP mod, const std::vector<char> &aa_list) const
{
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(std::find(aa_list.begin(), aa_list.end(), it->getLetter()) != aa_list.end())
{
number += it->getNumberOfModification(mod);
}
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}
void
Peptide::replaceAaModification(AaModificationP oldmod, AaModificationP newmod)
{
if(oldmod == newmod)
return;
std::vector<Aa>::iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
it->replaceAaModification(oldmod, newmod);
it++;
}
m_proxyMass = -1;
getMass();
}
void
Peptide::replaceAaModificationOnAminoAcid(Enums::AminoAcidChar aa,
AaModificationP oldmod,
AaModificationP newmod)
{
if(oldmod == newmod)
return;
std::vector<Aa>::iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(it->getAminoAcidChar() == aa)
{
it->replaceAaModification(oldmod, newmod);
}
it++;
}
m_proxyMass = -1;
getMass();
}
void
Peptide::removeAaModification(AaModificationP mod)
{
std::vector<Aa>::iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
it->removeAaModification(mod);
qDebug() << it->toString() << " " << toAbsoluteString();
it++;
}
m_proxyMass = -1;
getMass();
// qDebug() << "Aa::getMass() end " << mass;
}
std::vector<unsigned int>
Peptide::getModificationPositionList(AaModificationP mod) const
{
std::vector<unsigned int> position_list;
unsigned int position = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
unsigned int number = 0;
number += it->getNumberOfModification(mod);
for(unsigned int j = 0; j < number; j++)
{
position_list.push_back(position);
}
it++;
position++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}
std::vector<unsigned int>
Peptide::getModificationPositionList(AaModificationP mod, const std::vector<char> &aa_list) const
{
std::vector<unsigned int> position_list;
unsigned int position = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(std::find(aa_list.begin(), aa_list.end(), it->getLetter()) != aa_list.end())
{
unsigned int number = 0;
number += it->getNumberOfModification(mod);
for(unsigned int j = 0; j < number; j++)
{
position_list.push_back(position);
}
}
it++;
position++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}
std::vector<unsigned int>
Peptide::getAaPositionList(char aa) const
{
std::vector<unsigned int> position_list;
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(it->getLetter() == aa)
position_list.push_back(number);
number++;
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}
std::vector<unsigned int>
Peptide::getAaPositionList(std::list<char> list_aa) const
{
std::vector<unsigned int> position_list;
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
bool found = (std::find(list_aa.begin(), list_aa.end(), it->getLetter()) != list_aa.end());
if(found)
{
position_list.push_back(number);
}
number++;
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}
void
Peptide::setCleavageNterModification(AaModificationP mod)
{
if(mod->getAccession().startsWith("internal:Nter_"))
{
m_proxyMass = -1;
m_cleavageNterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a cleavage Nter modification : %1")
.arg(mod->getAccession()));
}
}
void
Peptide::setCleavageCterModification(AaModificationP mod)
{
if(mod->getAccession().startsWith("internal:Cter_"))
{
m_proxyMass = -1;
m_cleavageNterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a cleavage Cter modification : %1")
.arg(mod->getAccession()));
}
}
AaModificationP
Peptide::getCleavageNterModification() const
{
return m_cleavageNterMod;
}
AaModificationP
Peptide::getCleavageCterModification() const
{
return m_cleavageCterMod;
}
void
Peptide::setNterModification(AaModificationP mod)
{
if(mod != nullptr)
{
m_proxyMass = -1;
m_NterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a peptide Nter modification : mod == nulptr"));
}
}
void
Peptide::setCterModification(AaModificationP mod)
{
if(mod != nullptr)
{
m_proxyMass = -1;
m_CterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a peptide Cter modification : mod == nulptr"));
}
}
AaModificationP
Peptide::getCterModification() const
{
return m_CterMod;
}
AaModificationP
Peptide::getNterModification() const
{
return m_NterMod;
}
void
Peptide::rotate()
{
std::rotate(m_aaVec.begin(), m_aaVec.begin() + 1, m_aaVec.end());
}
void
Peptide::reverse()
{
std::reverse(m_aaVec.begin(), m_aaVec.end());
}
bool
Peptide::isPalindrome() const
{
std::size_t size = m_aaVec.size();
std::size_t k = (size - 1);
for(std::size_t i = 0; i < (size / 2); i++, k--)
{
if(m_aaVec[i].getLetter() != m_aaVec[k].getLetter())
{
return false;
}
}
return true;
}
Aa &
Peptide::getAa(unsigned int position)
{
if(position >= m_aaVec.size())
{
throw ExceptionOutOfRange(QObject::tr("no AA at position %1").arg(position));
}
return m_aaVec.at(position);
}
const Aa &
Peptide::getConstAa(unsigned int position) const
{
if(position >= m_aaVec.size())
{
throw ExceptionOutOfRange(QObject::tr("no AA at position %1").arg(position));
}
return m_aaVec.at(position);
}
void
Peptide::replaceLeucineIsoleucine()
{
std::vector<Aa>::iterator it(m_aaVec.begin());
std::vector<Aa>::iterator itend(m_aaVec.end());
for(; it != itend; it++)
{
it->replaceLeucineIsoleucine();
}
}
void
Peptide::removeNterAminoAcid()
{
std::vector<Aa>::iterator it(m_aaVec.begin());
if(it != m_aaVec.end())
{
m_aaVec.erase(it);
m_proxyMass = -1;
getMass();
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}
void
Peptide::removeCterAminoAcid()
{
std::vector<Aa>::iterator it(m_aaVec.end());
it--;
if(it != m_aaVec.end())
{
m_aaVec.erase(it);
m_proxyMass = -1;
getMass();
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}
QString
Peptide::toProForma() const
{
QString seq = "";
if(m_fullC13)
{
seq += "<13C>";
}
if(m_fullN15)
{
seq += "<15N>";
}
if(m_fullH2)
{
seq += "<D>";
}
if(m_NterMod != nullptr)
{
QString nter_accession = m_NterMod->getAccession();
seq = QString("[%1]-").arg(nter_accession);
}
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->toProForma();
it++;
}
if(m_CterMod != nullptr)
{
QString cter_accession = m_CterMod->getAccession();
seq += QString("-[%1]").arg(cter_accession);
}
return seq;
}
} // namespace pappso
void
pappso::Peptide::setGlobalModification(Enums::Isotope isotope_kind)
{
if(isotope_kind == Enums::Isotope::C13)
m_fullC13 = true;
else if(isotope_kind == Enums::Isotope::N15)
m_fullN15 = true;
else if(isotope_kind == Enums::Isotope::H2)
m_fullH2 = true;
}
const pappso::ChemicalFormula
pappso::Peptide::getChemicalFormula() const
{
return getChemicalFormulaCharge(0);
}
const pappso::ChemicalFormula
pappso::Peptide::getChemicalFormulaCharge(unsigned int charge) const
{
ChemicalFormula formula = PeptideInterface::getChemicalFormulaCharge(charge);
qDebug() << formula.toString();
if(m_fullC13)
{
formula.setFullIsotope(Enums::Isotope::C13);
qDebug() << formula.toString();
}
if(m_fullN15)
{
formula.setFullIsotope(Enums::Isotope::N15);
qDebug() << formula.toString();
}
if(m_fullH2)
{
formula.setFullIsotope(Enums::Isotope::H2);
qDebug() << formula.toString();
}
return formula;
}
pappso::AaModification::getAccession
const QString & getAccession() const
Definition aamodification.cpp:94
pappso::AaModification::getInstance
static AaModificationP getInstance(const QString &accession)
Definition aamodification.cpp:368
pappso::Aa
Definition aa.h:45
pappso::ChemicalFormula
Definition chemicalformula.h:44
pappso::ChemicalFormula::toString
const QString toString() const
Definition chemicalformula.cpp:659
pappso::ChemicalFormula::setFullIsotope
void setFullIsotope(Enums::Isotope isotope)
set full isotope labels
Definition chemicalformula.cpp:672
pappso::ChemicalFormula::getMass
double getMass() const
Definition chemicalformula.cpp:296
pappso::ExceptionNotImplemented
Definition exceptionnotimplemented.h:32
pappso::ExceptionNotPossible
Definition exceptionnotpossible.h:29
pappso::ExceptionOutOfRange
Definition exceptionoutofrange.h:32
pappso::PeptideInterface::getChemicalFormulaCharge
virtual const ChemicalFormula getChemicalFormulaCharge(unsigned int charge) const
Definition peptideinterface.cpp:90
pappso::Peptide
Definition peptide.h:102
pappso::Peptide::m_cleavageCterMod
AaModificationP m_cleavageCterMod
Definition peptide.h:274
pappso::Peptide::replaceLeucineIsoleucine
void replaceLeucineIsoleucine()
Definition peptide.cpp:740
pappso::Peptide::makePeptideSp
PeptideSp makePeptideSp() const
Definition peptide.cpp:160
pappso::Peptide::Peptide
Peptide(const QString &pepstr)
Definition peptide.cpp:106
pappso::Peptide::getCterModification
AaModificationP getCterModification() const
Definition peptide.cpp:680
pappso::Peptide::setNterModification
void setNterModification(AaModificationP mod)
Definition peptide.cpp:649
pappso::Peptide::replaceAaModification
void replaceAaModification(AaModificationP oldmod, AaModificationP newmod)
replaces all occurences of a modification by a new one
Definition peptide.cpp:474
pappso::Peptide::removeNterAminoAcid
void removeNterAminoAcid()
Definition peptide.cpp:753
pappso::Peptide::rend
std::vector< Aa >::const_reverse_iterator rend() const
Definition peptide.cpp:203
pappso::Peptide::getChemicalFormulaCharge
virtual const ChemicalFormula getChemicalFormulaCharge(unsigned int charge) const override
Definition peptide.cpp:845
pappso::Peptide::getModificationPositionList
std::vector< unsigned int > getModificationPositionList(AaModificationP mod) const
get modification positions
Definition peptide.cpp:522
pappso::Peptide::makeNoConstPeptideSp
NoConstPeptideSp makeNoConstPeptideSp() const
Definition peptide.cpp:166
pappso::Peptide::getNumberOfIsotope
virtual int getNumberOfIsotope(Enums::Isotope isotope) const override
get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
Definition peptide.cpp:423
pappso::Peptide::isPalindrome
virtual bool isPalindrome() const override
tells if the peptide sequence is a palindrome
Definition peptide.cpp:705
pappso::Peptide::rbegin
std::vector< Aa >::const_reverse_iterator rbegin() const
Definition peptide.cpp:197
pappso::Peptide::getCleavageCterModification
AaModificationP getCleavageCterModification() const
Definition peptide.cpp:643
pappso::Peptide::getLiAbsoluteString
const QString getLiAbsoluteString() const
get all sequence string with modifications and converting Leucine to Isoleucine
Definition peptide.cpp:298
pappso::Peptide::removeCterAminoAcid
void removeCterAminoAcid()
Definition peptide.cpp:770
pappso::Peptide::setGlobalModification
void setGlobalModification(Enums::Isotope isotope_kind)
apply 100% isotope replacement
Definition peptide.cpp:826
pappso::Peptide::m_fullN15
bool m_fullN15
Definition peptide.h:268
pappso::Peptide::setCleavageCterModification
void setCleavageCterModification(AaModificationP mod)
Definition peptide.cpp:621
pappso::Peptide::setCterModification
void setCterModification(AaModificationP mod)
Definition peptide.cpp:664
pappso::Peptide::m_NterMod
AaModificationP m_NterMod
Definition peptide.h:275
pappso::Peptide::getChemicalFormula
virtual const ChemicalFormula getChemicalFormula() const override
Definition peptide.cpp:838
pappso::Peptide::replaceAaModificationOnAminoAcid
void replaceAaModificationOnAminoAcid(Enums::AminoAcidChar aa, pappso::AaModificationP oldmod, pappso::AaModificationP newmod)
replaces all occurences of a modification by a new one on a specific amino acid
Definition peptide.cpp:489
pappso::Peptide::m_cleavageNterMod
AaModificationP m_cleavageNterMod
Definition peptide.h:272
pappso::Peptide::toAbsoluteString
const QString toAbsoluteString() const
print all modifications
Definition peptide.cpp:267
pappso::Peptide::m_fullH2
bool m_fullH2
Definition peptide.h:269
pappso::Peptide::m_fullC13
bool m_fullC13
Definition peptide.h:267
pappso::Peptide::~Peptide
virtual ~Peptide()
Definition peptide.cpp:126
pappso::Peptide::getNterModification
AaModificationP getNterModification() const
Definition peptide.cpp:686
pappso::Peptide::getNumberOfModification
unsigned int getNumberOfModification(AaModificationP mod) const
count modification occurence
Definition peptide.cpp:443
pappso::Peptide::getMassIonSerie
std::vector< double > getMassIonSerie(unsigned int charge, pappso::Enums::PeptideIon ion_type) const
get complete serie of product masses for a given charge and ion type
Definition peptide.cpp:336
pappso::Peptide::toString
const QString toString() const
print modification except internal modifications
Definition peptide.cpp:312
pappso::Peptide::getRawMassArray
std::vector< double > getRawMassArray() const
get raw mass array of the amino acid sequence
Definition peptide.cpp:325
pappso::Peptide::rotate
void rotate()
Definition peptide.cpp:692
pappso::Peptide::toProForma
QString toProForma() const
get the peptide model in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README....
Definition peptide.cpp:787
pappso::Peptide::getCleavageNterModification
AaModificationP getCleavageNterModification() const
Definition peptide.cpp:638
pappso::Peptide::removeAaModification
void removeAaModification(AaModificationP mod)
removes all occurences of a modification
Definition peptide.cpp:508
pappso::Peptide::size
unsigned int size() const override
Definition peptide.cpp:217
pappso::Peptide::getNumberOfAtom
virtual int getNumberOfAtom(Enums::AtomIsotopeSurvey atom) const override
get the number of atom C, O, N, H in the molecule
Definition peptide.cpp:403
pappso::Peptide::setCleavageNterModification
void setCleavageNterModification(AaModificationP mod)
Definition peptide.cpp:605
pappso::Peptide::getAa
Aa & getAa(unsigned int position)
Definition peptide.cpp:720
pappso::Peptide::addAaModificationOnAllAminoAcid
void addAaModificationOnAllAminoAcid(AaModificationP aaModification, Enums::AminoAcidChar amino_acid)
adds a modification to all amino acid of the sequence
Definition peptide.cpp:237
pappso::Peptide::getAaPositionList
std::vector< unsigned int > getAaPositionList(char aa) const
get positions of one amino acid in peptide
Definition peptide.cpp:567
pappso::Peptide::reverse
void reverse()
Definition peptide.cpp:698
pappso::Peptide::getMass
pappso_double getMass()
Definition peptide.cpp:375
pappso::Peptide::begin
std::vector< Aa >::iterator begin()
Definition peptide.cpp:173
pappso::Peptide::getSequence
const QString getSequence() const override
print amino acid sequence without modifications
Definition peptide.cpp:255
pappso::Peptide::addAaModification
void addAaModification(AaModificationP aaModification, unsigned int position)
adds a modification to amino acid sequence
Definition peptide.cpp:222
pappso::Peptide::end
std::vector< Aa >::iterator end()
Definition peptide.cpp:179
pappso::Peptide::m_proxyMass
double m_proxyMass
Definition peptide.h:270
pappso::Peptide::m_CterMod
AaModificationP m_CterMod
Definition peptide.h:276
pappso::Peptide::m_aaVec
std::vector< Aa > m_aaVec
Definition peptide.h:266
pappso::Peptide::countModificationOnAa
unsigned int countModificationOnAa(AaModificationP mod, const std::vector< char > &aa_list) const
count modification occurence
Definition peptide.cpp:457
pappso::Peptide::getConstAa
const Aa & getConstAa(unsigned int position) const
Definition peptide.cpp:729
pappso::Utils::toString
static QString toString(specglob::SpectralAlignmentType type)
Convenience function to return a string describing the specglob alingment type.
Definition utils.cpp:544
exceptionnotimplemented.h
exceptionnotpossible.h
exceptionoutofrange.h
pappso::Enums::AtomIsotopeSurvey
AtomIsotopeSurvey
Definition types.h:110
pappso::Enums::Isotope
Isotope
Definition types.h:126
pappso::Enums::Isotope::C13
@ C13
Definition types.h:128
pappso::Enums::Isotope::N15
@ N15
Definition types.h:135
pappso::Enums::Isotope::H2
@ H2
Definition types.h:130
pappso::Enums::PeptideIon
PeptideIon
Enums::PeptideIon enum defines all types of ions (Nter or Cter).
Definition types.h:286
pappso::Enums::PeptideIon::y
@ y
Cter amino ions.
Definition types.h:295
pappso::Enums::PeptideIon::ystar
@ ystar
Cter amino ions + NH3 loss.
Definition types.h:296
pappso::Enums::PeptideIon::yo
@ yo
Cter amino ions + H2O loss.
Definition types.h:297
pappso::Enums::PeptideIon::bstar
@ bstar
Nter acylium ions + NH3 loss.
Definition types.h:288
pappso::Enums::PeptideIon::b
@ b
Nter acylium ions.
Definition types.h:287
pappso::Enums::PeptideIon::ao
@ ao
Nter aldimine ions + H2O loss.
Definition types.h:292
pappso::Enums::AminoAcidChar
AminoAcidChar
Definition types.h:196
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::peptideIonTypeIsComplement
bool peptideIonTypeIsComplement(Enums::PeptideIon ion_type_ref, Enums::PeptideIon ion_type)
tells if an ion type is the complement ion of the other
Definition peptide.cpp:70
pappso::operator<
bool operator<(Aa const &l, Aa const &r)
Definition aa.cpp:292
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48
pappso::PeptideDirection
PeptideDirection
Definition peptide.h:47
pappso::PeptideDirection::Cter
@ Cter
Definition peptide.h:49
pappso::PeptideDirection::Nter
@ Nter
Definition peptide.h:48
pappso::AaModificationP
const AaModification * AaModificationP
Definition aamodification.h:52
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:60
pappso::getPeptideIonDirection
PeptideDirection getPeptideIonDirection(Enums::PeptideIon ion_type)
get the direction of a peptide ion
Definition peptide.cpp:97
pappso::MASSH2O
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
pappso::peptideIonIsNter
bool peptideIonIsNter(Enums::PeptideIon ion_type)
tells if an ion is Nter
Definition peptide.cpp:87
pappso::operator==
bool operator==(Aa const &l, Aa const &r)
Definition aa.cpp:286
pappso::NoConstPeptideSp
std::shared_ptr< Peptide > NoConstPeptideSp
Definition peptide.h:98
peptide.h
types.h
utils.h