Skip to content
Snippets Groups Projects
Commit e30d4639 authored by Renne Thomas's avatar Renne Thomas
Browse files

Add ExportMassChroqDialog to ms identification window

parent b2c0076b
No related branches found
No related tags found
1 merge request!30Add ExportMassChroqDialog to ms identification window
...@@ -35,7 +35,11 @@ ...@@ -35,7 +35,11 @@
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_13"> <layout class="QVBoxLayout" name="verticalLayout_13">
<item> <item>
<widget class="QListView" name="group_listView"/> <widget class="QListView" name="group_listView">
<property name="toolTip">
<string>Check which groups will be export in the masschroqml file</string>
</property>
</widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="horizontalLayout_12">
...@@ -93,7 +97,7 @@ ...@@ -93,7 +97,7 @@
<item> <item>
<widget class="QGroupBox" name="groupBox_5"> <widget class="QGroupBox" name="groupBox_5">
<property name="title"> <property name="title">
<string>Ms run in the selected group</string> <string>Ms runs in the selected group</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
......
...@@ -47,6 +47,9 @@ ExportMasschroqDialog::ExportMasschroqDialog(MainWindow *parent, ...@@ -47,6 +47,9 @@ ExportMasschroqDialog::ExportMasschroqDialog(MainWindow *parent,
ui->setupUi(this); ui->setupUi(this);
this->setModal(true); this->setModal(true);
ui->listWidget->clear();
ui->msrun_list_combo_box->clear();
ui->label_msrun_not_found->setHidden(true); ui->label_msrun_not_found->setHidden(true);
ui->toolButton_2->setHidden(true); ui->toolButton_2->setHidden(true);
ui->label_check->setHidden(true); ui->label_check->setHidden(true);
...@@ -325,19 +328,22 @@ ExportMasschroqDialog::doShowMsRunsInAlignmentGroup(QModelIndex index) ...@@ -325,19 +328,22 @@ ExportMasschroqDialog::doShowMsRunsInAlignmentGroup(QModelIndex index)
{ {
ui->listWidget->clear(); ui->listWidget->clear();
ui->msrun_list_combo_box->clear(); ui->msrun_list_combo_box->clear();
MsRunAlignmentGroupSp temp = msp_alignmentGroups.at(index.row()); MsRunAlignmentGroupSp selected_group = msp_alignmentGroups.at(index.row());
for(MsRunSp ms_run : temp->getMsRunsInAlignmentGroup()) ui->groupBox_5->setTitle("Ms runs in " +
selected_group->getMsRunAlignmentGroupName());
for(MsRunSp ms_run : selected_group->getMsRunsInAlignmentGroup())
{ {
ui->listWidget->addItem(ms_run->getSampleName()); ui->listWidget->addItem(ms_run->getSampleName());
ui->msrun_list_combo_box->addItem(ms_run->getSampleName()); ui->msrun_list_combo_box->addItem(ms_run->getSampleName());
} }
if(temp->getMsRunReference() != nullptr) if(selected_group->getMsRunReference() != nullptr)
{ {
std::list<MsRunSp>::iterator it; std::list<MsRunSp>::iterator it;
it = std::find(temp->getMsRunsInAlignmentGroup().begin(), it = std::find(selected_group->getMsRunsInAlignmentGroup().begin(),
temp->getMsRunsInAlignmentGroup().end(), selected_group->getMsRunsInAlignmentGroup().end(),
temp->getMsRunReference()); selected_group->getMsRunReference());
int idx = std::distance(temp->getMsRunsInAlignmentGroup().begin(), it); int idx =
std::distance(selected_group->getMsRunsInAlignmentGroup().begin(), it);
ui->msrun_list_combo_box->setCurrentIndex(idx); ui->msrun_list_combo_box->setCurrentIndex(idx);
} }
else else
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1084</width> <width>1084</width>
<height>24</height> <height>22</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuExport"> <widget class="QMenu" name="menuExport">
...@@ -88,12 +88,9 @@ ...@@ -88,12 +88,9 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="title"> <property name="title">
<string>&amp;Alignment</string> <string>M&amp;assChroQ</string>
</property> </property>
<addaction name="no_group_action"/> <addaction name="actionExport"/>
<addaction name="separator"/>
<addaction name="actionAll_identifications"/>
<addaction name="separator"/>
</widget> </widget>
<addaction name="menuExport"/> <addaction name="menuExport"/>
<addaction name="menuColumns"/> <addaction name="menuColumns"/>
...@@ -127,6 +124,11 @@ ...@@ -127,6 +124,11 @@
<string>&amp;All identifications</string> <string>&amp;All identifications</string>
</property> </property>
</action> </action>
<action name="actionExport">
<property name="text">
<string>Export</string>
</property>
</action>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>
...@@ -178,6 +180,22 @@ ...@@ -178,6 +180,22 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>actionExport</sender>
<signal>triggered()</signal>
<receiver>MsIdentificationView</receiver>
<slot>doMassChroQParameters()</slot>
<hints>
<hint type="sourcelabel">
<x>250</x>
<y>45</y>
</hint>
<hint type="destinationlabel">
<x>541</x>
<y>201</y>
</hint>
</hints>
</connection>
</connections> </connections>
<slots> <slots>
<slot>doNotValidHide(bool)</slot> <slot>doNotValidHide(bool)</slot>
...@@ -190,6 +208,6 @@ ...@@ -190,6 +208,6 @@
<slot>doModificationSearch(QString)</slot> <slot>doModificationSearch(QString)</slot>
<slot>doExportAsOdsFile()</slot> <slot>doExportAsOdsFile()</slot>
<slot>onMsIdentificationSearchEdit(QString)</slot> <slot>onMsIdentificationSearchEdit(QString)</slot>
<slot>doAlignmentGroupParameters(QAction*)</slot> <slot>doMassChroQParameters()</slot>
</slots> </slots>
</ui> </ui>
...@@ -134,10 +134,10 @@ MsIdentificationListWindow::MsIdentificationListWindow(ProjectWindow *parent) ...@@ -134,10 +134,10 @@ MsIdentificationListWindow::MsIdentificationListWindow(ProjectWindow *parent)
&MsIdentificationTableModel::projectStatusChanged, &MsIdentificationTableModel::projectStatusChanged,
mp_projectWindow, mp_projectWindow,
&ProjectWindow::doProjectStatusChanged); &ProjectWindow::doProjectStatusChanged);
connect(ui->menuAlignment, connect(ui->actionExport,
&QMenu::triggered, &QAction::triggered,
this, mp_projectWindow,
&MsIdentificationListWindow::doAlignmentGroupParameters); &ProjectWindow::doOpenMassChroQDialog);
} }
...@@ -327,8 +327,6 @@ MsIdentificationListWindow::setAlignmentGroup( ...@@ -327,8 +327,6 @@ MsIdentificationListWindow::setAlignmentGroup(
mp_proxyModel->setData(index, QVariant(), Qt::EditRole); mp_proxyModel->setData(index, QVariant(), Qt::EditRole);
} }
} }
checkMsRunAlignmentGroupContent();
} }
QModelIndexList QModelIndexList
...@@ -338,50 +336,9 @@ MsIdentificationListWindow::getSelectedIndexes() ...@@ -338,50 +336,9 @@ MsIdentificationListWindow::getSelectedIndexes()
} }
void void
MsIdentificationListWindow::doAlignmentGroupParameters( MsIdentificationListWindow::doMassChroQParameters()
QAction *action_triggered)
{ {
qDebug() << action_triggered->text(); emit operateMassChroqExportDialog();
MsRunAlignmentGroupSp alignment_group;
if(action_triggered == ui->actionAll_identifications)
{
}
else
{
alignment_group =
mp_projectWindow->getProjectP()->getMsRunAlignmentGroupFromList(
action_triggered->text());
}
if(alignment_group != nullptr)
{
openMassChroQParametersView(alignment_group);
}
}
void
MsIdentificationListWindow::checkMsRunAlignmentGroupContent()
{
foreach(QAction *action, ui->menuAlignment->actions())
{
if(action != ui->no_group_action &&
action != ui->actionAll_identifications && !action->isSeparator())
{
qDebug() << "test";
MsRunAlignmentGroupSp alignment_group =
mp_projectWindow->getProjectP()->getMsRunAlignmentGroupFromList(
action->text());
if(alignment_group->getMsRunsInAlignmentGroup().size() >= 2)
{
action->setEnabled(true);
}
else
{
action->setEnabled(false);
}
}
}
} }
MsIdentificationTableProxyModel * MsIdentificationTableProxyModel *
...@@ -395,23 +352,3 @@ MsIdentificationListWindow::getMsIdentificationModel() ...@@ -395,23 +352,3 @@ MsIdentificationListWindow::getMsIdentificationModel()
{ {
return mp_msidTableModel; return mp_msidTableModel;
} }
void
MsIdentificationListWindow::addValueToAlignmentMenu(QString action_name)
{
if(ui->menuAlignment->actions()[0] == ui->no_group_action)
{
ui->menuAlignment->removeAction(ui->no_group_action);
}
QAction *new_group = new QAction(action_name);
new_group->setEnabled(false);
ui->menuAlignment->addAction(new_group);
}
void
MsIdentificationListWindow::openMassChroQParametersView(
MsRunAlignmentGroupSp alignment_group)
{
qDebug();
}
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "msidentificationtableproxymodel.h" #include "msidentificationtableproxymodel.h"
#include "ui_ms_identification_run_view.h" #include "ui_ms_identification_run_view.h"
#include "../../widgets/Alignment_group_menu/alignmentgroupmenu.h" #include "../../widgets/Alignment_group_menu/alignmentgroupmenu.h"
#include "../../export/export_masschroq_dialog/exportmasschroqdialog.h"
class ProjectWindow; class ProjectWindow;
...@@ -78,12 +79,9 @@ class MsIdentificationListWindow : public QMainWindow ...@@ -78,12 +79,9 @@ class MsIdentificationListWindow : public QMainWindow
void setAlignmentGroup(MsRunAlignmentGroupSp msrun_alignment_group); void setAlignmentGroup(MsRunAlignmentGroupSp msrun_alignment_group);
void resizeColumnsToContents(); void resizeColumnsToContents();
QModelIndexList getSelectedIndexes(); QModelIndexList getSelectedIndexes();
void checkMsRunAlignmentGroupContent();
MsIdentificationTableProxyModel *getMsIdentificationProxyModel(); MsIdentificationTableProxyModel *getMsIdentificationProxyModel();
MsIdentificationTableModel *getMsIdentificationModel(); MsIdentificationTableModel *getMsIdentificationModel();
void addValueToAlignmentMenu(QString action_name);
void virtual closeEvent(QCloseEvent *event) override; void virtual closeEvent(QCloseEvent *event) override;
void openMassChroQParametersView(MsRunAlignmentGroupSp alignment_group);
public slots: public slots:
void doExportAsOdsFile(); void doExportAsOdsFile();
...@@ -92,9 +90,10 @@ class MsIdentificationListWindow : public QMainWindow ...@@ -92,9 +90,10 @@ class MsIdentificationListWindow : public QMainWindow
signals: signals:
void MsIdentificationDataChanged(); void MsIdentificationDataChanged();
void operateMassChroqExportDialog();
protected slots: protected slots:
void doAlignmentGroupParameters(QAction *action_triggered); void doMassChroQParameters();
void doSearchOn(QString search_on); void doSearchOn(QString search_on);
void updateStatusBar(); void updateStatusBar();
void onMsIdentificationSearchEdit(QString protein_search_string); void onMsIdentificationSearchEdit(QString protein_search_string);
...@@ -105,8 +104,9 @@ class MsIdentificationListWindow : public QMainWindow ...@@ -105,8 +104,9 @@ class MsIdentificationListWindow : public QMainWindow
private: private:
Ui::MsIdentificationView *ui; Ui::MsIdentificationView *ui;
MsIdentificationTableModel *mp_msidTableModel = nullptr; MsIdentificationTableModel *mp_msidTableModel = nullptr;
MsIdentificationTableProxyModel *mp_proxyModel = nullptr; MsIdentificationTableProxyModel *mp_proxyModel = nullptr;
ExportMasschroqDialog *mp_export_masschroq_dialog = nullptr;
ProjectWindow *mp_projectWindow; ProjectWindow *mp_projectWindow;
AlignmentGroupsQMenu *mp_groups_context_menu = nullptr; AlignmentGroupsQMenu *mp_groups_context_menu = nullptr;
}; };
...@@ -107,7 +107,11 @@ ProjectWindow::ProjectWindow(MainWindow *parent) ...@@ -107,7 +107,11 @@ ProjectWindow::ProjectWindow(MainWindow *parent)
&WorkerThread::bestMsrunForAlignmentGroupFinished, &WorkerThread::bestMsrunForAlignmentGroupFinished,
this, this,
&ProjectWindow::doBestMsRunForAlignmentFinished); &ProjectWindow::doBestMsRunForAlignmentFinished);
connect(this,
&ProjectWindow::operateMassChroqExportDialog,
main_window,
&MainWindow::doActionMassChroQ);
//
// grouping // grouping
/* /*
connect(this, connect(this,
...@@ -143,6 +147,13 @@ ProjectWindow::getProjectP() ...@@ -143,6 +147,13 @@ ProjectWindow::getProjectP()
{ {
return _project_sp.get(); return _project_sp.get();
} }
ProjectSp
ProjectWindow::getProjectSP()
{
return _project_sp;
}
void void
ProjectWindow::setDefaultProteinListWindow( ProjectWindow::setDefaultProteinListWindow(
ProteinListWindow *p_protein_list_window) ProteinListWindow *p_protein_list_window)
...@@ -1125,3 +1136,10 @@ ProjectWindow::doCleanMsRunReaders() ...@@ -1125,3 +1136,10 @@ ProjectWindow::doCleanMsRunReaders()
} }
} }
} }
void
ProjectWindow::doOpenMassChroQDialog()
{
qDebug() << "AAAAAAAA";
emit operateMassChroqExportDialog();
}
...@@ -59,6 +59,7 @@ class ProjectWindow : public QMainWindow ...@@ -59,6 +59,7 @@ class ProjectWindow : public QMainWindow
explicit ProjectWindow(MainWindow *parent = 0); explicit ProjectWindow(MainWindow *parent = 0);
Project *getProjectP(); Project *getProjectP();
void setProjectSp(ProjectSp project_sp); void setProjectSp(ProjectSp project_sp);
ProjectSp getProjectSP();
void editModifications(); void editModifications();
void editLabelingMethods(); void editLabelingMethods();
void openInXicViewer(const PeptideEvidence *p_peptide_evidence); void openInXicViewer(const PeptideEvidence *p_peptide_evidence);
...@@ -92,6 +93,7 @@ class ProjectWindow : public QMainWindow ...@@ -92,6 +93,7 @@ class ProjectWindow : public QMainWindow
void doProjectStatusChanged(); void doProjectStatusChanged();
void doBestMsRunForAlignmentFinished(MsRunSp msrun_sp); void doBestMsRunForAlignmentFinished(MsRunSp msrun_sp);
void doCleanMsRunReaders(); void doCleanMsRunReaders();
void doOpenMassChroQDialog();
// void setColor(const QColor &color); // void setColor(const QColor &color);
// void setShape(Shape shape); // void setShape(Shape shape);
...@@ -112,6 +114,7 @@ class ProjectWindow : public QMainWindow ...@@ -112,6 +114,7 @@ class ProjectWindow : public QMainWindow
void projectNameChanged(QString name); void projectNameChanged(QString name);
void projectStatusChanged(); void projectStatusChanged();
void bestMsRunFound(MsRunSp msrun_sp); void bestMsRunFound(MsRunSp msrun_sp);
void operateMassChroqExportDialog();
protected: protected:
void doViewPeptideList(IdentificationGroup *p_ident_group, void doViewPeptideList(IdentificationGroup *p_ident_group,
......
...@@ -254,7 +254,6 @@ AlignmentGroupsQMenu::createNewAlignmentGroup() ...@@ -254,7 +254,6 @@ AlignmentGroupsQMenu::createNewAlignmentGroup()
if(msrun_alignment_group_position == -1) if(msrun_alignment_group_position == -1)
{ {
mp_subMenuGroup->addAction(value); mp_subMenuGroup->addAction(value);
mp_msIdListWindow->addValueToAlignmentMenu(value);
MsRunAlignmentGroupSp new_alignment_group = MsRunAlignmentGroupSp new_alignment_group =
std::make_shared<MsRunAlignmentGroup>(mp_project, value); std::make_shared<MsRunAlignmentGroup>(mp_project, value);
mp_project->addMsRunAlignmentGroupToList(new_alignment_group); mp_project->addMsRunAlignmentGroupToList(new_alignment_group);
......
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