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

refresh and signal OK

parent 82e69a0e
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -81,6 +81,7 @@ public:
bool isChecked() const;
bool isValid() const;
bool isValidAndChecked() const;
bool isGrouped() const;
/** @brief count valid spectrums
* */
......
......@@ -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>
......
......@@ -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);
......
......@@ -62,6 +62,7 @@ private :
void connectNewProteinListWindow();
void connectNewPeptideListWindow();
void connectNewProteinDetailWindow();
void refreshGroup(IdentificationGroup * p_ident_group);
private:
Ui::ProjectView *ui;
MainWindow * main_window;
......
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