From 966a47326875934b4accbc466eed36b1a9e07fbe Mon Sep 17 00:00:00 2001
From: Olivier Langella <olivier.langella@u-psud.fr>
Date: Tue, 13 Mar 2018 22:26:00 +0100
Subject: [PATCH] use colorscale in compar sheets

---
 src/output/ods/comparbasesheet.cpp     | 12 ++++++++++++
 src/output/ods/comparbasesheet.h       |  2 ++
 src/output/ods/ptm/ptmspectrasheet.cpp |  1 +
 3 files changed, 15 insertions(+)

diff --git a/src/output/ods/comparbasesheet.cpp b/src/output/ods/comparbasesheet.cpp
index 338a6967..86717c9f 100644
--- a/src/output/ods/comparbasesheet.cpp
+++ b/src/output/ods/comparbasesheet.cpp
@@ -31,6 +31,7 @@
 
 #include <tuple>
 #include <pappsomspp/utils.h>
+#include <odsstream/odscolorscale.h>
 #include <QDebug>
 
 
@@ -112,6 +113,9 @@ void ComparBaseSheet::writeProteinMatch(const ProteinMatch * p_protein_match) {
 
     for (MsRunSp & msrun_sp: _msrun_list) {
         writeComparValue(p_protein_match, ValidationState::validAndChecked, msrun_sp.get());
+        if(_first_cell_coordinate.isEmpty()) {
+            _first_cell_coordinate = _p_writer->getCellCoordinate();
+        }
     }
 
 
@@ -149,6 +153,14 @@ void ComparBaseSheet::writeIdentificationGroup(IdentificationGroup * p_ident) {
     for (ProteinMatch * p_protein_match : protein_match_list) {
         writeProteinMatch(p_protein_match);
     }
+    
+    if (!_first_cell_coordinate.isEmpty()) {
+        QString last_cell_coordinate = _p_writer->getCellCoordinate();
+        qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " " << _first_cell_coordinate<< " " << last_cell_coordinate;
+        OdsColorScale color_scale(_first_cell_coordinate, last_cell_coordinate);
+        _p_writer->addColorScale(color_scale);
+        _first_cell_coordinate = "";
+    }
     _p_writer->writeLine();
     _p_writer->writeLine();
     qDebug() << "ComparBaseSheet::writeIdentificationGroup end";
diff --git a/src/output/ods/comparbasesheet.h b/src/output/ods/comparbasesheet.h
index 0c41418f..da230ef1 100644
--- a/src/output/ods/comparbasesheet.h
+++ b/src/output/ods/comparbasesheet.h
@@ -56,6 +56,8 @@ protected :
     std::vector<MsRunSp> _msrun_list;
     QString _title_sheet;
     
+    QString _first_cell_coordinate;
+    
 };
 
 #endif // COMPARBASESHEET_H
diff --git a/src/output/ods/ptm/ptmspectrasheet.cpp b/src/output/ods/ptm/ptmspectrasheet.cpp
index 2e86f9fa..e337a379 100644
--- a/src/output/ods/ptm/ptmspectrasheet.cpp
+++ b/src/output/ods/ptm/ptmspectrasheet.cpp
@@ -135,6 +135,7 @@ void PtmSpectraSheet::writeIdentificationGroup(IdentificationGroup * p_ident) {
     _p_ptm_grouping_experiment = p_ident->getPtmGroupingExperiment();
 
     writeHeaders(p_ident);
+    _p_ptm_grouping_experiment->get
     for (const std::pair<unsigned int, GroupingGroupSp> & group_pair : p_ident->getGroupStore().getGroupMap()) {
 
         std::vector<const PeptideEvidence *> peptide_evidence_list = group_pair.second.get()->getPeptideEvidenceList();
-- 
GitLab