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

Correct best msRun issues (clicked didn't work, reference didn't used in mcqml file)

parent 05e670ee
No related branches found
No related tags found
1 merge request!33Multiples Corrections and features implementations
......@@ -120,7 +120,7 @@
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Best</string>
<string>Find Best</string>
</property>
</widget>
</item>
......@@ -464,8 +464,8 @@
<slot>doBrowseMsrunDirectory()</slot>
<hints>
<hint type="sourcelabel">
<x>195</x>
<y>381</y>
<x>214</x>
<y>421</y>
</hint>
<hint type="destinationlabel">
<x>736</x>
......@@ -473,6 +473,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>msrun_list_combo_box</sender>
<signal>activated(int)</signal>
<receiver>ExportMasschroqDialog</receiver>
<slot>doUpdateReferenceInSelectedGroup(int)</slot>
<hints>
<hint type="sourcelabel">
<x>417</x>
<y>432</y>
</hint>
<hint type="destinationlabel">
<x>817</x>
<y>444</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>reject()</slot>
......@@ -481,5 +497,6 @@
<slot>doBrowseMsrunDirectory()</slot>
<slot>doFindBestMsrunForAlignment()</slot>
<slot>doShowMsRunsInAlignmentGroup(QModelIndex)</slot>
<slot>doUpdateReferenceInSelectedGroup(int)</slot>
</slots>
</ui>
......@@ -157,16 +157,6 @@ ExportMasschroqDialog::getMasschroqFileParameters() const
params.xic_extraction_method =
ui->xic_extraction_method_widget->getXicExtractionMethod();
int index = ui->msrun_list_combo_box->currentIndex();
if(index != -1)
{
MsRunSp msrun_sp =
qvariant_cast<MsRunSp>(ui->msrun_list_combo_box->itemData(index));
params.msrun_alignment_reference = msrun_sp;
}
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
<< (int)params.xic_extraction_method;
return params;
......@@ -278,17 +268,17 @@ ExportMasschroqDialog::setBestMsrunForAlignment(MsRunSp best_msrun_sp)
mp_main->hideWaitingMessage();
if(best_msrun_sp != nullptr)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
<< best_msrun_sp.get()->getXmlId();
qDebug() << best_msrun_sp.get();
for(int index = 0; index < ui->msrun_list_combo_box->count(); index++)
int index = 0;
for(MsRunSp ms_run : msp_selected_group->getMsRunsInAlignmentGroup())
{
MsRunSp msrun_sp =
qvariant_cast<MsRunSp>(ui->msrun_list_combo_box->itemData(index));
if(msrun_sp.get() == best_msrun_sp.get())
if(ms_run == best_msrun_sp)
{
ui->msrun_list_combo_box->setCurrentIndex(index);
msp_selected_group->setMsRunReference(best_msrun_sp);
}
index++;
}
}
}
......@@ -346,16 +336,33 @@ ExportMasschroqDialog::doShowMsRunsInAlignmentGroup(QModelIndex index)
}
if(msp_selected_group->getMsRunReference() != nullptr)
{
std::list<MsRunSp>::iterator it;
it = std::find(msp_selected_group->getMsRunsInAlignmentGroup().begin(),
msp_selected_group->getMsRunsInAlignmentGroup().end(),
msp_selected_group->getMsRunReference());
int idx = std::distance(
msp_selected_group->getMsRunsInAlignmentGroup().begin(), it);
ui->msrun_list_combo_box->setCurrentIndex(idx);
int index = 0;
for(MsRunSp ms_run : msp_selected_group->getMsRunsInAlignmentGroup())
{
if(ms_run == msp_selected_group->getMsRunReference())
{
ui->msrun_list_combo_box->setCurrentIndex(index);
}
index++;
}
}
else
{
ui->msrun_list_combo_box->setCurrentIndex(-1);
}
}
void
ExportMasschroqDialog::doUpdateReferenceInSelectedGroup(int index)
{
int temp_index = 0;
for(MsRunSp ms_run : msp_selected_group->getMsRunsInAlignmentGroup())
{
if(temp_index == index)
{
msp_selected_group->setMsRunReference(ms_run);
}
temp_index++;
}
qDebug() << index;
}
......@@ -76,6 +76,7 @@ class ExportMasschroqDialog : public QDialog
void doBrowseMsrunDirectory();
void doFindBestMsrunForAlignment();
void doShowMsRunsInAlignmentGroup(QModelIndex index);
void doUpdateReferenceInSelectedGroup(int index);
private:
Ui::ExportMasschroqDialog *ui;
......
......@@ -61,6 +61,5 @@ struct MasschroqFileParameters
pappso::XicExtractMethod xic_extraction_method; // sum or max
MsRunSp msrun_alignment_reference;
std::vector<MsRunAlignmentGroupSp> alignment_groups;
};
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