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

first NSAF version

parent acea4912
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,16 @@ const GroupStore & IdentificationGroup::getGroupStore() const {
return _group_store;
}
pappso::pappso_double IdentificationGroup::computeProtoNsafSum(const MsRun * p_msrun_id ) const {
pappso::pappso_double nsaf_sum = 0;
for (auto & p_protein_match : _protein_match_list) {
if (p_protein_match->getValidationState() >= ValidationState::grouped) {
nsaf_sum += p_protein_match->getProtoNsaf(p_msrun_id);
}
}
return nsaf_sum;
}
unsigned int IdentificationGroup::countPeptideMass(ValidationState state) const {
std::vector<pappso::GrpPeptide *> count_peptide_mass;
......
......@@ -54,6 +54,12 @@ public:
void addIdentificationDataSourceP(IdentificationDataSource * p_identification_source);
const PtmGroupingExperiment * getPtmGroupingExperiment() const;
/** @brief compute proto NSAF sum within msrun
* Warning: this is not NSAF, just a part
* @param p_msrun_id pointer on the msrun to get NSAF. if not defined, NSAF is computed overall msruns
* */
pappso::pappso_double computeProtoNsafSum(const MsRun * p_msrun_id = nullptr) const;
/** @brief count groups
* */
......
......@@ -325,6 +325,9 @@ pappso::pappso_double ProteinMatch::getLogEvalue(const MsRun * sp_msrun_id) cons
return (evalue_prot);
}
pappso::pappso_double ProteinMatch::getNsaf(pappso::pappso_double proto_nsaf_sum, const MsRun * p_msrun_id) const {
return (getProtoNsaf(p_msrun_id)/proto_nsaf_sum);
}
pappso::pappso_double ProteinMatch::getProtoNsaf(const MsRun * sp_msrun_id) const {
try {
......
......@@ -64,10 +64,18 @@ public:
**/
const QString getHtmlSequence(PeptideEvidence * peptide_evidence_to_locate = nullptr) const;
/** @brief compute proto NSAF within sample
/** @brief compute proto NSAF within msrun
* Warning: this is not NSAF, just a part
* @param p_msrun_id pointer on the msrun to get NSAF. if not defined, NSAF is computed overall msruns
* */
pappso::pappso_double getProtoNsaf(const MsRun * sp_msrun_id = nullptr) const;
pappso::pappso_double getProtoNsaf(const MsRun * p_msrun_id = nullptr) const;
/** @brief compute NSAF within msrun
* Warning: this is not NSAF, just a part
* @param proto_nsaf_sum the sum of proto nsaf of all proteins within the msrun
* @param p_msrun_id pointer on the msrun to get NSAF. if not defined, NSAF is computed overall msruns
* */
pappso::pappso_double getNsaf(pappso::pappso_double proto_nsaf_sum, const MsRun * p_msrun_id = nullptr) const;
/** @brief compute Protein Abundance Index (PAI) within sample
* PAI computation (Rappsilber et al. 2002)
......
......@@ -272,6 +272,9 @@ void ProteinListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_ide
if (_p_identification_group == p_identification_group) {
//_protein_table_model_p->setIdentificationGroup(p_identification_group);
//_p_proxy_model->setSourceModel(_protein_table_model_p);
//if(getProteinListColumnDisplay) {
sumProtoNsaf();
//}
emit proteinDataChanged();
}
......@@ -347,3 +350,11 @@ void ProteinListWindow::resizeColumnsToContents() {
ProjectWindow * ProteinListWindow::getProjectWindow() {
return _project_window;
}
pappso::pappso_double ProteinListWindow::getProtoNsafSum() const {
return _sum_proto_nsaf;
}
void ProteinListWindow::sumProtoNsaf() {
_sum_proto_nsaf = _p_identification_group->computeProtoNsafSum();
}
......@@ -98,6 +98,8 @@ protected :
void askProteinDetailView(ProteinMatch * p_protein_match);
void askPeptideListView(ProteinMatch * p_protein_match);
ProjectWindow * getProjectWindow();
pappso::pappso_double getProtoNsafSum() const;
void sumProtoNsaf();
......@@ -110,6 +112,7 @@ private:
QMenu * _p_context_menu = nullptr;
bool _display_evalue = true;
bool _display_accession = true;
pappso::pappso_double _sum_proto_nsaf;
};
......
......@@ -65,7 +65,7 @@ int ProteinTableModel::rowCount(const QModelIndex &parent ) const {
int ProteinTableModel::columnCount(const QModelIndex &parent ) const {
//qDebug() << "ProteinTableModel::columnCount begin ";
if (_p_identification_group != nullptr) {
return 14;
return 15;
}
return 0;
}
......@@ -127,6 +127,10 @@ const QString ProteinTableModel::getTitle(std::int8_t column) {
case (std::int8_t) ProteinListColumn::molecular_weight:
return "MW";
break;
case (std::int8_t) ProteinListColumn::nsaf:
return "NSAF";
break;
}
return "";
......@@ -180,6 +184,8 @@ const QString ProteinTableModel::getDescription(std::int8_t column) {
case (std::int8_t) ProteinListColumn::molecular_weight:
return "protein molecular weight in Dalton";
case (std::int8_t) ProteinListColumn::nsaf:
return "NSAF";
}
return "";
}
......@@ -331,6 +337,9 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
if (col == (std::int8_t) ProteinListColumn::molecular_weight ) {
return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getMass());
}
if (col == (std::int8_t) ProteinListColumn::nsaf ) {
return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getNsaf(_p_protein_list_window->getProtoNsafSum()));
}
return QVariant();
}
return QVariant();
......
......@@ -47,6 +47,7 @@ enum class ProteinListColumn: std::int8_t {
molecular_weight=11, ///< protein molecular weight in Dalton
pai=12, ///< PAI
empai=13, ///< emPAI
nsaf=14, ///< NSAF
};
class ProteinListWindow;
......
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