Skip to content
Snippets Groups Projects
Commit 7301303c authored by Olivier Langella's avatar Olivier Langella
Browse files

new columns in peptide list : used subgroup list evalue

parent 59a84019
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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();
......
......@@ -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;
};
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment