Loading...
Searching...
No Matches
grppeptide.cpp
Go to the documentation of this file.
/*******************************************************************************
* 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 "grppeptide.h"
#include "../utils.h"
using namespace pappso;
GrpPeptide::GrpPeptide(QString sequence, pappso_double mass)
: m_sequence(sequence.replace("L", "I")), m_mass(mass)
{
}
GrpPeptide::~GrpPeptide()
{
}
bool
GrpPeptide::operator<(const GrpPeptide &other) const
{
if(m_sequence == other.m_sequence)
{
return (m_mass < other.m_mass);
}
else
{
return (m_sequence < other.m_sequence);
}
}
void
GrpPeptide::setRank(unsigned int i)
{
m_rank = i;
}
void
GrpPeptide::setGroupNumber(unsigned int i)
{
m_groupNumber = i;
}
unsigned int
GrpPeptide::getGroupNumber() const
{
return m_groupNumber;
}
unsigned int
GrpPeptide::getRank() const
{
return m_rank;
}
const QString &
GrpPeptide::getSequence() const
{
return m_sequence;
}
const QString
GrpPeptide::getGroupingId() const
{
return QString("pep%1%2")
.arg(Utils::getLexicalOrderedString(m_groupNumber))
.arg(Utils::getLexicalOrderedString(m_rank));
}
pappso::GrpPeptide
Definition grppeptide.h:43
pappso::GrpPeptide::GrpPeptide
GrpPeptide(QString sequence, pappso_double mass)
Definition grppeptide.cpp:30
pappso::GrpPeptide::m_groupNumber
unsigned int m_groupNumber
Definition grppeptide.h:47
pappso::GrpPeptide::~GrpPeptide
~GrpPeptide()
Definition grppeptide.cpp:35
pappso::GrpPeptide::getSequence
const QString & getSequence() const
Definition grppeptide.cpp:74
pappso::GrpPeptide::m_mass
const pappso_double m_mass
Definition grppeptide.h:51
pappso::GrpPeptide::m_rank
unsigned int m_rank
Definition grppeptide.h:48
pappso::GrpPeptide::getRank
unsigned int getRank() const
Definition grppeptide.cpp:69
pappso::GrpPeptide::getGroupNumber
unsigned int getGroupNumber() const
Definition grppeptide.cpp:64
pappso::GrpPeptide::getGroupingId
const QString getGroupingId() const
Definition grppeptide.cpp:79
pappso::GrpPeptide::setRank
void setRank(unsigned int i)
Definition grppeptide.cpp:53
pappso::GrpPeptide::m_sequence
const QString m_sequence
Definition grppeptide.h:50
pappso::GrpPeptide::setGroupNumber
void setGroupNumber(unsigned int i)
Definition grppeptide.cpp:58
pappso::GrpPeptide::operator<
bool operator<(const GrpPeptide &other) const
sort grp peptides between each other sorts by peptide LI sequence and mass
Definition grppeptide.cpp:40
pappso::Utils::getLexicalOrderedString
static const QString getLexicalOrderedString(unsigned int num)
Definition utils.cpp:74
grppeptide.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:50