From 7f6e14342779ed25c2c9fa6b41bddf3b5a92abdf Mon Sep 17 00:00:00 2001
From: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Date: Sun, 23 Jul 2017 08:20:09 +0200
Subject: [PATCH] new class to handle ptm sample scan ambiguity

---
 src/CMakeLists.txt                 |  1 +
 src/grouping/ptm/ptmisland.cpp     |  6 ++++
 src/grouping/ptm/ptmisland.h       |  3 ++
 src/grouping/ptm/ptmsamplescan.cpp | 39 +++++++++++++++++++++
 src/grouping/ptm/ptmsamplescan.h   | 55 ++++++++++++++++++++++++++++++
 5 files changed, 104 insertions(+)
 create mode 100644 src/grouping/ptm/ptmsamplescan.cpp
 create mode 100644 src/grouping/ptm/ptmsamplescan.h

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 599cd606b..bdaca3a10 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -73,6 +73,7 @@ SET(CPP_FILES
   grouping/ptm/ptmisland.cpp
   grouping/ptm/ptmislandgroup.cpp
   grouping/ptm/ptmislandsubgroup.cpp
+  grouping/ptm/ptmsamplescan.cpp
   gui/peptide_detail_view/spectrum_widget/spectrumpainter.cpp
   input/identificationpwizreader.cpp
   input/xpipsaxhandler.cpp
diff --git a/src/grouping/ptm/ptmisland.cpp b/src/grouping/ptm/ptmisland.cpp
index 215df8a89..bdc27f1d0 100644
--- a/src/grouping/ptm/ptmisland.cpp
+++ b/src/grouping/ptm/ptmisland.cpp
@@ -169,3 +169,9 @@ bool PtmIsland::merge(PtmIslandSp ptm_island_sp) {
         return true;
     }
 }
+
+std::vector<PtmSampleScanSp> PtmIsland::getPtmSampleScanSpList() const {
+    std::vector<PtmSampleScanSp> sample_scan_list;
+    
+    return sample_scan_list;
+}
diff --git a/src/grouping/ptm/ptmisland.h b/src/grouping/ptm/ptmisland.h
index 9cc750b36..5e5f80e29 100644
--- a/src/grouping/ptm/ptmisland.h
+++ b/src/grouping/ptm/ptmisland.h
@@ -32,6 +32,7 @@
 
 #include "../../core/proteinmatch.h"
 #include "../../core/peptidematch.h"
+#include "ptmsamplescan.h"
 #include <memory>
 
 class PtmGroupingExperiment;
@@ -71,6 +72,8 @@ public:
 
     unsigned int getStart() const;
     unsigned int size() const;
+    
+    std::vector<PtmSampleScanSp> getPtmSampleScanSpList() const;
 
 private:
     const ProteinMatch * _protein_match_p;
diff --git a/src/grouping/ptm/ptmsamplescan.cpp b/src/grouping/ptm/ptmsamplescan.cpp
new file mode 100644
index 000000000..8df90dec6
--- /dev/null
+++ b/src/grouping/ptm/ptmsamplescan.cpp
@@ -0,0 +1,39 @@
+/**
+ * \file grouping/ptm/ptmsamplescan.cpp
+ * \date 23/7/2017
+ * \author Olivier Langella
+ * \brief collection of PTM peptides sharing the same spectrum (sample scan)
+ */
+
+/*******************************************************************************
+* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
+*
+* This file is part of XTPcpp.
+*
+*     XTPcpp is free software: you can redistribute it and/or modify
+*     it under the terms of the GNU General Public License as published by
+*     the Free Software Foundation, either version 3 of the License, or
+*     (at your option) any later version.
+*
+*     XTPcpp is distributed in the hope that it will be useful,
+*     but WITHOUT ANY WARRANTY; without even the implied warranty of
+*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*     GNU General Public License for more details.
+*
+*     You should have received a copy of the GNU General Public License
+*     along with XTPcpp.  If not, see <http://www.gnu.org/licenses/>.
+*
+* Contributors:
+*     Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
+******************************************************************************/
+
+#include "ptmsamplescan.h"
+
+PtmSampleScan::PtmSampleScan() {
+}
+
+PtmSampleScan::PtmSampleScan(const PtmSampleScan& other){
+}
+
+PtmSampleScan::~PtmSampleScan() {
+}
diff --git a/src/grouping/ptm/ptmsamplescan.h b/src/grouping/ptm/ptmsamplescan.h
new file mode 100644
index 000000000..1ce8a4eb1
--- /dev/null
+++ b/src/grouping/ptm/ptmsamplescan.h
@@ -0,0 +1,55 @@
+/**
+ * \file grouping/ptm/ptmsamplescan.h
+ * \date 23/7/2017
+ * \author Olivier Langella
+ * \brief collection of PTM peptides sharing the same spectrum (sample scan)
+ */
+
+/*******************************************************************************
+* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
+*
+* This file is part of XTPcpp.
+*
+*     XTPcpp is free software: you can redistribute it and/or modify
+*     it under the terms of the GNU General Public License as published by
+*     the Free Software Foundation, either version 3 of the License, or
+*     (at your option) any later version.
+*
+*     XTPcpp is distributed in the hope that it will be useful,
+*     but WITHOUT ANY WARRANTY; without even the implied warranty of
+*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*     GNU General Public License for more details.
+*
+*     You should have received a copy of the GNU General Public License
+*     along with XTPcpp.  If not, see <http://www.gnu.org/licenses/>.
+*
+* Contributors:
+*     Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
+******************************************************************************/
+
+#ifndef PTMSAMPLESCAN_H
+#define PTMSAMPLESCAN_H
+
+#include <memory>
+#include "../../core/peptidematch.h"
+
+class PtmSampleScan;
+
+/** \brief shared pointer on a PtmSampleScan object
+ */
+typedef std::shared_ptr<PtmSampleScan> PtmSampleScanSp;
+
+
+class PtmSampleScan
+{
+public:
+        PtmSampleScan();
+    PtmSampleScan(const PtmSampleScan& other);
+    ~PtmSampleScan();
+    
+private:
+    std::vector<const PeptideMatch *> _peptide_match_list;
+
+};
+
+#endif // PTMSAMPLESCAN_H
-- 
GitLab