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

add check to group list exportMassChroQ

parent 9465ac23
No related branches found
No related tags found
1 merge request!29Allow Masschroq export with different alignment groups
......@@ -35,7 +35,14 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<widget class="QListWidget" name="listWidget_2"/>
<widget class="QListView" name="listView_2">
<property name="toolTip">
<string>Check which groups will be aligned and created</string>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="checkMsrunFilePathButton">
......@@ -472,8 +479,8 @@
<slot>doBrowseMsrunDirectory()</slot>
<hints>
<hint type="sourcelabel">
<x>593</x>
<y>110</y>
<x>91</x>
<y>56</y>
</hint>
<hint type="destinationlabel">
<x>787</x>
......@@ -545,6 +552,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>listView_2</sender>
<signal>clicked(QModelIndex)</signal>
<receiver>ExportMasschroqDialog</receiver>
<slot>doShowMsRunsInAlignmentGroup(QModelIndex)</slot>
<hints>
<hint type="sourcelabel">
<x>99</x>
<y>237</y>
</hint>
<hint type="destinationlabel">
<x>317</x>
<y>257</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>reject()</slot>
......@@ -552,5 +575,6 @@
<slot>doCheckMsrunFilepath()</slot>
<slot>doBrowseMsrunDirectory()</slot>
<slot>doFindBestMsrunForAlignment()</slot>
<slot>doShowMsRunsInAlignmentGroup(QModelIndex)</slot>
</slots>
</ui>
......@@ -51,6 +51,7 @@ ExportMasschroqDialog::ExportMasschroqDialog(MainWindow *parent,
ui->msrunFilepathOkLabel->setHidden(true);
ui->warningDirectoryLabel->setStyleSheet("QLabel { color : red; }");
mp_poModel = new QStandardItemModel(ui->listView_2);
connect(this,
......@@ -90,7 +91,6 @@ void
ExportMasschroqDialog::setProjectSPtr(ProjectSp p_project)
{
msp_project = p_project;
fillMsrunListComboBox();
}
void
......@@ -323,50 +323,46 @@ ExportMasschroqDialog::setCheckMsrunFilePathOk(MsRunSp msrun_sp)
}
}
void
ExportMasschroqDialog::fillMsrunListComboBox()
{
ui->msrun_list_combo_box->clear();
if(msp_project != nullptr)
{
int index = -1;
for(auto &msrun_sp : msp_project->getMsRunStore().getMsRunList())
{
index = 0;
ui->msrun_list_combo_box->addItem(
QString("%1").arg(msrun_sp.get()->getSampleName()),
QVariant::fromValue(msrun_sp));
}
if(index != -1)
{ // -1 for not found
ui->msrun_list_combo_box->setCurrentIndex(index);
}
}
}
void
ExportMasschroqDialog::setAlignmentGroups()
{
// ui->listWidget_2->clear();
msp_alignmentGroups = msp_project->getMsRunAlignmentGroupList();
int i = 0;
for(MsRunAlignmentGroupSp group : msp_alignmentGroups)
{
QListWidgetItem *new_item =
new QListWidgetItem(group->getMsRunAlignmentGroupName());
ui->listWidget_2->insertItem(0, new_item);
QStandardItem *new_item =
new QStandardItem(group->getMsRunAlignmentGroupName());
new_item->setCheckable(true);
new_item->setData(Qt::Unchecked, Qt::CheckStateRole);
mp_poModel->setItem(i, new_item);
i++;
}
ui->listView_2->setModel(mp_poModel);
}
void ExportMasschroqDialog::doShowMsRunsInAlignmentGroup(QModelIndex index)
void
ExportMasschroqDialog::doShowMsRunsInAlignmentGroup(QModelIndex index)
{
ui->listWidget->clear();
ui->msrun_list_combo_box->clear();
MsRunAlignmentGroupSp temp = msp_alignmentGroups.at(index.row());
for(MsRunSp ms_run : temp->getMsRunsInAlignmentGroup())
{
ui->listWidget->addItem(ms_run->getSampleName());
ui->msrun_list_combo_box->addItem(ms_run->getSampleName());
}
{
ui->listWidget->addItem(ms_run->getSampleName());
ui->msrun_list_combo_box->addItem(ms_run->getSampleName());
}
if(temp->getMsRunReference() != nullptr)
{
std::list<MsRunSp>::iterator it;
it = std::find(temp->getMsRunsInAlignmentGroup().begin(),
temp->getMsRunsInAlignmentGroup().end(),
temp->getMsRunReference());
int idx = std::distance(temp->getMsRunsInAlignmentGroup().begin(), it);
ui->msrun_list_combo_box->setCurrentIndex(idx);
}
else
{
//ui->msrun_list_combo_box->setCurrentIndex(index);
ui->msrun_list_combo_box->setCurrentIndex(-1);
}
}
......@@ -34,6 +34,7 @@
#include "masschroqfileparameters.h"
#include "../../../core/project.h"
#include "../../workerthread.h"
#include <QStandardItemModel>
namespace Ui
{
......@@ -58,7 +59,7 @@ class ExportMasschroqDialog : public QDialog
void setProjectSPtr(ProjectSp p_project);
void setAlignmentGroups();
signals:
// void peptideChanged(pappso::PeptideSp peptide);
void operateFindBestMsrunForAlignment(ProjectSp project_sp);
......@@ -74,7 +75,8 @@ class ExportMasschroqDialog : public QDialog
ProjectSp msp_project;
MainWindow *mp_main;
std::vector<MsRunAlignmentGroupSp> msp_alignmentGroups;
QStandardItemModel *mp_poModel;
protected slots:
void doCheckMsrunFilepath();
void doBrowseMsrunDirectory();
......@@ -82,5 +84,4 @@ class ExportMasschroqDialog : public QDialog
void doShowMsRunsInAlignmentGroup(QModelIndex index);
private:
void fillMsrunListComboBox();
};
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