Loading...
Searching...
No Matches
pappso::GrpSubGroup Class Reference

`#include <grpsubgroup.h>`

## Public Member Functions

| GrpSubGroup (GrpProtein *p_protein)
| GrpSubGroup (const GrpSubGroup &other)
bool | operator< (const GrpSubGroup &other) const
| sort subgroups between each other a subgroup containing less peptides is weaker (less) than the other
| ~GrpSubGroup ()
GrpSubGroupSp | makeGrpSubGroupSp ()
const GrpPeptideSet & | getPeptideSet () const
bool | merge (GrpSubGroup *p_subgroup)
bool | includes (const GrpSubGroup *p_subgroup) const
void | numbering ()
void | setSubGroupNumber (unsigned int i)
void | setGroupNumber (unsigned int i)
const QString & | getFirstAccession () const
std::size_t | peptideListSize () const
unsigned int | maxCount () const
const QString | getGroupingId () const
unsigned int | getGroupNumber () const
unsigned int | getSubGroupNumber () const
const std::vector< GrpProtein * > & | getGrpProteinList () const

## Private Attributes

std::vector< GrpProtein * > | m_grpProteinPtrList
GrpPeptideSet | m_peptidePtrList
unsigned int | m_subGroupNumber = 0
unsigned int | m_groupNumber = 0

## Detailed Description

Definition at line 42 of file grpsubgroup.h.

## Constructor & Destructor Documentation

## GrpSubGroup() [1/2]

pappso::GrpSubGroup::GrpSubGroup | ( | GrpProtein * | p_protein | ) |

Definition at line 36 of file grpsubgroup.cpp.

: m_peptidePtrList(p_protein)
{
m_grpProteinPtrList.push_back(p_protein);
}
pappso::GrpSubGroup::m_grpProteinPtrList
std::vector< GrpProtein * > m_grpProteinPtrList
Definition grpsubgroup.h:45
pappso::GrpSubGroup::m_peptidePtrList
GrpPeptideSet m_peptidePtrList
Definition grpsubgroup.h:46

References m_grpProteinPtrList.

## GrpSubGroup() [2/2]

pappso::GrpSubGroup::GrpSubGroup | ( | const GrpSubGroup & | other | ) |

Definition at line 41 of file grpsubgroup.cpp.

: m_grpProteinPtrList(other.m_grpProteinPtrList),
m_peptidePtrList(other.m_peptidePtrList)
{
}

## ~GrpSubGroup()

pappso::GrpSubGroup::~GrpSubGroup | ( |  | ) |

Definition at line 124 of file grpsubgroup.cpp.

{
}

## Member Function Documentation

## getFirstAccession()

const QString & pappso::GrpSubGroup::getFirstAccession | ( |  | ) | const

Definition at line 226 of file grpsubgroup.cpp.

{
auto it = m_grpProteinPtrList.begin();
if(it == m_grpProteinPtrList.end())
{
throw PappsoException(QObject::tr("m_grpProteinPtrList is empty"));
}
else
{
return (*it)->getAccession();
}
}

References m_grpProteinPtrList.

Referenced by pappso::GrpMapPeptideToSubGroupSet::hasSpecificPeptide(), merge(), and pappso::GrpMapPeptideToSubGroupSet::remove().

## getGroupingId()

const QString pappso::GrpSubGroup::getGroupingId | ( |  | ) | const

Definition at line 63 of file grpsubgroup.cpp.

{
if(m_groupNumber == 0)
{
return "";
}
return QString("%1.%2")
.arg(Utils::getLexicalOrderedString(m_groupNumber))
.arg(Utils::getLexicalOrderedString(m_subGroupNumber));
}
pappso::GrpSubGroup::m_groupNumber
unsigned int m_groupNumber
Definition grpsubgroup.h:48
pappso::GrpSubGroup::m_subGroupNumber
unsigned int m_subGroupNumber
Definition grpsubgroup.h:47
pappso::Utils::getLexicalOrderedString
static const QString getLexicalOrderedString(unsigned int num)
Definition utils.cpp:52

References pappso::Utils::getLexicalOrderedString(), m_groupNumber, and m_subGroupNumber.

## getGroupNumber()

unsigned int pappso::GrpSubGroup::getGroupNumber | ( |  | ) | const

Definition at line 48 of file grpsubgroup.cpp.

{
return m_groupNumber;
}

References m_groupNumber.

## getGrpProteinList()

const std::vector< GrpProtein * > & pappso::GrpSubGroup::getGrpProteinList | ( |  | ) | const

Definition at line 58 of file grpsubgroup.cpp.

{
return m_grpProteinPtrList;
}

References m_grpProteinPtrList.

## getPeptideSet()

const GrpPeptideSet & pappso::GrpSubGroup::getPeptideSet | ( |  | ) | const

Definition at line 134 of file grpsubgroup.cpp.

{
return m_peptidePtrList;
}

References m_peptidePtrList.

Referenced by pappso::GrpMapPeptideToSubGroupSet::add(), pappso::GrpMapPeptideToSubGroupSet::hasSpecificPeptide(), includes(), and pappso::GrpMapPeptideToSubGroupSet::remove().

## getSubGroupNumber()

unsigned int pappso::GrpSubGroup::getSubGroupNumber | ( |  | ) | const

Definition at line 53 of file grpsubgroup.cpp.

{
return m_subGroupNumber;
}

References m_subGroupNumber.

## includes()

bool pappso::GrpSubGroup::includes | ( | const GrpSubGroup * | p_subgroup | ) | const

Definition at line 166 of file grpsubgroup.cpp.

{
if(m_peptidePtrList.biggerAndContainsAll(p_subgroup->getPeptideSet()))
{
return true;
}
else
{
return false;
}
}
pappso::GrpPeptideSet::biggerAndContainsAll
bool biggerAndContainsAll(const GrpPeptideSet &peptideSet) const
Definition grppeptideset.cpp:90

References pappso::GrpPeptideSet::biggerAndContainsAll(), getPeptideSet(), and m_peptidePtrList.

## makeGrpSubGroupSp()

GrpSubGroupSp pappso::GrpSubGroup::makeGrpSubGroupSp | ( |  | ) |

Definition at line 128 of file grpsubgroup.cpp.

{
return std::make_shared<GrpSubGroup>(*this);
}

Referenced by pappso::GrpExperiment::startGrouping().

## maxCount()

unsigned int pappso::GrpSubGroup::maxCount | ( |  | ) | const

Definition at line 74 of file grpsubgroup.cpp.

{
unsigned int max = 0;
for(GrpProtein *p_protein : m_grpProteinPtrList)
{
if(max < p_protein->getCount())
{
max = p_protein->getCount();
}
}
return max;
}
pappso::XicExtractMethod::max
@ max
maximum of intensities

References m_grpProteinPtrList, and pappso::max.

Referenced by operator<().

## merge()

bool pappso::GrpSubGroup::merge | ( | GrpSubGroup * | p_subgroup | ) |

Definition at line 140 of file grpsubgroup.cpp.

{
qDebug() << "GrpSubGroup::merge begin " << m_grpProteinPtrList.size() << " "
<< this->getFirstAccession() << " "
<< p_subgroup->getFirstAccession();
// if (this == p_subgroup) {
// return true;
//}
if(p_subgroup->m_peptidePtrList == m_peptidePtrList)
{
// m_grpProteinPtrList.splice (m_grpProteinPtrList.end(),
// p_subgroup->m_grpProteinPtrList);
m_grpProteinPtrList.insert(m_grpProteinPtrList.end(),
p_subgroup->m_grpProteinPtrList.begin(),
p_subgroup->m_grpProteinPtrList.end());
// m_grpProteinPtrList.insert (m_grpProteinPtrList.end(),
// p_subgroup->m_grpProteinPtrList.begin(),p_subgroup->m_grpProteinPtrList.end());
return true;
}
else
{
return false;
}
}
pappso::GrpSubGroup::getFirstAccession
const QString & getFirstAccession() const
Definition grpsubgroup.cpp:226

References getFirstAccession(), m_grpProteinPtrList, m_peptidePtrList, and pappso::GrpPeptideSet::size().

## numbering()

void pappso::GrpSubGroup::numbering | ( |  | ) |

Definition at line 199 of file grpsubgroup.cpp.

{
qDebug() << "GrpSubGroup::numbering begin";
// sort proteins by accession numbers :
// m_grpProteinPtrList.sort([](GrpProtein * first, GrpProtein * second) {
// return (first->getAccession() < second->getAccession()) ;
//});
std::sort(m_grpProteinPtrList.begin(),
m_grpProteinPtrList.end(),
[](GrpProtein *first, GrpProtein *second) {
return (first->getAccession() < second->getAccession());
});
// list unique removes all but the first element from every consecutive group
// of equal elements in the container
// m_grpProteinPtrList.unique();
unsigned int i = 1;
for(auto &&p_protein : m_grpProteinPtrList)
{
p_protein->setRank(i);
i++;
}
qDebug() << "GrpSubGroup::numbering end";
}

References m_grpProteinPtrList.

## operator<()

bool pappso::GrpSubGroup::operator< | ( | const GrpSubGroup & | other | ) | const

sort subgroups between each other a subgroup containing less peptides is weaker (less) than the other

Definition at line 86 of file grpsubgroup.cpp.

{
if(m_peptidePtrList.size() == other.m_peptidePtrList.size())
{
if(maxCount() == other.maxCount())
{
if(m_grpProteinPtrList.size() == other.m_grpProteinPtrList.size())
{
// compare peptide set surface ?
// alphabetic order taken into account
return ((*(m_grpProteinPtrList.begin()))->getAccession() <
(*(other.m_grpProteinPtrList.begin()))->getAccession());
}
else
{
// if there is same peptide size evidence, then perhaps it's
// better to consider that
// the best group is the one that include more proteins
return (m_grpProteinPtrList.size() >
other.m_grpProteinPtrList.size());
}
}
else
{
// counts are evidences of the presence of a subgroup
// the fewer is the count, the weaker is the subgroup
return (maxCount() > other.maxCount());
}
}
else
{
// peptides are evidences of the presence of a subgroup
// the fewer is the peptide list, the weaker is the subgroup
return (m_peptidePtrList.size() > other.m_peptidePtrList.size());
}
}
pappso::GrpPeptideSet::size
unsigned int size() const
Definition grppeptideset.h:54
pappso::GrpSubGroup::maxCount
unsigned int maxCount() const
Definition grpsubgroup.cpp:74

References m_grpProteinPtrList, m_peptidePtrList, maxCount(), and pappso::GrpPeptideSet::size().

## peptideListSize()

std::size_t pappso::GrpSubGroup::peptideListSize | ( |  | ) | const

Definition at line 240 of file grpsubgroup.cpp.

{
return m_peptidePtrList.size();
}

References m_peptidePtrList, and pappso::GrpPeptideSet::size().

## setGroupNumber()

void pappso::GrpSubGroup::setGroupNumber | ( | unsigned int | i | ) |

Definition at line 179 of file grpsubgroup.cpp.

{
m_groupNumber = i;
for(auto &&p_protein : m_grpProteinPtrList)
{
p_protein->setGroupNumber(i);
}
}

References m_groupNumber, and m_grpProteinPtrList.

## setSubGroupNumber()

void pappso::GrpSubGroup::setSubGroupNumber | ( | unsigned int | i | ) |

Definition at line 189 of file grpsubgroup.cpp.

{
m_subGroupNumber = i;
for(auto &&p_protein : m_grpProteinPtrList)
{
p_protein->setSubGroupNumber(i);
}
}

References m_grpProteinPtrList, and m_subGroupNumber.

## Member Data Documentation

## m_groupNumber

unsigned int pappso::GrpSubGroup::m_groupNumber = 0

private

Definition at line 48 of file grpsubgroup.h.

Referenced by getGroupingId(), getGroupNumber(), and setGroupNumber().

## m_grpProteinPtrList

std::vector<GrpProtein *> pappso::GrpSubGroup::m_grpProteinPtrList

private

Definition at line 45 of file grpsubgroup.h.

Referenced by GrpSubGroup(), getFirstAccession(), getGrpProteinList(), maxCount(), merge(), numbering(), operator<(), setGroupNumber(), and setSubGroupNumber().

## m_peptidePtrList

GrpPeptideSet pappso::GrpSubGroup::m_peptidePtrList

private

Definition at line 46 of file grpsubgroup.h.

Referenced by getPeptideSet(), includes(), merge(), operator<(), and peptideListSize().

## m_subGroupNumber

unsigned int pappso::GrpSubGroup::m_subGroupNumber = 0

private

Definition at line 47 of file grpsubgroup.h.

Referenced by getGroupingId(), getSubGroupNumber(), and setSubGroupNumber().

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

- pappsomspp/grouping/grpsubgroup.h
- pappsomspp/grouping/grpsubgroup.cpp