From a5d34b968ab9beee8713a424af654b5c39c988cb Mon Sep 17 00:00:00 2001 From: Olivier Langella <Olivier.Langella@moulon.inra.fr> Date: Fri, 7 Apr 2017 09:04:49 +0200 Subject: [PATCH] debian directory --- debian/changelog | 0 debian/compat | 1 + debian/control | 16 ++++ debian/control.cmake | 16 ++++ debian/copyright | 7 ++ debian/rules | 82 +++++++++++++++++++ debian/xtpcpp.install | 2 + .../protein_list_view/proteintablemodel.cpp | 52 ++++++++---- src/gui/protein_list_view/proteintablemodel.h | 4 + src/utils/types.h | 19 +++++ 10 files changed, 181 insertions(+), 18 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/control.cmake create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/xtpcpp.install diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..e69de29bb diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..0040eb756 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: xtpcpp +Maintainer: Olivier Langella <Olivier.Langella@moulon.inra.fr> +Homepage: http://pappso.inra.fr/bioinfo +Section: libs +Priority: optional +Build-Depends: debhelper (>= 9), cmake (>= 2.6), libqt4-dev (>= 4.8), libpappsomspp-dev (= 0.2.32-3), libpwiz-dev, libodsstream-dev +Standards-Version: 3.9.4 + +Package: xtpcpp +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends}, libpappsomspp-qt4 (= 0.2.32-3), libpwiz3, + libodsstream-qt4, libqt4-gui, libqt4-svg, libqt4-xml +Pre-Depends: ${misc:Pre-Depends} +Description: C++ version of X!TandemPipeline diff --git a/debian/control.cmake b/debian/control.cmake new file mode 100644 index 000000000..77d5b7ba6 --- /dev/null +++ b/debian/control.cmake @@ -0,0 +1,16 @@ +Source: xtpcpp +Maintainer: Olivier Langella <Olivier.Langella@moulon.inra.fr> +Homepage: http://pappso.inra.fr/bioinfo +Section: libs +Priority: optional +Build-Depends: debhelper (>= 9), cmake (>= 2.6), libqt4-dev (>= 4.8), libpappsomspp-dev (= @LIBPAPPSOMSPP_VERSION@), libpwiz-dev, libodsstream-dev +Standards-Version: 3.9.4 + +Package: xtpcpp +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends}, libpappsomspp-qt4 (= @LIBPAPPSOMSPP_VERSION@), libpwiz3, + libodsstream-qt4, libqt4-gui, libqt4-svg, libqt4-xml +Pre-Depends: ${misc:Pre-Depends} +Description: C++ version of X!TandemPipeline diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..142f7326f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,7 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: xtpcpp +Source: https://sourcesup.renater.fr/projects/xtandempipeline/ + +Files: * +Copyright: Olivier Langella <Olivier.Langella@moulon.inra.fr> +License: GPL-3.0+ diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..f3f4eaaae --- /dev/null +++ b/debian/rules @@ -0,0 +1,82 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export DESTDIR=$(CURDIR)/debian/tmp + +#%: +# dh $@ --buildsystem=cmake --parallel + +configure: configure-stamp +configure-stamp: + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release . + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #$(MAKE) doc + #docbook-to-man debian/beads.sgml > beads.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp CMakeCache.txt + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + $(MAKE) DESTDIR=$(DESTDIR) install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install --sourcedir=$(DESTDIR) --list-missing +# dh_install + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/xtpcpp.install b/debian/xtpcpp.install new file mode 100644 index 000000000..d4c8f6803 --- /dev/null +++ b/debian/xtpcpp.install @@ -0,0 +1,2 @@ +usr/bin/xtpcpp +usr/share/applications/xtpcpp.desktop diff --git a/src/gui/protein_list_view/proteintablemodel.cpp b/src/gui/protein_list_view/proteintablemodel.cpp index f09913a09..85b9831b8 100644 --- a/src/gui/protein_list_view/proteintablemodel.cpp +++ b/src/gui/protein_list_view/proteintablemodel.cpp @@ -28,6 +28,21 @@ #include <QDebug> #include <pappsomspp/pappsoexception.h> #include "proteinlistwindow.h" +#include "../../utils/types.h" + +ProteinTableModel::columnMap ProteinTableModel::_column_assignment = { + (std::int8_t)ProteinListColumn::checked, + (std::int8_t)ProteinListColumn::group, + (std::int8_t)ProteinListColumn::accession, + (std::int8_t)ProteinListColumn::description, + (std::int8_t)ProteinListColumn::evalue, + (std::int8_t)ProteinListColumn::spectrum, + (std::int8_t)ProteinListColumn::specific_spectrum, + (std::int8_t)ProteinListColumn::sequence, + (std::int8_t)ProteinListColumn::specific_sequence, + (std::int8_t)ProteinListColumn::coverage, + (std::int8_t)ProteinListColumn::pai, +}; IdentificationGroup * ProteinTableModel::getIdentificationGroup() { return _p_identification_group; @@ -132,54 +147,55 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const { if (_p_identification_group == nullptr) { return QVariant(); } - if (col == 0) { + switch (_column_assignment[col]) { + case (std::int8_t)ProteinListColumn::checked: return QVariant(); - } + break; - if (col == 1) { + case (std::int8_t)ProteinListColumn::group: pappso::GrpProtein * p_grp_prot = _p_identification_group->getProteinMatchList().at(row)->getGrpProteinSp().get(); if (p_grp_prot != nullptr) return p_grp_prot->getGroupingId(); return QVariant(); + break; } - - if (col == 2) { - return _p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getAccession(); + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::accession ) { + return QVariant(_p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getAccession()); } - if (col == 3) { - return _p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getDescription(); + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::description ) { + return _p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getDescription(); } - if (col == 4) { + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::evalue ) { return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getEvalue()); - } - - if (col == 5) {//spectrum + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::spectrum ) { return QVariant ((qreal) _p_identification_group->getProteinMatchList().at(row)->countValidAndCheckedSpectrum()); } - if (col == 6) {//specific + + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::specific_spectrum ) { GroupingGroup * p_groupin_group = _p_identification_group->getProteinMatchList().at(row)->getGroupingGroupSp().get(); if (p_groupin_group != nullptr) { return QVariant ((qreal) p_groupin_group->countSpecificSpectrum(_p_identification_group->getProteinMatchList().at(row))); } } - if (col == 7) {//sequence + + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::sequence ) { return QVariant ((qreal) _p_identification_group->getProteinMatchList().at(row)->countUniqueSequence()); } - if (col == 8) {//specific sequence + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::specific_sequence ) { GroupingGroup * p_groupin_group = _p_identification_group->getProteinMatchList().at(row)->getGroupingGroupSp().get(); if (p_groupin_group != nullptr) { return QVariant ((qreal) p_groupin_group->countSpecificSequence(_p_identification_group->getProteinMatchList().at(row))); } } - if (col == 9) { + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::coverage ) { return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getCoverage()); } - if (col == 10) { + + if (_column_assignment[col] == (std::int8_t) ProteinListColumn::pai ) { return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getPAI()); } - return QVariant(); } return QVariant(); diff --git a/src/gui/protein_list_view/proteintablemodel.h b/src/gui/protein_list_view/proteintablemodel.h index ecb7aafbc..17f3b5d38 100644 --- a/src/gui/protein_list_view/proteintablemodel.h +++ b/src/gui/protein_list_view/proteintablemodel.h @@ -45,6 +45,8 @@ public: void setIdentificationGroup(IdentificationGroup * p_identification_group); IdentificationGroup * getIdentificationGroup(); + using columnMap = std::int8_t[20]; + public slots: void onProteinDataChanged(); private : @@ -53,6 +55,8 @@ private : IdentificationGroup * _p_identification_group = nullptr; ProteinListWindow * _p_protein_list_window; QStringList _columns; + + static columnMap _column_assignment; }; #endif // PROTEINTABLEMODEL_H diff --git a/src/utils/types.h b/src/utils/types.h index bc7c3b7f7..3bf0931e2 100644 --- a/src/utils/types.h +++ b/src/utils/types.h @@ -36,4 +36,23 @@ enum class GroupingType { SampleScan ///< X!TandemPipeline algo }; + +/** \def ProteinListColumn list of available fields to display in protein list + * + */ + +enum class ProteinListColumn { + checked, ///< manual checked + group, ///< group id + accession, ///< accession + description, ///< protein description + evalue, ///< Evalue + spectrum, ///< spectrum count + specific_spectrum, ///< specific spectrum count + sequence, ///< unique sequence count + specific_sequence, ///< specific unique sequence + coverage, ///< protein coverage + pai, ///< PAI +}; + #endif /* _TYPES_H_ */ -- GitLab