diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index 2aaf9e413c1025f47baa1d3876ff12ff618f3b8b..4ccd2196345abad23535c73f7d38f1e962a74b7d 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -62,6 +62,16 @@ std::vector<ProteinMatch *> & IdentificationGroup::getProteinMatchList() { return _protein_match_list; } +size_t IdentificationGroup::countGrouped()const { + size_t i=0; + for (auto & p_protein_match : _protein_match_list) { + if (p_protein_match->isGrouped()) { + i++; + } + } + return i; +} + size_t IdentificationGroup::countValidAndChecked()const { size_t i=0; for (auto & p_protein_match : _protein_match_list) { diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h index 9d27dd386aa7440cdf2e2b60720893d6c6e73071..ccce83c5245ac269c37fb464ac7569a55009e5f9 100644 --- a/src/core/identificationgroup.h +++ b/src/core/identificationgroup.h @@ -54,7 +54,11 @@ public: /** @brief count valid and manually checked proteins * */ std::size_t countValidAndChecked()const; - + + /** @brief count grouped proteins + * */ + std::size_t countGrouped()const; + /** @brief count groups * */ std::size_t countGroup()const; diff --git a/src/core/peptidematch.cpp b/src/core/peptidematch.cpp index 4d62a408e61cac93597cd8d226fdec6060039ef0..12afc44b59d8353944ad4ac49cd993d1d0f6de35 100644 --- a/src/core/peptidematch.cpp +++ b/src/core/peptidematch.cpp @@ -79,6 +79,16 @@ bool PeptideMatch::isChecked() const { bool PeptideMatch::isValidAndChecked() const { return _proxy_valid && _checked; } + +bool PeptideMatch::isGrouped() const { + if (_sp_grp_peptide.get() == nullptr) { + return false; + } + if (_sp_grp_peptide.get()->getGroupNumber() ==0) { + return false; + } + return true; +} void PeptideMatch::setIdentificationDataSource(IdentificationDataSource* identification_source) { _p_identification_source = identification_source; } diff --git a/src/core/peptidematch.h b/src/core/peptidematch.h index 8f36a8319b744e9eef52fa95dd27ec3f712086b5..3fd03a27601b0ef210bb5e6001905667373c4084 100644 --- a/src/core/peptidematch.h +++ b/src/core/peptidematch.h @@ -55,6 +55,7 @@ public : bool isChecked() const; bool isValid() const; bool isValidAndChecked() const; + bool isGrouped() const; const pappso::MsRunIdSp & getMsRunIdSp() const; IdentificationDataSource* getIdentificationDataSource () const; diff --git a/src/core/proteinmatch.cpp b/src/core/proteinmatch.cpp index de37d4906cd28034b396fe8dfe7e4caa9405e390..0b046a4c658b1cc9bc164998ef2c87c5e989435f 100644 --- a/src/core/proteinmatch.cpp +++ b/src/core/proteinmatch.cpp @@ -107,6 +107,16 @@ bool ProteinMatch::isValidAndChecked() const { return _proxy_valid && _checked; } +bool ProteinMatch::isGrouped() const { + if (_sp_grp_protein.get() == nullptr) { + return false; + } + if (_sp_grp_protein.get()->getGroupNumber() == 0) { + return false; + } + return true; +} + void ProteinMatch::setChecked(bool arg1) { _checked = arg1; } diff --git a/src/core/proteinmatch.h b/src/core/proteinmatch.h index 9269a875f5325c5b6a3755b7b58d81a3c7c80512..ec757235232610b9a3db6c25273dd8bb3d2815fb 100644 --- a/src/core/proteinmatch.h +++ b/src/core/proteinmatch.h @@ -81,6 +81,7 @@ public: bool isChecked() const; bool isValid() const; bool isValidAndChecked() const; + bool isGrouped() const; /** @brief count valid spectrums * */ diff --git a/src/gui/project_view/project_view.ui b/src/gui/project_view/project_view.ui index fd1ecee54f470b021405f5ed13e1f4ad940603ff..464002757aaa36ef08bc042adc478e5730e30cea 100644 --- a/src/gui/project_view/project_view.ui +++ b/src/gui/project_view/project_view.ui @@ -85,6 +85,20 @@ </property> </widget> </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Number of grouped proteins</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="protein_number_display"> + <property name="text"> + <string>0</string> + </property> + </widget> + </item> </layout> </item> </layout> @@ -140,7 +154,7 @@ <x>0</x> <y>0</y> <width>445</width> - <height>23</height> + <height>25</height> </rect> </property> </widget> diff --git a/src/gui/project_view/projectwindow.cpp b/src/gui/project_view/projectwindow.cpp index 06c18052406314931047d7cac872193012dcfe59..6d6dbd3d79d58149f7d495edaa7296e6520db109 100644 --- a/src/gui/project_view/projectwindow.cpp +++ b/src/gui/project_view/projectwindow.cpp @@ -139,13 +139,23 @@ void ProjectWindow::connectNewPeptideListWindow() { qDebug() << "ProjectWindow::connectNewPeptideListWindow end"; } +void ProjectWindow::refreshGroup(IdentificationGroup * p_ident_group) { + + vector< MsRunIdSp > ms_run_list = p_ident_group->getMsRunIdSpList(); + ui->sample_number_display->setText(QString("%1").arg(ms_run_list.size())); + + ui->group_number_display->setText(QString("%1").arg(p_ident_group->countGroup())); + ui->subgroup_number_display->setText(QString("%1").arg(p_ident_group->countSubGroup())); + ui->protein_number_display->setText(QString("%1").arg(p_ident_group->countGrouped())); + emit identificationGroupGrouped(p_ident_group); +} void ProjectWindow::doIdentificationGroupEdited(IdentificationGroup * p_ident_group) { qDebug() << "ProjectWindow::doIdentificationGroupEdited begin"; p_ident_group->startGrouping(_project_sp.get()->getGroupingType()); - emit identificationGroupGrouped(p_ident_group); + refreshGroup(p_ident_group); qDebug() << "ProjectWindow::doIdentificationGroupEdited end"; } @@ -220,11 +230,7 @@ void ProjectWindow::setProjectSp(ProjectSp project_sp) { _p_current_protein_list_window = nullptr; _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())); + refreshGroup(_project_sp.get()->getCurrentIdentificationGroupP()); //_protein_list_window->setIdentificationGroup(_project_sp.get()->getCurrentIdentificationGroupP()); //_protein_list_window->show(); this->setEnabled(true); diff --git a/src/gui/project_view/projectwindow.h b/src/gui/project_view/projectwindow.h index d770c8fbd79ed8c3204bf8de774a511803a481b0..3522a96c890dc99a80a28e800c4f1c26b756d652 100644 --- a/src/gui/project_view/projectwindow.h +++ b/src/gui/project_view/projectwindow.h @@ -62,6 +62,7 @@ private : void connectNewProteinListWindow(); void connectNewPeptideListWindow(); void connectNewProteinDetailWindow(); + void refreshGroup(IdentificationGroup * p_ident_group); private: Ui::ProjectView *ui; MainWindow * main_window;