Skip to content
Snippets Groups Projects
Commit 3d06aecd authored by Olivier Langella's avatar Olivier Langella
Browse files

count group and subgroups

parent f0e6f564
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,15 @@ size_t IdentificationGroup::countValid()const {
return i;
}
std::size_t IdentificationGroup::countGroup()const {
return _group_store.countGroup();
}
std::size_t IdentificationGroup::countSubGroup()const {
return _group_store.countSubGroup();
}
void IdentificationGroup::startGrouping (const GroupingType & grouping_type) {
if (_p_grp_experiment != nullptr) {
delete _p_grp_experiment;
......@@ -92,9 +101,9 @@ void IdentificationGroup::startGrouping (const GroupingType & grouping_type) {
}
_p_grp_experiment->startGrouping();
GroupStore group_store;
_group_store.clear();
for (auto & p_protein_match : _protein_match_list) {
p_protein_match->setGroupInstance(group_store);
p_protein_match->setGroupInstance(_group_store);
}
}
......@@ -49,11 +49,19 @@ public:
/** @brief count valid proteins
* */
size_t countValid()const;
std::size_t countValid()const;
/** @brief count valid and manually checked proteins
* */
size_t countValidAndChecked()const;
std::size_t countValidAndChecked()const;
/** @brief count groups
* */
std::size_t countGroup()const;
/** @brief count subgroups
* */
std::size_t countSubGroup()const;
/** @brief validate or invalidate peptides and proteins based automatic filters and manual checks
......@@ -67,6 +75,8 @@ private :
GroupingExperiment * _p_grp_experiment= nullptr;
Project * _p_project;
GroupStore _group_store;
std::vector<ProteinMatch *> _protein_match_list;
......
......@@ -35,7 +35,9 @@ GroupingGroup::~GroupingGroup()
{
}
unsigned int GroupingGroup::getNumberOfSubgroups() const {
return _number_of_subgroup;
}
std::size_t GroupingGroup::countSpecificSpectrum(const ProteinMatch * p_protein_match) const {
if (_number_of_subgroup == 1) {
......
......@@ -43,8 +43,10 @@ public:
void add(const ProteinMatch * p_protein_match);
std::size_t countSpecificSpectrum(const ProteinMatch * p_protein_match) const;
std::size_t countSpecificSequence(const ProteinMatch * p_protein_match) const;
unsigned int getNumberOfSubgroups() const;
private :
unsigned int _number_of_subgroup=0;
unsigned int _number_of_subgroup=0;
std::vector<std::pair<unsigned int, const PeptideMatch *>> _pair_sg_number_peptide_match_list;
};
......
......@@ -168,6 +168,9 @@ void ProjectWindow::setProjectSp(ProjectSp project_sp) {
_project_sp = project_sp;
vector< MsRunIdSp > ms_run_list = _project_sp.get()->getCurrentIdentificationGroupP()->getMsRunIdSpList();
ui->sample_number_display->setText(QString("%1").arg(ms_run_list.size()));
ui->group_number_display->setText(QString("%1").arg(_project_sp.get()->getCurrentIdentificationGroupP()->countGroup()));
ui->subgroup_number_display->setText(QString("%1").arg(_project_sp.get()->getCurrentIdentificationGroupP()->countSubGroup()));
//_protein_list_window->setIdentificationGroup(_project_sp.get()->getCurrentIdentificationGroupP());
//_protein_list_window->show();
this->setEnabled(true);
......
......@@ -40,6 +40,24 @@ GroupStore::~GroupStore()
}
void GroupStore::clear() {
_map_group.clear();
}
std::size_t GroupStore::countGroup() const {
return _map_group.size();
}
std::size_t GroupStore::countSubGroup() const {
unsigned int count = 0;
for (auto && pair_group :_map_group) {
count += pair_group.second->getNumberOfSubgroups();
}
return count;
}
GroupingGroupSp GroupStore::getInstance(unsigned int group_number) {
GroupingGroupSp sp_group;
......
......@@ -41,6 +41,9 @@ public:
GroupStore();
~GroupStore();
GroupingGroupSp getInstance(unsigned int group_number);
void clear();
std::size_t countGroup() const;
std::size_t countSubGroup() const;
private :
std::map<unsigned int, GroupingGroupSp> _map_group;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment