diff --git a/src/core/identification_sources/identificationdatasource.cpp b/src/core/identification_sources/identificationdatasource.cpp index f6c6ca64170fe05f7214bfa4e888a5ea27ded38c..d3ac590833ffbb0c432fb712a4021d235204edd7 100644 --- a/src/core/identification_sources/identificationdatasource.cpp +++ b/src/core/identification_sources/identificationdatasource.cpp @@ -21,6 +21,7 @@ * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and implementation ******************************************************************************/ #include "identificationdatasource.h" +#include <QFileInfo> IdentificationDataSource::IdentificationDataSource(pappso::MsRunIdSp & ms_run_sp) { @@ -43,6 +44,10 @@ bool IdentificationDataSource::operator==(const IdentificationDataSource& other) } +IdentificationDataSourceSp IdentificationDataSource::getInstance(const QString & location) { + QFileInfo location_file(location); + QString ext = location_file.suffix(); +} const QString & IdentificationDataSource::getResourceName () const { return _resource_name; diff --git a/src/core/identification_sources/identificationdatasource.h b/src/core/identification_sources/identificationdatasource.h index 27b995956728a32faba347cc195829281f70423e..d067a3cf61ec4641dffbb0bfdf79b927970bf008 100644 --- a/src/core/identification_sources/identificationdatasource.h +++ b/src/core/identification_sources/identificationdatasource.h @@ -25,20 +25,31 @@ #include <pappsomspp/msrun/msrunid.h> +#include <map> + + +class IdentificationDataSource; + +typedef std::shared_ptr<IdentificationDataSource> IdentificationDataSourceSp; + class IdentificationDataSource { public: + static IdentificationDataSourceSp getInstance(const QString & location); + IdentificationDataSource(pappso::MsRunIdSp & ms_run_sp); IdentificationDataSource(const IdentificationDataSource& other); ~IdentificationDataSource(); bool operator==(const IdentificationDataSource& other) const; - + const QString & getResourceName () const; pappso::MsRunIdSp getMsRunSp () const; protected : QString _resource_name; private : + static std::map<QString, IdentificationDataSource *> _map_identification_data_sources; + static std::map<QString, pappso::MsRunIdSp> _map_msrunidsp; pappso::MsRunIdSp _ms_run_sp = nullptr; }; diff --git a/src/core/peptidematch.h b/src/core/peptidematch.h index 0c04c2bb191ecfb2ceadccac2da32dc5fd6d7c39..738962240a87bc73f1b0c6ae95c855d1445d01ce 100644 --- a/src/core/peptidematch.h +++ b/src/core/peptidematch.h @@ -26,6 +26,7 @@ #include <pappsomspp/msrun/msrunid.h> #include <pappsomspp/types.h> #include <pappsomspp/peptide/peptide.h> +#include "identification_sources/identificationdatasource.h" class PeptideMatch { @@ -42,8 +43,8 @@ public : private : pappso::MsRunIdSp _msrunid_sp; - pappso::PeptideSp _peptide_sp; unsigned int _scan; + pappso::PeptideSp _peptide_sp; pappso::pappso_double _rt; pappso::pappso_double _evalue; pappso::pappso_double _exp_mass; diff --git a/src/core/spectrumid.cpp b/src/core/spectrumid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..69c68d19d352b2d747db404894bab36bb7d14bd4 --- /dev/null +++ b/src/core/spectrumid.cpp @@ -0,0 +1,24 @@ + +/******************************************************************************* +* 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 "spectrumid.h" diff --git a/src/core/spectrumid.h b/src/core/spectrumid.h new file mode 100644 index 0000000000000000000000000000000000000000..d7ea3dbbe7da249846b59dc4872e6bb2161f2266 --- /dev/null +++ b/src/core/spectrumid.h @@ -0,0 +1,41 @@ + +/******************************************************************************* +* 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 <pappsomspp/msrun/msrunid.h> + +#ifndef SPECTRUMID_H +#define SPECTRUMID_H + +class SpectrumId +{ + + +private : + SpectrumId(pappso::MsRunIdSp msrunid_sp, unsigned int scan); + +private : + pappso::MsRunIdSp _msrunid_sp; + unsigned int _scan; + +}; + +#endif // SPECTRUMID_H