libpappsomspp
Library for mass spectrometry
grppeptide.cpp
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
4  *
5  * This file is part of the PAPPSOms++ library.
6  *
7  * PAPPSOms++ is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * PAPPSOms++ is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Contributors:
21  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
22  *implementation
23  ******************************************************************************/
24 
25 #include "grppeptide.h"
26 #include "../utils.h"
27 
28 using namespace pappso;
29 
30 GrpPeptide::GrpPeptide(QString sequence, pappso_double mass)
31  : m_sequence(sequence.replace("L", "I")), m_mass(mass)
32 {
33 }
34 
36 {
37 }
38 
39 bool
40 GrpPeptide::operator<(const GrpPeptide &other) const
41 {
42  if(m_sequence == other.m_sequence)
43  {
44  return (m_mass < other.m_mass);
45  }
46  else
47  {
48  return (m_sequence < other.m_sequence);
49  }
50 }
51 
52 void
53 GrpPeptide::setRank(unsigned int i)
54 {
55  m_rank = i;
56 }
57 void
59 {
60  m_groupNumber = i;
61 }
62 
63 unsigned int
65 {
66  return m_groupNumber;
67 }
68 unsigned int
70 {
71  return m_rank;
72 }
73 const QString &
75 {
76  return m_sequence;
77 }
78 const QString
80 {
81  return QString("pep%1%2")
84 }
GrpPeptide(QString sequence, pappso_double mass)
Definition: grppeptide.cpp:30
unsigned int m_groupNumber
Definition: grppeptide.h:47
const QString & getSequence() const
Definition: grppeptide.cpp:74
const pappso_double m_mass
Definition: grppeptide.h:51
unsigned int m_rank
Definition: grppeptide.h:48
unsigned int getRank() const
Definition: grppeptide.cpp:69
unsigned int getGroupNumber() const
Definition: grppeptide.cpp:64
const QString getGroupingId() const
Definition: grppeptide.cpp:79
void setRank(unsigned int i)
Definition: grppeptide.cpp:53
const QString m_sequence
Definition: grppeptide.h:50
void setGroupNumber(unsigned int i)
Definition: grppeptide.cpp:58
bool operator<(const GrpPeptide &other) const
sort grp peptides between each other sorts by peptide LI sequence and mass
Definition: grppeptide.cpp:40
static const QString getLexicalOrderedString(unsigned int num)
Definition: utils.cpp:52
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
double pappso_double
A type definition for doubles.
Definition: types.h:49