Loading...
Searching...
No Matches
aamodification.h
Go to the documentation of this file.
/**
* \file pappsomspp/amino_acid/aamodification.h
* \date 7/3/2015
* \author Olivier Langella
* \brief amino acid modification 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
******************************************************************************/
#pragma once
#include <QDebug>
#include <QString>
#include <QMutex>
#include <memory>
#include <map>
#include "../types.h"
#include "atomnumberinterface.h"
#include "../obo/obopsimod.h"
namespace pappso
{
class Peptide;
typedef std::shared_ptr<const Peptide> PeptideSp;
class AaModification;
typedef std::unique_ptr<const AaModification> AaModificationUp;
typedef const AaModification *AaModificationP;
class Aa;
class PMSPP_LIB_DECL AaModification : public AtomNumberInterface
{
public:
AaModification(AaModification &&toCopy); // move constructor
static AaModificationP getInstance(const QString &accession);
static AaModificationP getInstance(const OboPsiModTerm &oboterm);
/** @brief get a fake modification coding a mutation from an amino acid to an
* other
* @param mut_from orginal amino acid
* @param mut_to targeted amino acid
*/
static AaModificationP getInstanceMutation(const QChar &mut_from,
const QChar &mut_to);
/** @brief get a PSI MOD instance corresponding to the removal of the given
* amino acid find the modifications that corresponds to the removal of a
* residue id: MOD:01651 name: natural, standard, encoded residue removal
* @param amino_acid orginal amino acid letter
* @return AaModificationP
*/
static AaModificationP
getInstanceRemovalAccessionByAaLetter(const QChar &amino_acid);
/** @brief get a PSI MOD instance corresponding to the insertion of the given
* amino acid find the modifications.
*
* insertion of residue id: MOD:01441 name: natural, standard, encoded residue
* @param amino_acid orginal amino acid letter
* @return AaModificationP
*/
static AaModificationP
getInstanceInsertionAccessionByAaLetter(const QChar &amino_acid);
static AaModificationP getInstanceXtandemMod(const QString &type,
pappso_double mass,
const PeptideSp &peptide_sp,
unsigned int position);
static AaModificationP
getInstanceCustomizedMod(pappso_double modificationMass);
const QString &getAccession() const;
const QString &getName() const;
/** @brief get the amino acid in ProForma notation
* https://github.com/HUPO-PSI/ProForma/blob/master/README.md
* @return QString as described in ProForma
*/
const QString toProForma() const;
~AaModification();
pappso_double getMass() const;
int getNumberOfAtom(AtomIsotopeSurvey atom) const override final;
int getNumberOfIsotope(Isotope isotope) const override final;
bool isInternal() const;
/** @brief get list of amino acid on which this modification takes place
*
* @return origin string of the form "S T" for Serine or Threonine, "X" for
* any amino acid (see OBO PSI format)
* */
const QString &getXrefOrigin() const;
protected:
const QString m_accession;
QString m_name;
protected:
void setDiffFormula(const QString &diff_formula);
/** @brief set list of amino acid on which this modification takes place
*
* @arg origin string of the form "S T" for Serine or Threonine, "X" for any
* amino acid (see OBO PSI format)
* */
void setXrefOrigin(const QString &origin);
private:
AaModification(const QString &accession, pappso_double mass);
static AaModificationP createInstance(const QString &saccession);
static AaModificationP createInstance(const OboPsiModTerm &term);
static AaModificationP createInstanceMutation(const Aa &aa_from,
const Aa &aa_to);
/** @brief get heavy amino acid modification C13 N15
* @param aa_from orginal amino acid
*/
static AaModificationP
createInstanceC13N15LabelledAminoAcid(const QChar &aa_from);
void calculateMassFromChemicalComponents();
using MapAccessionModifications = std::map<QString, AaModificationP>;
private:
pappso_double m_mass;
QString m_origin;
std::map<AtomIsotopeSurvey, int> m_atomCount;
std::map<Isotope, int> m_mapIsotope;
static MapAccessionModifications m_mapAccessionModifications;
static QMutex m_mutex;
};
} // namespace pappso
atomnumberinterface.h
pappso::AaModification
Definition aamodification.h:57
pappso::AaModification::m_mapIsotope
std::map< Isotope, int > m_mapIsotope
Definition aamodification.h:160
pappso::AaModification::m_origin
QString m_origin
Definition aamodification.h:158
pappso::AaModification::m_atomCount
std::map< AtomIsotopeSurvey, int > m_atomCount
Definition aamodification.h:159
pappso::AaModification::MapAccessionModifications
std::map< QString, AaModificationP > MapAccessionModifications
Definition aamodification.h:153
pappso::AaModification::m_mutex
static QMutex m_mutex
Definition aamodification.h:165
pappso::AaModification::m_mass
pappso_double m_mass
Definition aamodification.h:157
pappso::AaModification::m_name
QString m_name
Definition aamodification.h:127
pappso::AaModification::m_accession
const QString m_accession
Definition aamodification.h:126
pappso::AaModification::m_mapAccessionModifications
static MapAccessionModifications m_mapAccessionModifications
Definition aamodification.h:163
pappso::Aa
Definition aa.h:45
pappso::AtomNumberInterface
Definition atomnumberinterface.h:31
pappso::OboPsiModTerm
Definition obopsimodterm.h:32
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition exportinmportconfig.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48
pappso::AaModificationP
const AaModification * AaModificationP
Definition aamodification.h:52
pappso::AtomIsotopeSurvey
AtomIsotopeSurvey
Definition types.h:89
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:50
pappso::Isotope
Isotope
Definition types.h:104
pappso::AaModificationUp
std::unique_ptr< const AaModification > AaModificationUp
Definition aamodification.h:51