From eb48c60bdec29a068a95a2148cac984b323739db Mon Sep 17 00:00:00 2001
From: Olivier Langella <olivier.langella@u-psud.fr>
Date: Mon, 12 Feb 2018 16:39:08 +0100
Subject: [PATCH] new delta MHplus column

---
 src/gui/peptide_list_view/peptidetablemodel.cpp |  2 +-
 src/output/ods/proteinsheet.cpp                 |  1 +
 src/output/ods/spectrasheet.cpp                 | 10 ++++++++++
 src/output/ods/spectrasheet.h                   |  2 ++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/gui/peptide_list_view/peptidetablemodel.cpp b/src/gui/peptide_list_view/peptidetablemodel.cpp
index 1de37aa8..61b4583f 100644
--- a/src/gui/peptide_list_view/peptidetablemodel.cpp
+++ b/src/gui/peptide_list_view/peptidetablemodel.cpp
@@ -339,7 +339,7 @@ const QString PeptideTableModel::getDescription(std::int8_t column) {
         return "peptide theoretical MH+";
         break;
     case (std::int8_t) PeptideListColumn::delta_mhplus:
-        return "peptide mass difference betwenn observed mass and theoretical mass";
+        return "peptide mass difference between observed mass and theoretical mass";
         break;
     case (std::int8_t) PeptideListColumn::hyperscore:
         return "X!Tandem hyperscore";
diff --git a/src/output/ods/proteinsheet.cpp b/src/output/ods/proteinsheet.cpp
index 4be82371..4d8028ab 100644
--- a/src/output/ods/proteinsheet.cpp
+++ b/src/output/ods/proteinsheet.cpp
@@ -43,6 +43,7 @@ ProteinSheet::ProteinSheet (OdsExport * p_ods_export, CalcWriterInterface * p_wr
         writeIdentificationGroup(p_ident);
     }
 }
+
 void ProteinSheet::writeCellHeader(ProteinListColumn column) {
     qDebug() << "ProteinSheet::writeCellHeader begin " << (std::int8_t) column;
     _p_writer->setCellAnnotation(ProteinTableModel::getDescription(column));
diff --git a/src/output/ods/spectrasheet.cpp b/src/output/ods/spectrasheet.cpp
index 9fa49b21..c89e7cdc 100644
--- a/src/output/ods/spectrasheet.cpp
+++ b/src/output/ods/spectrasheet.cpp
@@ -45,6 +45,14 @@ SpectraSheet::SpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_wr
 }
 
 
+void SpectraSheet::writeCellHeader(PeptideListColumn column) {
+    qDebug() << "SpectraSheet::writeCellHeader begin " << (std::int8_t) column;
+    _p_writer->setCellAnnotation(PeptideTableModel::getDescription(column));
+    _p_writer->writeCell(PeptideTableModel::getTitle(column));
+    qDebug() << "SpectraSheet::writeCellHeader end" ;
+}
+
+
 void SpectraSheet::writeHeaders(IdentificationGroup * p_ident)  {
     // Group ID	Peptide ID	Sample	Scan	Rt (minutes)	Sequence (top)	Modifs (top)	Number of subgroups	Sub-groups Ids	Best E-value	Best hyperscore	m/z Obs	Charge	MH+ Obs	MH+ theo	DeltaMH+	Delta-ppm
 
@@ -80,6 +88,7 @@ void SpectraSheet::writeHeaders(IdentificationGroup * p_ident)  {
     }
     _p_writer->writeCell("Best E-value");
     _p_writer->writeCell("Best hyperscore");
+    writeCellHeader(PeptideListColumn::delta_mhplus);
 
 
 }
@@ -114,6 +123,7 @@ void SpectraSheet::writeBestPeptideEvidence(const GroupingGroup * p_group,const
     }
     _p_writer->writeCell(p_peptide_evidence->getEvalue());
     _p_writer->writeCell(p_peptide_evidence->getParam(PeptideEvidenceParam::tandem_hyperscore).toDouble());
+    _p_writer->writeCell(p_peptide_evidence->getDeltaMass());
 
 
 }
diff --git a/src/output/ods/spectrasheet.h b/src/output/ods/spectrasheet.h
index c4303121..0285d7a2 100644
--- a/src/output/ods/spectrasheet.h
+++ b/src/output/ods/spectrasheet.h
@@ -33,6 +33,7 @@
 #include "../../core/project.h"
 #include <odsstream/calcwriterinterface.h>
 #include "../../core/proteinmatch.h"
+#include "../../gui/peptide_list_view/peptidelistwindow.h"
 #include "odsexport.h"
 
 class SpectraSheet
@@ -43,6 +44,7 @@ private :
     void writeIdentificationGroup(IdentificationGroup * p_ident);
     void writeHeaders(IdentificationGroup * p_ident);
     void writeBestPeptideEvidence(const GroupingGroup * p_group, const PeptideEvidence * p_peptide_evidence);
+    void writeCellHeader(PeptideListColumn column);
 
 private :
     OdsExport * _p_ods_export;
-- 
GitLab