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

look for modifications in peptide list

parent d8cf5d71
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,11 @@
<string>peptide</string>
</property>
</item>
<item>
<property name="text">
<string>modifications</string>
</property>
</item>
<item>
<property name="text">
<string>msrun/scan</string>
......@@ -101,6 +106,9 @@
<item>
<widget class="QLineEdit" name="peptide_search_edit"/>
</item>
<item>
<widget class="QLineEdit" name="mod_auto_completion"/>
</item>
<item>
<widget class="QLineEdit" name="msrun_auto_completion"/>
</item>
......@@ -241,6 +249,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>mod_auto_completion</sender>
<signal>textChanged(QString)</signal>
<receiver>PeptideView</receiver>
<slot>doModificationSearch(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>436</x>
<y>360</y>
</hint>
<hint type="destinationlabel">
<x>699</x>
<y>506</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>doNotValidHide(bool)</slot>
......@@ -250,5 +274,6 @@
<slot>doSearchOn(QString)</slot>
<slot>doMsrunFileSearch(QString)</slot>
<slot>doScanNumberSearch(int)</slot>
<slot>doModificationSearch(QString)</slot>
</slots>
</ui>
......@@ -103,6 +103,7 @@ PeptideListWindow::PeptideListWindow(ProjectWindow *parent):
ui->scan_number_edit->setVisible(false);
ui->msrun_auto_completion->setVisible(false);
ui->mod_auto_completion->setVisible(false);
ui->peptide_search_edit->setVisible(true);
#if QT_VERSION >= 0x050000
......@@ -172,6 +173,19 @@ void PeptideListWindow::setProteinMatch(IdentificationGroup * p_identification_g
completer->setFilterMode(Qt::MatchContains);
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);
}
}
......@@ -227,6 +241,10 @@ void PeptideListWindow::doPeptideSearchEdit(QString protein_search_string) {
emit peptideDataChanged();
}
void PeptideListWindow::doModificationSearch(QString mod_search) {
//_p_proxy_model->setMsrunFileSearch(msr_run_file_search);
emit peptideDataChanged();
}
void PeptideListWindow::doMsrunFileSearch(QString msr_run_file_search) {
qDebug() << "PeptideListWindow::doMsrunFileSearch begin " << msr_run_file_search;
emit peptideDataChanged();
......@@ -239,17 +257,22 @@ void PeptideListWindow::doSearchOn(QString search_on) {
qDebug() << "PeptideListWindow::doSearchOn begin " << search_on;
_p_proxy_model->setSearchOn( search_on);
ui->scan_number_edit->setVisible(false);
ui->msrun_auto_completion->setVisible(false);
ui->peptide_search_edit->setVisible(false);
ui->mod_auto_completion->setVisible(false);
if (search_on == "msrun/scan" ) {
qDebug() << "PeptideListWindow::doSearchOn visible " << search_on;
ui->scan_number_edit->setVisible(true);
ui->msrun_auto_completion->setVisible(true);
ui->peptide_search_edit->setVisible(false);
} else if (search_on == "modifications" ) {
qDebug() << "PeptideListWindow::doSearchOn visible " << search_on;
ui->mod_auto_completion->setVisible(true);
}
else {
qDebug() << "PeptideListWindow::doSearchOn hidden " << search_on;
ui->scan_number_edit->setVisible(false);
ui->msrun_auto_completion->setVisible(false);
ui->peptide_search_edit->setVisible(true);
}
//emit proteinDataChanged();
......
......@@ -95,6 +95,7 @@ protected slots:
void doNotGroupedHide(bool hide);
void doPeptideSearchEdit(QString peptide_search_string);
void doMsrunFileSearch(QString msr_run_file_search);
void doModificationSearch(QString mod_search);
void doScanNumberSearch(int scan_num);
void doSearchOn(QString search_on);
void updateStatusBar();
......
......@@ -56,6 +56,27 @@ bool PeptideTableProxyModel::filterAcceptsRow(int source_row,
PeptideEvidence * peptide_evidence = _peptide_table_model_p->getProteinMatch()->getPeptideMatchList().at(source_row).getPeptideEvidence();
qDebug() << "PeptideTableProxyModel::filterAcceptsRow protein_match " << source_row;
qDebug() << "PeptideTableProxyModel::filterAcceptsRow valid ";
if (_hide_not_valid) {
if (! peptide_evidence->isValid()) {
return false;
}
}
qDebug() << "PeptideTableProxyModel::filterAcceptsRow checked ";
if (_hide_not_checked) {
if (! peptide_evidence->isChecked()) {
return false;
}
}
qDebug() << "PeptideTableProxyModel::filterAcceptsRow grouped ";
if (_hide_not_grouped) {
if (! peptide_evidence->isGrouped()) {
return false;
}
}
if (_search_on == "msrun/scan") {
unsigned int scan_num = this->_p_peptide_list_window->ui->scan_number_edit->value();
QString file_search_string = this->_p_peptide_list_window->ui->msrun_auto_completion->text().toLower();
......@@ -102,25 +123,24 @@ bool PeptideTableProxyModel::filterAcceptsRow(int source_row,
}
}
qDebug() << "PeptideTableProxyModel::filterAcceptsRow valid ";
if (_hide_not_valid) {
if (! peptide_evidence->isValid()) {
return false;
}
}
qDebug() << "PeptideTableProxyModel::filterAcceptsRow checked ";
if (_hide_not_checked) {
if (! peptide_evidence->isChecked()) {
return false;
}
}
qDebug() << "PeptideTableProxyModel::filterAcceptsRow grouped ";
if (_hide_not_grouped) {
if (! peptide_evidence->isGrouped()) {
return false;
}
if (_search_on == "modifications") {
QString mod_search_string = this->_p_peptide_list_window->ui->mod_auto_completion->text();
std::vector<pappso::AaModificationP> mod_list;
for (pappso::AaModificationP mod :_p_peptide_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 (pappso::AaModificationP mod :mod_list) {
if (peptide_evidence->getPeptideXtpSp().get()->getNumberOfModification(mod) > 0) {
return true;
}
}
return false;
}
return true;
}
......
......@@ -146,7 +146,6 @@ bool ProteinTableProxyModel::filterAcceptsRow(int source_row,
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->mod_auto_completion->text();
std::vector<pappso::AaModificationP> mod_list;
......
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