diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index 059fc9d65e91a8cdd02a71f7aa4623eb8c78a3c8..2aaf9e413c1025f47baa1d3876ff12ff618f3b8b 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -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); } } diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h index 4199d0515f816b414c3ed5adfe3f5d31bca37aa2..9d27dd386aa7440cdf2e2b60720893d6c6e73071 100644 --- a/src/core/identificationgroup.h +++ b/src/core/identificationgroup.h @@ -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; diff --git a/src/grouping/groupinggroup.cpp b/src/grouping/groupinggroup.cpp index cd030733c157da4bbffaa5a816e864185311ed78..51806a76b5e14c4739d292227df23bab3689f847 100644 --- a/src/grouping/groupinggroup.cpp +++ b/src/grouping/groupinggroup.cpp @@ -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) { diff --git a/src/grouping/groupinggroup.h b/src/grouping/groupinggroup.h index 983996c7df2980381bb7e7f22f020807ba06d883..b8bb3befbea612480bdf893382b9c3b97f16b2cd 100644 --- a/src/grouping/groupinggroup.h +++ b/src/grouping/groupinggroup.h @@ -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; }; diff --git a/src/gui/project_view/projectwindow.cpp b/src/gui/project_view/projectwindow.cpp index bb33ac45902154576118a491132bb764c33741af..41160e4706174a22c5177dbba67226f91322df25 100644 --- a/src/gui/project_view/projectwindow.cpp +++ b/src/gui/project_view/projectwindow.cpp @@ -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); diff --git a/src/utils/groupstore.cpp b/src/utils/groupstore.cpp index 7f5f0ffa9973fe4c51d2bb828ea1f79ee39b8dad..17c46e71fa183d750ff8d2e278dabda2f49af06a 100644 --- a/src/utils/groupstore.cpp +++ b/src/utils/groupstore.cpp @@ -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; diff --git a/src/utils/groupstore.h b/src/utils/groupstore.h index 051918cd4cf195497488fd2b15d5da5f8aaaa9c8..7ed6182cfa1cda06cf6ecf16cb7e6765e083ee93 100644 --- a/src/utils/groupstore.h +++ b/src/utils/groupstore.h @@ -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; };