diff --git a/src/core/proteinmatch.cpp b/src/core/proteinmatch.cpp index 4a148b4aebd552063f0f9a5c423ddbed0eb97888..de37d4906cd28034b396fe8dfe7e4caa9405e390 100644 --- a/src/core/proteinmatch.cpp +++ b/src/core/proteinmatch.cpp @@ -188,7 +188,6 @@ unsigned int ProteinMatch::countValidAndCheckedPeptide(const pappso::MsRunId * p return sequence_list.size(); } - unsigned int ProteinMatch::countValidAndCheckedPeptideMassCharge(const pappso::MsRunIdSp & sp_msrun_id) const { std::set<QString> sequence_list; for (auto & p_peptide_match : _peptide_match_list) { diff --git a/src/grouping/groupinggroup.cpp b/src/grouping/groupinggroup.cpp index 51806a76b5e14c4739d292227df23bab3689f847..702aea18bd2568b38a315fd466969c779b4417d2 100644 --- a/src/grouping/groupinggroup.cpp +++ b/src/grouping/groupinggroup.cpp @@ -24,6 +24,8 @@ #include "groupinggroup.h" #include <core/proteinmatch.h> #include <core/peptidematch.h> +#include <pappsomspp/grouping/grppeptide.h> +#include <pappsomspp/utils.h> #include <set> GroupingGroup::GroupingGroup() @@ -39,6 +41,39 @@ unsigned int GroupingGroup::getNumberOfSubgroups() const { return _number_of_subgroup; } +const QStringList GroupingGroup::getSubgroupIdList(const PeptideMatch * p_peptide_match) const { + std::set<unsigned int> subgroup_list; + pappso::GrpPeptide * p_grp_peptide = p_peptide_match->getGrpPeptideSp().get(); + if (p_grp_peptide != nullptr) { + for (auto && pair_peptide_match :_pair_sg_number_peptide_match_list) { + if(pair_peptide_match.second->getGrpPeptideSp().get() == p_grp_peptide) { + subgroup_list.insert(pair_peptide_match.first); + } + } + } + + + QStringList sg_str_list; + for (unsigned int sgnum : subgroup_list) { + sg_str_list << QString("%1%2").arg(pappso::Utils::getLexicalOrderedString(_group_number)).arg(pappso::Utils::getLexicalOrderedString(sgnum)); + } + return sg_str_list; + +} + +unsigned int GroupingGroup::countSubgroupPresence(const PeptideMatch * p_peptide_match) const { + std::set<unsigned int> subgroup_list; + pappso::GrpPeptide * p_grp_peptide = p_peptide_match->getGrpPeptideSp().get(); + if (p_grp_peptide != nullptr) { + for (auto && pair_peptide_match :_pair_sg_number_peptide_match_list) { + if(pair_peptide_match.second->getGrpPeptideSp().get() == p_grp_peptide) { + subgroup_list.insert(pair_peptide_match.first); + } + } + } + return subgroup_list.size(); +} + std::size_t GroupingGroup::countSpecificSpectrum(const ProteinMatch * p_protein_match) const { if (_number_of_subgroup == 1) { return p_protein_match->countValidAndCheckedSpectrum(); @@ -96,7 +131,7 @@ std::size_t GroupingGroup::countSpecificSequence(const ProteinMatch * p_protein_ } void GroupingGroup::add(const ProteinMatch * p_protein_match) { - +_group_number = p_protein_match->getGrpProteinSp().get()->getGroupNumber(); if (p_protein_match->getGrpProteinSp().get()->getRank() == 1) { _number_of_subgroup++; unsigned int sg_number = p_protein_match->getGrpProteinSp().get()->getSubGroupNumber(); diff --git a/src/grouping/groupinggroup.h b/src/grouping/groupinggroup.h index b8bb3befbea612480bdf893382b9c3b97f16b2cd..9a48d76ddaac787dde7a722a1d7e1d07c89a907e 100644 --- a/src/grouping/groupinggroup.h +++ b/src/grouping/groupinggroup.h @@ -26,6 +26,7 @@ #include <memory> #include <vector> +#include <QStringList> class ProteinMatch; class PeptideMatch; @@ -45,7 +46,18 @@ public: std::size_t countSpecificSequence(const ProteinMatch * p_protein_match) const; unsigned int getNumberOfSubgroups() const; + + /** @brief count number of subgroups in which this peptide is present + * */ + unsigned int countSubgroupPresence(const PeptideMatch * p_peptide_match) const; + + /** @brief subgroup identifier list in which this peptide is present + * */ + const QStringList getSubgroupIdList(const PeptideMatch * p_peptide_match) const; + + private : + unsigned int _group_number=0; unsigned int _number_of_subgroup=0; std::vector<std::pair<unsigned int, const PeptideMatch *>> _pair_sg_number_peptide_match_list; }; diff --git a/src/gui/peptide_list_view/peptidetablemodel.cpp b/src/gui/peptide_list_view/peptidetablemodel.cpp index a78ba8f83df979f5fd6dc0f2b7f34ed5a0503d2f..6ea9dc20a35221af58a95952367d5d9bb4034e2c 100644 --- a/src/gui/peptide_list_view/peptidetablemodel.cpp +++ b/src/gui/peptide_list_view/peptidetablemodel.cpp @@ -98,7 +98,7 @@ int PeptideTableModel::rowCount(const QModelIndex &parent ) const { return 0; } int PeptideTableModel::columnCount(const QModelIndex &parent ) const { - return 10; + return 13; } QVariant PeptideTableModel::headerData(int section, Qt::Orientation orientation, int role) const { @@ -127,6 +127,12 @@ QVariant PeptideTableModel::headerData(int section, Qt::Orientation orientation, return QString("start"); case 9: return QString("length"); + case 10: + return QString("used"); + case 11: + return QString("subgroups"); + case 12: + return QString("Evalue"); } } } @@ -162,6 +168,7 @@ QVariant PeptideTableModel::data(const QModelIndex &index, int role ) const { if (_p_protein_match == nullptr) { } else { + if (col == 0) { return QVariant(); } @@ -190,9 +197,23 @@ QVariant PeptideTableModel::data(const QModelIndex &index, int role ) const { } if (col ==8) { return QVariant((qreal) _p_protein_match->getPeptideMatchList().at(row)->getStart()+1); - }if (col ==9) { + } + if (col ==9) { return QVariant((qreal) _p_protein_match->getPeptideMatchList().at(row)->getPeptideXtpSp().get()->size()); + }if (col ==10) { + GroupingGroup * p_grp = _p_protein_match->getGroupingGroupSp().get(); + if (p_grp != nullptr) return QVariant((qreal) p_grp->countSubgroupPresence(_p_protein_match->getPeptideMatchList().at(row))); + return QVariant(); + } + if (col ==11) { + GroupingGroup * p_grp = _p_protein_match->getGroupingGroupSp().get(); + if (p_grp != nullptr) return QVariant( p_grp->getSubgroupIdList(_p_protein_match->getPeptideMatchList().at(row)).join(" ")); + return QVariant(); + } + if (col ==12) { + return QVariant((qreal) _p_protein_match->getPeptideMatchList().at(row)->getEvalue()); } + } return QString("Row%1, Column%2") .arg(index.row() + 1)