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

new protein column MW

parent b247ba33
No related branches found
No related tags found
No related merge requests found
......@@ -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 11;
return 14;
}
return 0;
}
......@@ -124,6 +124,9 @@ const QString ProteinTableModel::getTitle(std::int8_t column) {
break;
case (std::int8_t) ProteinListColumn::specific_sequence:
return "specific sequence";
case (std::int8_t) ProteinListColumn::molecular_weight:
return "MW";
break;
}
return "";
......@@ -174,6 +177,9 @@ const QString ProteinTableModel::getDescription(std::int8_t column) {
case (std::int8_t) ProteinListColumn::specific_sequence:
return "number of unique distinct peptide sequences only assigned to this protein within the group";
case (std::int8_t) ProteinListColumn::molecular_weight:
return "protein molecular weight in Dalton";
}
return "";
}
......@@ -319,6 +325,9 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
if (col == (std::int8_t) ProteinListColumn::pai ) {
return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getPAI());
}
if (col == (std::int8_t) ProteinListColumn::molecular_weight ) {
return QVariant ((qreal)_p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getMass());
}
return QVariant();
}
return QVariant();
......
......@@ -44,8 +44,9 @@ enum class ProteinListColumn: std::int8_t {
sequence=8, ///< unique sequence count
specific_sequence=9, ///< specific unique sequence
coverage=10, ///< protein coverage
pai=11, ///< PAI
empai=12, ///< emPAI
molecular_weight=11, ///< protein molecular weight in Dalton
pai=12, ///< PAI
empai=13, ///< emPAI
};
class ProteinListWindow;
......
......@@ -22,6 +22,7 @@
******************************************************************************/
#include <QDebug>
#include <QSettings>
#include <pappsomspp/pappsoexception.h>
#include "ui_protein_view.h"
#include "proteintableproxymodel.h"
......@@ -33,8 +34,10 @@ ProteinTableProxyModel::ProteinTableProxyModel(ProteinListWindow * p_protein_lis
_protein_table_model_p = protein_table_model_p;
_p_protein_list_window = p_protein_list_window;
_column_display.resize(30);
QSettings settings;
for (std::size_t i=0; i < _column_display.size(); i++) {
_column_display[i] = true;
_column_display[i] = settings.value(QString("protein_list_columns/%1").arg(_protein_table_model_p->getTitle((ProteinListColumn)i)), "true").toBool();
}
}
......@@ -240,6 +243,9 @@ void ProteinTableProxyModel::setProteinSearchString(QString protein_search_strin
void ProteinTableProxyModel::setProteinListColumnDisplay(ProteinListColumn column, bool toggled) {
qDebug() << "ProteinTableProxyModel::setProteinListColumnDisplay begin " << toggled;
beginResetModel();
QSettings settings;
settings.setValue(QString("protein_list_columns/%1").arg(_protein_table_model_p->getTitle(column)),toggled);
_column_display[(std::int8_t) column] = toggled;
endResetModel();
}
......
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