grpprotein.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 "grpprotein.h"
#include "grpexperiment.h"
#include "grppeptide.h"
#include "../utils.h"
using namespace pappso;
GrpProtein::GrpProtein(const QString &accession, const QString &description)
: m_accession(accession.simplified()), m_description(description.simplified())
{
}
GrpProtein::GrpProtein(const GrpProtein &other)
: m_grpPeptidePtrList(other.m_grpPeptidePtrList),
m_accession(other.m_accession),
m_description(other.m_description)
{
m_groupNumber = other.m_groupNumber;
m_subGroupNumber = other.m_subGroupNumber;
m_rank = other.m_rank;
m_count = other.m_count;
}
GrpProtein::~GrpProtein()
{
}
GrpProtein::const_iterator
GrpProtein::begin() const
{
return m_grpPeptidePtrList.begin();
}
GrpProtein::const_iterator
GrpProtein::end() const
{
return m_grpPeptidePtrList.end();
}
unsigned int
GrpProtein::getCount() const
{
return m_count;
}
void
GrpProtein::countPlus()
{
m_count++;
}
void
GrpProtein::setSubGroupNumber(unsigned int i)
{
m_subGroupNumber = i;
}
unsigned int
GrpProtein::getGroupNumber() const
{
return m_groupNumber;
}
unsigned int
GrpProtein::getSubGroupNumber() const
{
return m_subGroupNumber;
}
unsigned int
GrpProtein::getRank() const
{
return m_rank;
}
const QString
GrpProtein::getGroupingId() const
{
if(m_groupNumber == 0)
{
return "";
}
return QString("%1.%2.%3")
.arg(Utils::getLexicalOrderedString(m_groupNumber))
.arg(Utils::getLexicalOrderedString(m_subGroupNumber))
.arg(Utils::getLexicalOrderedString(m_rank));
}
bool
GrpProtein::operator==(const GrpProtein &other) const
{
return (m_accession == other.m_accession);
}
const QString &
GrpProtein::getAccession() const
{
return m_accession;
}
const QString &
GrpProtein::getDescription() const
{
return m_description;
}
void
GrpProtein::push_back(GrpPeptide *p_grpPeptide)
{
// p_grpPeptide->push_back(this);
m_grpPeptidePtrList.push_back(p_grpPeptide);
}
void
GrpProtein::strip()
{
qDebug() << "GrpProtein::strip begin " << this->m_accession;
// m_grpPeptidePtrList.sort();
std::sort(m_grpPeptidePtrList.begin(), m_grpPeptidePtrList.end());
// m_grpPeptidePtrList.unique();
m_grpPeptidePtrList.erase(
std::unique(m_grpPeptidePtrList.begin(), m_grpPeptidePtrList.end()),
m_grpPeptidePtrList.end());
qDebug() << "GrpProtein::strip end";
}
void
GrpProtein::setRank(unsigned int i)
{
m_rank = i;
}
void
GrpProtein::setGroupNumber(unsigned int i)
{
m_groupNumber = i;
}
pappso::GrpPeptide
Definition: grppeptide.h:43
pappso::GrpProtein
Definition: grpprotein.h:40
pappso::GrpProtein::const_iterator
std::vector< GrpPeptide * >::const_iterator const_iterator
Definition: grpprotein.h:54
pappso::GrpProtein::m_accession
const QString m_accession
Definition: grpprotein.h:80
pappso::GrpProtein::m_description
const QString m_description
Definition: grpprotein.h:81
pappso::GrpProtein::m_rank
unsigned int m_rank
Definition: grpprotein.h:84
pappso::GrpProtein::m_grpPeptidePtrList
std::vector< GrpPeptide * > m_grpPeptidePtrList
Definition: grpprotein.h:77
pappso::GrpProtein::~GrpProtein
~GrpProtein()
Definition: grpprotein.cpp:52
pappso::GrpProtein::GrpProtein
GrpProtein(const GrpProtein &other)
Definition: grpprotein.cpp:39
pappso::GrpProtein::getGroupNumber
unsigned int getGroupNumber() const
Definition: grpprotein.cpp:84
pappso::GrpProtein::operator==
bool operator==(const GrpProtein &other) const
Definition: grpprotein.cpp:112
pappso::GrpProtein::setRank
void setRank(unsigned int i)
Definition: grpprotein.cpp:149
pappso::GrpProtein::m_groupNumber
unsigned int m_groupNumber
Definition: grpprotein.h:82
pappso::GrpProtein::countPlus
void countPlus()
Definition: grpprotein.cpp:73
pappso::GrpProtein::getAccession
const QString & getAccession() const
Definition: grpprotein.cpp:119
pappso::GrpProtein::push_back
void push_back(GrpPeptide *p_grpPeptide)
Definition: grpprotein.cpp:129
pappso::GrpProtein::strip
void strip()
ensure that each peptide in peptide list is unique and sorted by pointer adress
Definition: grpprotein.cpp:136
pappso::GrpProtein::getGroupingId
const QString getGroupingId() const
Definition: grpprotein.cpp:100
pappso::GrpProtein::getSubGroupNumber
unsigned int getSubGroupNumber() const
Definition: grpprotein.cpp:90
pappso::GrpProtein::m_subGroupNumber
unsigned int m_subGroupNumber
Definition: grpprotein.h:83
pappso::GrpProtein::setGroupNumber
void setGroupNumber(unsigned int i)
Definition: grpprotein.cpp:154
pappso::GrpProtein::m_count
unsigned int m_count
Definition: grpprotein.h:85
pappso::GrpProtein::getDescription
const QString & getDescription() const
Definition: grpprotein.cpp:124
pappso::GrpProtein::getCount
unsigned int getCount() const
Definition: grpprotein.cpp:68
pappso::GrpProtein::getRank
unsigned int getRank() const
Definition: grpprotein.cpp:95
pappso::GrpProtein::end
const_iterator end() const
Definition: grpprotein.cpp:62
pappso::GrpProtein::setSubGroupNumber
void setSubGroupNumber(unsigned int i)
Definition: grpprotein.cpp:78
pappso::GrpProtein::begin
const_iterator begin() const
Definition: grpprotein.cpp:57
pappso::Utils::getLexicalOrderedString
static const QString getLexicalOrderedString(unsigned int num)
Definition: utils.cpp:52
grpexperiment.h
grppeptide.h
grpprotein.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39