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

new grouping API

parent 9fe2407e
No related branches found
No related tags found
No related merge requests found
......@@ -28,11 +28,11 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} ${Qt5
#sudo apt-get install libpappsomspp-dev
FIND_PACKAGE( Pappsomspp REQUIRED )
#FIND_PACKAGE( Pappsomspp REQUIRED )
#SET (PAPPSOMSPP_DIR "/home/olivier/eclipse/git/pappsomspp")
# SET (PAPPSOMSPP_DIR "/home/langella/developpement/git/pappsomspp")
#SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
#SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/build/src/libpappsomspp-qt4.so")
SET (PAPPSOMSPP_DIR "/home/langella/developpement/git/pappsomspp")
SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/cbuild/src/libpappsomspp-qt4.so")
INCLUDE_DIRECTORIES( ${PAPPSOMSPP_INCLUDE_DIR} )
......
......@@ -32,7 +32,7 @@ void PeptideMatch::updateAutomaticFilters(const AutomaticFilterParameters & auto
_proxy_valid = false;
if (_evalue <= automatic_filter_parameters.getFilterPeptideEvalue()) {
_proxy_valid = true;
_proxy_valid = true;
}
}
void PeptideMatch::setRetentionTime(pappso::pappso_double rt) {
......@@ -70,7 +70,7 @@ bool PeptideMatch::isChecked() const {
return _checked;
}
bool PeptideMatch::isValidAndChecked() const{
bool PeptideMatch::isValidAndChecked() const {
return _proxy_valid && _checked;
}
void PeptideMatch::setIdentificationDataSource(IdentificationDataSource* identification_source) {
......@@ -89,10 +89,17 @@ unsigned int PeptideMatch::getCharge() const {
return _charge;
}
pappso::PeptideSp PeptideMatch::getPeptideSp() const {
const pappso::PeptideSp & PeptideMatch::getPeptideSp() const {
return _peptide_sp;
}
const pappso::MsRunIdSp & PeptideMatch::getMsRunIdSp() const {
return _msrunid_sp;
}
\ No newline at end of file
return _msrunid_sp;
}
void PeptideMatch::setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide) {
_sp_grp_peptide =sp_grp_peptide;
}
const pappso::GrpPeptideSp & PeptideMatch::getGrpPeptideSp() const {
return _sp_grp_peptide;
}
\ No newline at end of file
......@@ -29,6 +29,8 @@
#include "identification_sources/identificationdatasource.h"
#include "automaticfilterparameters.h"
#include "../grouping/groupingexperiment.h"
class PeptideMatch
{
public :
......@@ -51,8 +53,11 @@ public :
unsigned int getScan() const;
pappso::pappso_double getRetentionTime() const;
unsigned int getCharge() const;
pappso::PeptideSp getPeptideSp() const;
const pappso::PeptideSp & getPeptideSp() const;
pappso::pappso_double getEvalue() const;
void setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide);
const pappso::GrpPeptideSp & getGrpPeptideSp() const;
/** @brief validate or invalidate peptides and proteins based automatic filters and manual checks
* */
......@@ -61,6 +66,7 @@ public :
private :
pappso::MsRunIdSp _msrunid_sp;
unsigned int _scan;
pappso::GrpPeptideSp _sp_grp_peptide;
pappso::PeptideSp _peptide_sp;
pappso::pappso_double _rt;
pappso::pappso_double _evalue;
......
......@@ -118,7 +118,7 @@ void ProteinMatch::setGroupingExperiment(GroupingExperiment * p_grp_experiment)
for (auto & p_peptide_match : _peptide_match_list) {
if (p_peptide_match->isValidAndChecked()) {
p_grp_experiment->setGrpPeptide(_sp_grp_protein, p_peptide_match);
p_peptide_match->setGrpPeptideSp(p_grp_experiment->setGrpPeptide(_sp_grp_protein, p_peptide_match));
}
}
}
......
......@@ -39,8 +39,8 @@ public:
static GroupingExperiment * newInstance(const GroupingType & grouping_type);
virtual pappso::GrpProteinSp getGrpProteinSp(ProteinMatch* p_protein_match) = 0;
virtual void setGrpPeptide(pappso::GrpProteinSp proteinSp, PeptideMatch* p_peptide_match) = 0;
virtual pappso::GrpProteinSp & getGrpProteinSp(ProteinMatch* p_protein_match) = 0;
virtual pappso::GrpPeptideSp & setGrpPeptide(pappso::GrpProteinSp proteinSp, PeptideMatch* p_peptide_match) = 0;
virtual void startGrouping()= 0;
};
......
......@@ -29,7 +29,7 @@ GroupingPeptideMass::GroupingPeptideMass()
{
_p_monitor = new pappso::GrpGroupingMonitor();
_p_grp_experiment = new pappso::GrpExperiment(*_p_monitor);
_p_grp_experiment = new pappso::GrpExperiment(_p_monitor);
}
......@@ -39,12 +39,12 @@ GroupingPeptideMass::~GroupingPeptideMass()
delete _p_monitor;
}
pappso::GrpProteinSp GroupingPeptideMass::getGrpProteinSp(ProteinMatch* p_protein_match) {
pappso::GrpProteinSp & GroupingPeptideMass::getGrpProteinSp(ProteinMatch* p_protein_match) {
return _p_grp_experiment->getGrpProteinSp(p_protein_match->getProteinXtpSp().get()->getAccession(),p_protein_match->getProteinXtpSp().get()->getDescription());
}
void GroupingPeptideMass::setGrpPeptide(pappso::GrpProteinSp proteinSp, PeptideMatch* p_peptide_match) {
pappso::GrpPeptideSp & GroupingPeptideMass::setGrpPeptide(pappso::GrpProteinSp proteinSp, PeptideMatch* p_peptide_match) {
_p_grp_experiment->setGrpPeptide(proteinSp,p_peptide_match->getPeptideSp().get()->getSequence(), p_peptide_match->getPeptideSp().get()->getMass());
return _p_grp_experiment->setGrpPeptide(proteinSp,p_peptide_match->getPeptideSp().get()->getSequence(), p_peptide_match->getPeptideSp().get()->getMass());
}
void GroupingPeptideMass::startGrouping() {
......
......@@ -32,8 +32,8 @@ public:
virtual ~GroupingPeptideMass();
virtual pappso::GrpProteinSp getGrpProteinSp(ProteinMatch* p_protein_match) override;
virtual void setGrpPeptide(pappso::GrpProteinSp proteinSp, PeptideMatch* p_peptide_match) override;
virtual pappso::GrpProteinSp & getGrpProteinSp(ProteinMatch* p_protein_match) override;
virtual pappso::GrpPeptideSp & setGrpPeptide(pappso::GrpProteinSp proteinSp, PeptideMatch* p_peptide_match) override;
virtual void startGrouping() override;
protected :
......
......@@ -95,7 +95,7 @@ int PeptideTableModel::rowCount(const QModelIndex &parent ) const {
return 0;
}
int PeptideTableModel::columnCount(const QModelIndex &parent ) const {
return 6;
return 7;
}
QVariant PeptideTableModel::headerData(int section, Qt::Orientation orientation, int role) const
{
......@@ -107,14 +107,16 @@ QVariant PeptideTableModel::headerData(int section, Qt::Orientation orientation,
case 0:
return QString("checked");
case 1:
return QString("sample");
return QString("peptide ID");
case 2:
return QString("scan");
return QString("sample");
case 3:
return QString("RT");
return QString("scan");
case 4:
return QString("charge");
return QString("RT");
case 5:
return QString("charge");
case 6:
return QString("sequence");
}
}
......@@ -152,15 +154,18 @@ QVariant PeptideTableModel::data(const QModelIndex &index, int role ) const {
return _p_protein_match->getPeptideMatchList().at(row)->getIdentificationDataSource()->getResourceName();
}
if (col == 2) {
return QVariant ((quint16) _p_protein_match->getPeptideMatchList().at(row)->getScan());
return _p_protein_match->getPeptideMatchList().at(row)->getIdentificationDataSource()->getResourceName();
}
if (col == 3) {
return QVariant ((qreal) _p_protein_match->getPeptideMatchList().at(row)->getRetentionTime());
return QVariant ((quint16) _p_protein_match->getPeptideMatchList().at(row)->getScan());
}
if (col == 4) {
return QVariant ((quint8) _p_protein_match->getPeptideMatchList().at(row)->getCharge());
return QVariant ((qreal) _p_protein_match->getPeptideMatchList().at(row)->getRetentionTime());
}
if (col == 5) {
return QVariant ((quint8) _p_protein_match->getPeptideMatchList().at(row)->getCharge());
}
if (col ==6) {
return _p_protein_match->getPeptideMatchList().at(row)->getPeptideSp().get()->getSequence();
}
}
......
......@@ -126,7 +126,7 @@ int ProteinTableModel::rowCount(const QModelIndex &parent ) const {
return 0;
}
int ProteinTableModel::columnCount(const QModelIndex &parent ) const {
return 4;
return 5;
}
QVariant ProteinTableModel::headerData(int section, Qt::Orientation orientation, int role) const
{
......
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