From a6e498e24c69b4a9c3d1c9a373d1a385de289960 Mon Sep 17 00:00:00 2001 From: Olivier Langella <Olivier.Langella@moulon.inra.fr> Date: Mon, 8 May 2017 23:36:37 +0200 Subject: [PATCH] WIP: sample sheet for ODS output --- src/CMakeLists.txt | 1 + src/core/project.cpp | 3 +++ src/core/project.h | 1 + src/gui/mainwindow.cpp | 3 +++ src/output/ods/odsexport.cpp | 4 +++ src/output/ods/samplesheet.cpp | 41 +++++++++++++++++++++++++++++ src/output/ods/samplesheet.h | 48 ++++++++++++++++++++++++++++++++++ 7 files changed, 101 insertions(+) create mode 100644 src/output/ods/samplesheet.cpp create mode 100644 src/output/ods/samplesheet.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0bef08e37..f3044829a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -78,6 +78,7 @@ SET(CPP_FILES output/ods/peptidepossheet.cpp output/ods/peptidesheet.cpp output/ods/proteinsheet.cpp + output/ods/samplesheet.cpp output/ods/simplesheet.cpp output/ods/spectrasheet.cpp utils/fastafilestore.cpp diff --git a/src/core/project.cpp b/src/core/project.cpp index e4d78b800..0e36c7d10 100644 --- a/src/core/project.cpp +++ b/src/core/project.cpp @@ -71,6 +71,9 @@ FastaFileStore & Project::getFastaFileStore() { MsRunStore & Project::getMsRunStore() { return _msrun_store; } +const MsRunStore & Project::getMsRunStore() const { + return _msrun_store; +} PeptideStore & Project::getPeptideStore() { return _peptide_store; } diff --git a/src/core/project.h b/src/core/project.h index 73a8b06b8..c27f9cf39 100644 --- a/src/core/project.h +++ b/src/core/project.h @@ -48,6 +48,7 @@ public: ProteinStore & getProteinStore(); PeptideStore & getPeptideStore(); MsRunStore & getMsRunStore(); + const MsRunStore & getMsRunStore() const; FastaFileStore & getFastaFileStore(); IdentificationDataSourceStore & getIdentificationDataSourceStore(); void readXpipFile(QFileInfo xpip_source); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 5def9ba76..a4c74bee8 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -93,6 +93,9 @@ MainWindow::~MainWindow() //if (_p_ms_data_file != nullptr) delete _p_ms_data_file; delete ui; delete _project_window; + delete _p_load_results_dialog; + delete _p_export_spreadsheet_dialog; + delete _p_waiting_message_dialog; } diff --git a/src/output/ods/odsexport.cpp b/src/output/ods/odsexport.cpp index c366808ad..ddfc5c365 100644 --- a/src/output/ods/odsexport.cpp +++ b/src/output/ods/odsexport.cpp @@ -36,6 +36,7 @@ #include "comparspectrasheet.h" #include "comparspecificspectrasheet.h" #include "infosheet.h" +#include "samplesheet.h" #include <QSettings> OdsExport::OdsExport(const Project * project):_p_project(project) { @@ -94,4 +95,7 @@ void OdsExport::write(CalcWriterInterface * p_writer) { if (settings.value("export_ods/comparempai", "true").toBool()) { ComparEmpaiSheet(this, p_writer, _p_project).writeSheet(); } + if (settings.value("export_ods/samples", "true").toBool()) { + SampleSheet(this, p_writer, _p_project); + } } diff --git a/src/output/ods/samplesheet.cpp b/src/output/ods/samplesheet.cpp new file mode 100644 index 000000000..f4e36b620 --- /dev/null +++ b/src/output/ods/samplesheet.cpp @@ -0,0 +1,41 @@ +/** + * \file /output/samplesheet.cpp + * \date 8/5/2017 + * \author Olivier Langella + * \brief ODS sample sheet + */ + +/******************************************************************************* +* 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 "samplesheet.h" + +SampleSheet::SampleSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) { + _p_writer = p_writer; + _p_ods_export = p_ods_export; + p_writer->writeSheet("samples"); + + std::vector<MsRunSp> msrun_list = _p_project->getMsRunStore().getMsRunList(); + + for (MsRunSp msrun_sp: msrun_list) { + } +} diff --git a/src/output/ods/samplesheet.h b/src/output/ods/samplesheet.h new file mode 100644 index 000000000..6ed33b3b5 --- /dev/null +++ b/src/output/ods/samplesheet.h @@ -0,0 +1,48 @@ +/** + * \file /output/samplesheet.h + * \date 8/5/2017 + * \author Olivier Langella + * \brief ODS sample sheet + */ + +/******************************************************************************* +* 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 SAMPLESHEET_H +#define SAMPLESHEET_H + +#include "../../core/project.h" +#include <odsstream/calcwriterinterface.h> +#include "odsexport.h" + +class SampleSheet +{ +public : + SampleSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project); + +private : + OdsExport * _p_ods_export; + const Project * _p_project; + CalcWriterInterface * _p_writer; +}; + +#endif // SAMPLESHEET_H -- GitLab