From b25cf7c7c2bb8f9dc090598d9053491874f006e5 Mon Sep 17 00:00:00 2001
From: Olivier Langella <olivier.langella@u-psud.fr>
Date: Thu, 3 May 2018 15:59:21 +0200
Subject: [PATCH] no NSAF on overall msruns

---
 src/core/identificationgroup.h                  |  4 ++--
 src/core/proteinmatch.h                         |  8 ++++----
 src/gui/protein_list_view/proteinlistwindow.cpp | 11 -----------
 src/gui/protein_list_view/proteinlistwindow.h   |  3 ---
 src/gui/protein_list_view/proteintablemodel.cpp | 13 ++-----------
 src/gui/protein_list_view/proteintablemodel.h   |  1 -
 6 files changed, 8 insertions(+), 32 deletions(-)

diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h
index 2e162785..eac9dd5f 100644
--- a/src/core/identificationgroup.h
+++ b/src/core/identificationgroup.h
@@ -57,9 +57,9 @@ public:
     
             /** @brief compute proto NSAF sum within msrun
      * Warning: this is not NSAF, just a part
-     * @param p_msrun_id pointer on the msrun to get NSAF. if not defined, NSAF is computed overall msruns
+     * @param p_msrun_id pointer on the msrun to get NSAF.
      * */
-    pappso::pappso_double computeProtoNsafSum(const MsRun * p_msrun_id = nullptr) const;
+    pappso::pappso_double computeProtoNsafSum(const MsRun * p_msrun_id) const;
 
     /** @brief count groups
     * */
diff --git a/src/core/proteinmatch.h b/src/core/proteinmatch.h
index 4b1bcebb..bb86106c 100644
--- a/src/core/proteinmatch.h
+++ b/src/core/proteinmatch.h
@@ -66,16 +66,16 @@ public:
 
         /** @brief compute proto NSAF within msrun
      * Warning: this is not NSAF, just a part
-     * @param p_msrun_id pointer on the msrun to get NSAF. if not defined, NSAF is computed overall msruns
+     * @param p_msrun_id pointer on the msrun to get NSAF.
      * */
-    pappso::pappso_double getProtoNsaf(const MsRun * p_msrun_id = nullptr) const;
+    pappso::pappso_double getProtoNsaf(const MsRun * p_msrun_id) const;
 
             /** @brief compute NSAF within msrun
      * Warning: this is not NSAF, just a part
      * @param proto_nsaf_sum the sum of proto nsaf of all proteins within the msrun
-     * @param p_msrun_id pointer on the msrun to get NSAF. if not defined, NSAF is computed overall msruns
+     * @param p_msrun_id pointer on the msrun to get NSAF
      * */
-    pappso::pappso_double getNsaf(pappso::pappso_double proto_nsaf_sum, const MsRun * p_msrun_id = nullptr) const;
+    pappso::pappso_double getNsaf(pappso::pappso_double proto_nsaf_sum, const MsRun * p_msrun_id) const;
 
     /** @brief compute Protein Abundance Index (PAI) within sample
      * PAI computation (Rappsilber et al. 2002)
diff --git a/src/gui/protein_list_view/proteinlistwindow.cpp b/src/gui/protein_list_view/proteinlistwindow.cpp
index d7c02cf4..e71b9ecd 100644
--- a/src/gui/protein_list_view/proteinlistwindow.cpp
+++ b/src/gui/protein_list_view/proteinlistwindow.cpp
@@ -272,9 +272,6 @@ void ProteinListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_ide
     if (_p_identification_group == p_identification_group) {
         //_protein_table_model_p->setIdentificationGroup(p_identification_group);
         //_p_proxy_model->setSourceModel(_protein_table_model_p);
-        //if(getProteinListColumnDisplay) {
-            sumProtoNsaf();
-        //}
         emit proteinDataChanged();
     }
 
@@ -350,11 +347,3 @@ void ProteinListWindow::resizeColumnsToContents() {
 ProjectWindow * ProteinListWindow::getProjectWindow() {
     return _project_window;
 }
-
-
-    pappso::pappso_double ProteinListWindow::getProtoNsafSum() const {
-        return _sum_proto_nsaf;
-    }
-    void ProteinListWindow::sumProtoNsaf() {
-        _sum_proto_nsaf = _p_identification_group->computeProtoNsafSum();
-    }
diff --git a/src/gui/protein_list_view/proteinlistwindow.h b/src/gui/protein_list_view/proteinlistwindow.h
index 98a3e632..e5d1d9d7 100644
--- a/src/gui/protein_list_view/proteinlistwindow.h
+++ b/src/gui/protein_list_view/proteinlistwindow.h
@@ -98,8 +98,6 @@ protected :
     void askProteinDetailView(ProteinMatch * p_protein_match);
     void askPeptideListView(ProteinMatch * p_protein_match);
     ProjectWindow * getProjectWindow();
-    pappso::pappso_double getProtoNsafSum() const;
-    void sumProtoNsaf();
 
 
 
@@ -112,7 +110,6 @@ private:
     QMenu * _p_context_menu = nullptr;
     bool _display_evalue = true;
     bool _display_accession = true;
-    pappso::pappso_double _sum_proto_nsaf;
 
 };
 
diff --git a/src/gui/protein_list_view/proteintablemodel.cpp b/src/gui/protein_list_view/proteintablemodel.cpp
index ee1dbfc6..efd5d1f6 100644
--- a/src/gui/protein_list_view/proteintablemodel.cpp
+++ b/src/gui/protein_list_view/proteintablemodel.cpp
@@ -65,7 +65,7 @@ int ProteinTableModel::rowCount(const QModelIndex &parent ) const {
 int ProteinTableModel::columnCount(const QModelIndex &parent ) const {
     //qDebug() << "ProteinTableModel::columnCount begin ";
     if (_p_identification_group != nullptr) {
-        return 15;
+        return 14;
     }
     return 0;
 }
@@ -127,10 +127,7 @@ const QString ProteinTableModel::getTitle(std::int8_t column) {
     case (std::int8_t) ProteinListColumn::molecular_weight:
         return "MW";
         break;
-        
-    case (std::int8_t) ProteinListColumn::nsaf:
-        return "NSAF";
-        break;
+    
 
     }
     return "";
@@ -183,9 +180,6 @@ const QString ProteinTableModel::getDescription(std::int8_t column) {
 
     case (std::int8_t) ProteinListColumn::molecular_weight:
         return "protein molecular weight in Dalton";
-
-    case (std::int8_t) ProteinListColumn::nsaf:
-        return "NSAF";
     }
     return "";
 }
@@ -337,9 +331,6 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
         if (col == (std::int8_t) ProteinListColumn::molecular_weight ) {
             return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getMass());
         }
-        if (col == (std::int8_t) ProteinListColumn::nsaf ) {
-            return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getNsaf(_p_protein_list_window->getProtoNsafSum()));
-        }
         return QVariant();
     }
     return QVariant();
diff --git a/src/gui/protein_list_view/proteintablemodel.h b/src/gui/protein_list_view/proteintablemodel.h
index 04f37015..a3f10326 100644
--- a/src/gui/protein_list_view/proteintablemodel.h
+++ b/src/gui/protein_list_view/proteintablemodel.h
@@ -47,7 +47,6 @@ enum class ProteinListColumn: std::int8_t {
     molecular_weight=11, ///< protein molecular weight in Dalton
     pai=12, ///< PAI
     empai=13, ///< emPAI
-    nsaf=14, ///< NSAF
 };
 
 class ProteinListWindow;
-- 
GitLab