diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0bef08e37d57e76da690b1e96044e4c6edac53a5..f3044829ae69381cbd39c5db07046b3d6a5c3511 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 e4d78b800e90e701d8f85174c4f9ab9b30d80859..0e36c7d101b2a3745bf42aa999d8df5f345f43b1 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 73a8b06b8f6b486842672ab22a3e43a4d35de5d0..c27f9cf391c1cdd9fef671ea0fb78ea921cfbc9a 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 5def9ba76b9c8015595b8afb2b30ac0166a1ecf1..a4c74bee8669103e8025f4f77da1b2397ba2caeb 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 c366808adac7220fd871df78bb924f4b63e45fb2..ddfc5c3659531d0da624a91f957e0b6fa0614aea 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 0000000000000000000000000000000000000000..f4e36b620d99e040e64c517641cf3cd087a89430 --- /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 0000000000000000000000000000000000000000..6ed33b3b5b5cc24a50f4618861f86a8ebd24e998 --- /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