libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::specpeptidoms::PeptideModel Class Reference

modelize peptide sequence to facilitate rendering in bracket or proforma More...

#include <peptidemodel.h>

Inheritance diagram for pappso::specpeptidoms::PeptideModel:

Public Member Functions

 PeptideModel ()
virtual ~PeptideModel ()
void reset ()
void setCterShift (double mass_shift)
void setNterShift (double mass_shift)
QString toProForma () const
QString toInterpretation () const
void setPrecursorMass (double mass)
double getPrecursorMass () const
double getMass () const
double getNonAlignedMass () const
 Return the difference between the precursor's mass and the mass modelized by the PeptideModel.

Static Public Member Functions

static QString toProFormaMass (double mass)

Private Attributes

double m_cterShift = 0
double m_nterShift = 0
double m_precursorMass = 0

Detailed Description

modelize peptide sequence to facilitate rendering in bracket or proforma

Definition at line 55 of file peptidemodel.h.

Constructor & Destructor Documentation

◆ PeptideModel()

pappso::specpeptidoms::PeptideModel::PeptideModel ( )

Default constructor

Definition at line 80 of file peptidemodel.cpp.

81{
82}

◆ ~PeptideModel()

pappso::specpeptidoms::PeptideModel::~PeptideModel ( )
virtual

Destructor

Definition at line 84 of file peptidemodel.cpp.

85{
86}

Member Function Documentation

◆ getMass()

double pappso::specpeptidoms::PeptideModel::getMass ( ) const

Definition at line 133 of file peptidemodel.cpp.

134{
135 double mass = m_cterShift + m_nterShift + MASSH2O;
136 // qWarning() << mass;
137 for(auto &aa : *this)
138 {
139 // qWarning() << aa.m_aminoAcid.toProForma();
140 mass += aa.m_aminoAcid.getMass() + aa.m_massDifference;
141 }
142 return mass;
143}
@ aa
best possible : more than one direct MS2 fragmentation in same MSRUN
Definition types.h:45
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)

References m_cterShift, m_nterShift, and pappso::MASSH2O().

Referenced by getNonAlignedMass(), and toProForma().

◆ getNonAlignedMass()

double pappso::specpeptidoms::PeptideModel::getNonAlignedMass ( ) const

Return the difference between the precursor's mass and the mass modelized by the PeptideModel.

Definition at line 204 of file peptidemodel.cpp.

205{
206 return getPrecursorMass() - getMass();
207}

References getMass(), and getPrecursorMass().

◆ getPrecursorMass()

double pappso::specpeptidoms::PeptideModel::getPrecursorMass ( ) const

Definition at line 115 of file peptidemodel.cpp.

116{
117 return m_precursorMass;
118}

References m_precursorMass.

Referenced by getNonAlignedMass().

◆ reset()

void pappso::specpeptidoms::PeptideModel::reset ( )

Definition at line 89 of file peptidemodel.cpp.

90{
91 this->clear();
92 m_cterShift = 0;
93 m_nterShift = 0;
95}

References m_cterShift, m_nterShift, and m_precursorMass.

◆ setCterShift()

void pappso::specpeptidoms::PeptideModel::setCterShift ( double mass_shift)

Definition at line 97 of file peptidemodel.cpp.

98{
99 m_cterShift = mass_shift;
100}

References m_cterShift.

◆ setNterShift()

void pappso::specpeptidoms::PeptideModel::setNterShift ( double mass_shift)

Definition at line 103 of file peptidemodel.cpp.

104{
105 m_nterShift = mass_shift;
106}

References m_nterShift.

◆ setPrecursorMass()

void pappso::specpeptidoms::PeptideModel::setPrecursorMass ( double mass)

Definition at line 109 of file peptidemodel.cpp.

110{
111 m_precursorMass = mass;
112}

References m_precursorMass.

◆ toInterpretation()

QString pappso::specpeptidoms::PeptideModel::toInterpretation ( ) const

Definition at line 181 of file peptidemodel.cpp.

182{
183 QString proforma;
184
185 if(size() > 0)
186 {
187 if(m_nterShift > 0)
188 {
189 proforma = '[' + QString::number(m_nterShift) + "]";
190 }
191 for(auto &aa : *this)
192 {
193 proforma.append(aa.toInterpretation());
194 }
195 if(m_cterShift > 0)
196 {
197 proforma = "[" + QString::number(m_cterShift) + ']';
198 }
199 }
200 return proforma;
201}

References m_cterShift, and m_nterShift.

Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment(), and pappso::cbor::psm::PsmSpecPeptidOmsScan::storeAlignment().

◆ toProForma()

QString pappso::specpeptidoms::PeptideModel::toProForma ( ) const

Definition at line 146 of file peptidemodel.cpp.

147{
148
149 double mass_delta = m_precursorMass - getMass();
150
151 QString proforma("[");
152 if(mass_delta > 0)
153 {
154 proforma.append("+");
155 }
156 proforma.append(QString("%1]?").arg(QString::number(mass_delta, 'f', 4)));
157 proforma.replace("[+0.0000]?", "");
158 proforma.replace("[-0.0000]?", "");
159
160
161 // QString proforma;
162
163 if(size() > 0)
164 {
165 if(m_nterShift != 0)
166 {
167 proforma = '[' + toProFormaMass(m_nterShift) + "]-";
168 }
169 for(auto &aa : *this)
170 {
171 proforma.append(aa.toProForma());
172 }
173 if(m_cterShift != 0)
174 {
175 proforma = "-[" + toProFormaMass(m_cterShift) + ']';
176 }
177 }
178 return proforma;
179}
static QString toProFormaMass(double mass)

References getMass(), m_cterShift, m_nterShift, m_precursorMass, and toProFormaMass().

Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::storeAlignment().

◆ toProFormaMass()

QString pappso::specpeptidoms::PeptideModel::toProFormaMass ( double mass)
static

Definition at line 120 of file peptidemodel.cpp.

121{
122 if(mass > 0)
123 {
124 return QString("+%1").arg(QString::number(mass, 'f', 4));
125 }
126 else
127 {
128 return QString("%1").arg(QString::number(mass, 'f', 4));
129 }
130}

Referenced by pappso::specpeptidoms::AminoAcidModel::toProForma(), and toProForma().

Member Data Documentation

◆ m_cterShift

double pappso::specpeptidoms::PeptideModel::m_cterShift = 0
private

Definition at line 92 of file peptidemodel.h.

Referenced by getMass(), reset(), setCterShift(), toInterpretation(), and toProForma().

◆ m_nterShift

double pappso::specpeptidoms::PeptideModel::m_nterShift = 0
private

Definition at line 93 of file peptidemodel.h.

Referenced by getMass(), reset(), setNterShift(), toInterpretation(), and toProForma().

◆ m_precursorMass

double pappso::specpeptidoms::PeptideModel::m_precursorMass = 0
private

Definition at line 94 of file peptidemodel.h.

Referenced by getPrecursorMass(), reset(), setPrecursorMass(), and toProForma().


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