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

first protein search

parent 9a5ebc02
No related branches found
No related tags found
No related merge requests found
...@@ -11,10 +11,17 @@ ...@@ -11,10 +11,17 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Protein list</string> <string>Peptide list</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="proteinLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QTableView" name="tableView"/> <widget class="QTableView" name="tableView"/>
</item> </item>
...@@ -26,7 +33,7 @@ ...@@ -26,7 +33,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>826</width> <width>826</width>
<height>19</height> <height>31</height>
</rect> </rect>
</property> </property>
</widget> </widget>
......
...@@ -73,6 +73,7 @@ PeptideListWindow::~PeptideListWindow() ...@@ -73,6 +73,7 @@ PeptideListWindow::~PeptideListWindow()
void PeptideListWindow::setProteinMatch(Project * p_project, ProteinMatch * p_protein_match) { void PeptideListWindow::setProteinMatch(Project * p_project, ProteinMatch * p_protein_match) {
_peptide_table_model_p->setProteinMatch(p_project, p_protein_match); _peptide_table_model_p->setProteinMatch(p_project, p_protein_match);
_p_proxy_model->setSourceModel(_peptide_table_model_p); _p_proxy_model->setSourceModel(_peptide_table_model_p);
ui->proteinLabel->setText(p_protein_match->getProteinSp().get()->getDescription());
} }
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
<item> <item>
<widget class="QTableView" name="tableView"/> <widget class="QTableView" name="tableView"/>
</item> </item>
<item>
<widget class="QLineEdit" name="proteinSearchEdit"/>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">
...@@ -26,7 +29,7 @@ ...@@ -26,7 +29,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>826</width> <width>826</width>
<height>19</height> <height>31</height>
</rect> </rect>
</property> </property>
</widget> </widget>
......
...@@ -31,22 +31,6 @@ ProteinListWindow::ProteinListWindow(QWidget *parent): ...@@ -31,22 +31,6 @@ ProteinListWindow::ProteinListWindow(QWidget *parent):
ui(new Ui::ProteinView) ui(new Ui::ProteinView)
{ {
ui->setupUi(this); ui->setupUi(this);
#if QT_VERSION >= 0x050000
// Qt5 code
/*
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &PtSpectrumViewer::operateMsDataFile, worker, &PwizLoaderThread::doMsDataFileLoad);
connect(worker, &PwizLoaderThread::msDataReady, this, &PtSpectrumViewer::handleMsDataFile);
*/
#else
// Qt4 code
/*
connect(&workerThread, SIGNAL(finished()), worker, SLOT(deleteLater()));
connect(this, SIGNAL(operateMsDataFile(QString)), worker,SLOT(doMsDataFileLoad(QString)));
connect(worker, SIGNAL(msDataReady(pwiz::msdata::MSDataFile *)), this, SLOT(handleMsDataFile(pwiz::msdata::MSDataFile *)));
*/
#endif
/* /*
*/ */
...@@ -59,7 +43,21 @@ ProteinListWindow::ProteinListWindow(QWidget *parent): ...@@ -59,7 +43,21 @@ ProteinListWindow::ProteinListWindow(QWidget *parent):
ui->tableView->setModel( _p_proxy_model ); ui->tableView->setModel( _p_proxy_model );
ui->tableView->setSortingEnabled(true); ui->tableView->setSortingEnabled(true);
#if QT_VERSION >= 0x050000
// Qt5 code
/*
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &PtSpectrumViewer::operateMsDataFile, worker, &PwizLoaderThread::doMsDataFileLoad);
connect(worker, &PwizLoaderThread::msDataReady, this, &PtSpectrumViewer::handleMsDataFile);
*/
#else
// Qt4 code
connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &))); connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &)));
connect(ui->proteinSearchEdit, SIGNAL(textChanged(QString)), _protein_table_model_p, SLOT(onProteinSearchEdit(QString)));
#endif
} }
void ProteinListWindow::clickOnproteinMatch(ProteinMatch * p_protein_match) { void ProteinListWindow::clickOnproteinMatch(ProteinMatch * p_protein_match) {
......
...@@ -38,7 +38,6 @@ bool ProteinTableProxyModel::filterAcceptsRow(int source_row, ...@@ -38,7 +38,6 @@ bool ProteinTableProxyModel::filterAcceptsRow(int source_row,
return _protein_table_model_p->acceptRow(source_row); return _protein_table_model_p->acceptRow(source_row);
//return true; //return true;
} }
void ProteinTableProxyModel::onTableClicked(const QModelIndex &index) void ProteinTableProxyModel::onTableClicked(const QModelIndex &index)
{ {
qDebug() << "ProteinTableProxyModel::onTableClicked begin " << index.row(); qDebug() << "ProteinTableProxyModel::onTableClicked begin " << index.row();
...@@ -94,6 +93,14 @@ ProteinTableModel::ProteinTableModel(QObject *parent, ProteinListWindow * p_prot ...@@ -94,6 +93,14 @@ ProteinTableModel::ProteinTableModel(QObject *parent, ProteinListWindow * p_prot
} }
void ProteinTableModel::onProteinSearchEdit(QString protein_search_string) {
qDebug() << "ProteinTableModel::onProteinSearchEdit begin " << protein_search_string;
_protein_search_string = protein_search_string;
QModelIndex topLeft = createIndex(0,0);
QModelIndex bottomRight = createIndex(rowCount(),columnCount());
emit dataChanged(topLeft, bottomRight);
}
void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identification_group) { void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identification_group) {
qDebug() << "ProteinTableModel::setIdentificationGroup begin " << p_identification_group->getProteinMatchList().size(); qDebug() << "ProteinTableModel::setIdentificationGroup begin " << p_identification_group->getProteinMatchList().size();
_p_identification_group = p_identification_group; _p_identification_group = p_identification_group;
...@@ -210,7 +217,13 @@ void ProteinTableModel::onTableClicked(const QModelIndex &index) ...@@ -210,7 +217,13 @@ void ProteinTableModel::onTableClicked(const QModelIndex &index)
} }
bool ProteinTableModel::acceptRow(int source_row) { bool ProteinTableModel::acceptRow(int source_row) {
if (_p_identification_group->isValid(_p_identification_group->getProteinMatchList().at(source_row))) { ProteinMatch * protein_match = _p_identification_group->getProteinMatchList().at(source_row);
if (!_protein_search_string.isEmpty()) {
if (!protein_match->getProteinSp().get()->getDescription().contains(_protein_search_string)) {
return false;
}
}
if (_p_identification_group->isValid(protein_match)) {
return true; return true;
} }
return false; return false;
......
...@@ -66,9 +66,11 @@ public: ...@@ -66,9 +66,11 @@ public:
public slots: public slots:
void onTableClicked(const QModelIndex &index); void onTableClicked(const QModelIndex &index);
void onProteinSearchEdit(QString protein_search_string);
private : private :
IdentificationGroup * _p_identification_group = nullptr; IdentificationGroup * _p_identification_group = nullptr;
ProteinListWindow * _p_protein_list_window; ProteinListWindow * _p_protein_list_window;
QString _protein_search_string;
}; };
#endif // PROTEINTABLEMODEL_H #endif // PROTEINTABLEMODEL_H
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