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

WIP: search on modifications

parent 3aa07c3f
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,11 @@
<string>group</string>
</property>
</item>
<item>
<property name="text">
<string>modifications</string>
</property>
</item>
<item>
<property name="text">
<string>msrun/scan</string>
......@@ -106,6 +111,9 @@
<item>
<widget class="QLineEdit" name="protein_search_edit"/>
</item>
<item>
<widget class="QLineEdit" name="mod_auto_completion"/>
</item>
<item>
<widget class="QLineEdit" name="msrun_auto_completion"/>
</item>
......@@ -246,6 +254,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>mod_auto_completion</sender>
<signal>textChanged(QString)</signal>
<receiver>ProteinView</receiver>
<slot>doModificationSearch(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>417</x>
<y>350</y>
</hint>
<hint type="destinationlabel">
<x>999</x>
<y>408</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>doNotValidHide(bool)</slot>
......@@ -255,5 +279,6 @@
<slot>doSearchOn(QString)</slot>
<slot>doMsrunFileSearch(QString)</slot>
<slot>doScanNumberSearch(int)</slot>
<slot>doModificationSearch(QString)</slot>
</slots>
</ui>
......@@ -103,6 +103,7 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
ui->scan_number_edit->setVisible(false);
ui->msrun_auto_completion->setVisible(false);
ui->mod_auto_completion->setVisible(false);
ui->protein_search_edit->setVisible(true);
#if QT_VERSION >= 0x050000
......@@ -225,17 +226,22 @@ void ProteinListWindow::doNotGroupedHide(bool hide) {
void ProteinListWindow::doSearchOn(QString search_on) {
qDebug() << "ProteinTableProxyModel::doSearchOn begin " << search_on;
_p_proxy_model->setSearchOn( search_on);
ui->mod_auto_completion->setVisible(false);
ui->scan_number_edit->setVisible(false);
ui->msrun_auto_completion->setVisible(false);
ui->protein_search_edit->setVisible(false);
if (search_on == "msrun/scan" ) {
qDebug() << "ProteinTableProxyModel::doSearchOn visible " << search_on;
ui->scan_number_edit->setVisible(true);
ui->msrun_auto_completion->setVisible(true);
ui->protein_search_edit->setVisible(false);
} else if (search_on == "modifications" ) {
qDebug() << "ProteinTableProxyModel::doSearchOn visible " << search_on;
ui->mod_auto_completion->setVisible(true);
}
else {
qDebug() << "ProteinTableProxyModel::doSearchOn hidden " << search_on;
ui->scan_number_edit->setVisible(false);
ui->msrun_auto_completion->setVisible(false);
ui->protein_search_edit->setVisible(true);
}
......@@ -247,6 +253,9 @@ void ProteinListWindow::doMsrunFileSearch(QString msr_run_file_search) {
emit proteinDataChanged();
}
void ProteinListWindow::doModificationSearch(QString mod_search) {
emit proteinDataChanged();
}
void ProteinListWindow::doScanNumberSearch(int scan_num) {
emit proteinDataChanged();
}
......@@ -295,6 +304,19 @@ void ProteinListWindow::setIdentificationGroup(IdentificationGroup * p_identific
ui->msrun_auto_completion->setCompleter(completer);
QStringList mod_list;
for (pappso::AaModificationP mod :_project_window->getProjectP()->getPeptideStore().getModificationCollection()) {
mod_list << QString("[%1] %2 %3").arg(mod->getAccession()).arg(mod->getName()).arg(mod->getMass());
//qDebug() << "ProteinListWindow::setIdentificationGroup " << msrun_sp.get()->getFilename();
}
completer = new QCompleter(mod_list, this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setModelSorting(QCompleter::CaseSensitivelySortedModel);
completer->setFilterMode(Qt::MatchContains);
ui->mod_auto_completion->setCompleter(completer);
}
else {
......@@ -321,3 +343,7 @@ bool ProteinListWindow::getProteinListColumnDisplay(ProteinListColumn column) co
void ProteinListWindow::resizeColumnsToContents() {
ui->tableView->resizeColumnsToContents();
}
ProjectWindow * ProteinListWindow::getProjectWindow() {
return _project_window;
}
......@@ -86,6 +86,7 @@ protected slots:
void doNotCheckedHide(bool hide);
void doNotGroupedHide(bool hide);
void doMsrunFileSearch(QString msr_run_file_search);
void doModificationSearch(QString mod_search);
void doScanNumberSearch(int scan_num);
void doProxyLayoutChanged();
void showContextMenu(const QPoint &);
......@@ -96,6 +97,7 @@ protected slots:
protected :
void askProteinDetailView(ProteinMatch * p_protein_match);
void askPeptideListView(ProteinMatch * p_protein_match);
ProjectWindow * getProjectWindow();
......
......@@ -28,6 +28,7 @@
#include "proteintableproxymodel.h"
#include "proteintablemodel.h"
#include "proteinlistwindow.h"
#include "../project_view/projectwindow.h"
ProteinTableProxyModel::ProteinTableProxyModel(ProteinListWindow * p_protein_list_window, ProteinTableModel* protein_table_model_p): QSortFilterProxyModel(protein_table_model_p)
{
......@@ -78,6 +79,27 @@ bool ProteinTableProxyModel::filterAcceptsRow(int source_row,
}
return false;
}
if (_search_on == "modifications") {
unsigned int scan_num = this->_p_protein_list_window->ui->scan_number_edit->value();
QString mod_search_string = this->_p_protein_list_window->ui->msrun_auto_completion->text();
std::vector<pappso::AaModificationP> mod_list;
for (pappso::AaModificationP mod :_p_protein_list_window->getProjectWindow()->getProjectP()->getPeptideStore().getModificationCollection()) {
if (QString("[%1] %2 %3").arg(mod->getAccession()).arg(mod->getName()).arg(mod->getMass()).contains(mod_search_string)) {
mod_list.push_back(mod);
}
//qDebug() << "ProteinListWindow::setIdentificationGroup " << msrun_sp.get()->getFilename();
}
//qDebug() << "ProteinTableProxyModel::filterAcceptsRow msrun/scan " << file_search_string << " " << scan_num;
for (const PeptideMatch & p_peptide_match: protein_match->getPeptideMatchList()) {
for (pappso::AaModificationP mod :mod_list) {
if (p_peptide_match.getPeptideEvidence()->getPeptideXtpSp().get()->getNumberOfModification(mod) > 0) {
return true;
}
}
}
return false;
}
if (!_protein_search_string.isEmpty()) {
if (_search_on == "accession") {
if (!protein_match->getProteinXtpSp().get()->getAccession().contains(_protein_search_string)) {
......
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