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

GUI updated to choose msrun for alignment either automatic or manual

parent 6d2a9bb6
No related branches found
No related tags found
No related merge requests found
......@@ -98,3 +98,6 @@ class MsRun : public pappso::MsRunId
pappso::MsRunRetentionTime<const pappso::Peptide *> *mpa_msrunRetentionTime =
nullptr;
};
Q_DECLARE_METATYPE(MsRunSp)
......@@ -299,6 +299,13 @@ void
Project::prepareMsrunRetentionTimesForAlignment() const
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
for(auto &msrun_sp : this->getMsRunStore().getMsRunList())
{
msrun_sp.get()->clearMsRunRetentionTime();
}
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
bool is_ok = true;
PeptideEvidenceStore empty_store;
for(IdentificationDataSourceSp p_ident_data_source :
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>613</width>
<height>371</height>
<width>635</width>
<height>515</height>
</rect>
</property>
<property name="windowTitle">
......@@ -176,10 +176,22 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Find best MS run reference for alignment</string>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>MSrun reference for alignment</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Find best MS run reference for alignment</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="msrun_list_combo_box"/>
</item>
</layout>
</widget>
</item>
<item>
......
......@@ -71,6 +71,7 @@ void
ExportMasschroqDialog::setProject(const Project *p_project)
{
mp_project = p_project;
fillMsrunListComboBox();
}
void
......@@ -144,6 +145,15 @@ ExportMasschroqDialog::getMasschroqFileParameters() const
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;
......@@ -327,7 +337,18 @@ ExportMasschroqDialog::doFindBestMsrunForAlignment()
if(ms_run_best_reference != nullptr)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
<< ms_run_best_reference.get()->getXmlId()<< " best_number=" << best_number;
<< ms_run_best_reference.get()->getXmlId()
<< " best_number=" << best_number;
for(int index = 0; index < ui->msrun_list_combo_box->count(); index++)
{
MsRunSp msrun_sp = qvariant_cast<MsRunSp>(
ui->msrun_list_combo_box->itemData(index));
if(msrun_sp.get() == ms_run_best_reference.get())
{
ui->msrun_list_combo_box->setCurrentIndex(index);
}
}
}
}
catch(pappso::PappsoException &error)
......@@ -340,3 +361,23 @@ ExportMasschroqDialog::doFindBestMsrunForAlignment()
msgBox.exec();
}
}
void
ExportMasschroqDialog::fillMsrunListComboBox()
{
ui->msrun_list_combo_box->clear();
int index = -1;
for(auto &msrun_sp : mp_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);
}
}
......@@ -36,21 +36,13 @@
namespace Ui
{
class ExportMasschroqDialog;
class ExportMasschroqDialog;
}
class ExportMasschroqDialog : public QDialog
{
Q_OBJECT
private:
Ui::ExportMasschroqDialog *ui;
const Project *mp_project;
protected slots:
void doCheckMsrunFilepath();
void doBrowseMsrunDirectory();
void doFindBestMsrunForAlignment();
public:
explicit ExportMasschroqDialog(QWidget *parent);
......@@ -63,5 +55,18 @@ class ExportMasschroqDialog : public QDialog
void setProject(const Project *p_project);
private:
Ui::ExportMasschroqDialog *ui;
const Project *mp_project;
protected slots:
void doCheckMsrunFilepath();
void doBrowseMsrunDirectory();
void doFindBestMsrunForAlignment();
private:
void fillMsrunListComboBox();
signals:
};
......@@ -33,6 +33,7 @@
#include "../../../utils/types.h"
#include <QString>
#include <pappsomspp/mzrange.h>
#include "../../../core/msrun.h"
struct MasschroqFileParameters
{
......@@ -59,4 +60,6 @@ struct MasschroqFileParameters
pappso::PrecisionPtr xic_extraction_range;
pappso::XicExtractMethod xic_extraction_method; // sum or max
MsRunSp msrun_alignment_reference;
};
......@@ -23,8 +23,7 @@
******************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#pragma once
#include <QMainWindow>
#include <QFileInfo>
......@@ -150,5 +149,3 @@ class MainWindow : public QMainWindow
HttpVersion m_onlineVersion;
};
#endif // MAINWINDOW_H
......@@ -22,8 +22,7 @@
*implementation
******************************************************************************/
#ifndef IDENTIFICATIONGROUPWIDGET_H
#define IDENTIFICATIONGROUPWIDGET_H
#pragma once
#include "../projectwindow.h"
......@@ -59,4 +58,3 @@ class IdentificationGroupWidget : public QWidget
};
Q_DECLARE_METATYPE(IdentificationGroupWidget *)
#endif // IDENTIFICATIONGROUPWIDGET_H
......@@ -452,8 +452,17 @@ MassChroQml::writeAlignments()
_output_stream->writeAttribute("method_id", "my_ms2");
std::vector<MsRunSp> msrun_list =
_sp_project.get()->getMsRunStore().getMsRunList();
_output_stream->writeAttribute("reference_data_id",
msrun_list.front().get()->getXmlId());
if(m_params.msrun_alignment_reference == nullptr)
{
_output_stream->writeAttribute("reference_data_id",
msrun_list.front().get()->getXmlId());
}
else
{
_output_stream->writeAttribute(
"reference_data_id",
m_params.msrun_alignment_reference.get()->getXmlId());
}
_output_stream->writeEndElement();
//</alignments>
_output_stream->writeEndElement();
......
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