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

WIP: using tandem parameters files in tandem run dialog

parent 635e44fb
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "tandemparameters.h" #include "tandemparameters.h"
#include <QDebug> #include <QDebug>
#include <pappsomspp/exception/exceptionnotfound.h>
TandemParameters::TandemParameters() { TandemParameters::TandemParameters() {
} }
...@@ -51,7 +52,13 @@ TandemParameters::TandemParameters(const TandemParameters & other) { ...@@ -51,7 +52,13 @@ TandemParameters::TandemParameters(const TandemParameters & other) {
const QString TandemParameters::getLabelCategory(const QString & value) const { const QString TandemParameters::getLabelCategory(const QString & value) const {
return value.split(", ").at(0); return value.split(", ").at(0);
} }
const QString & TandemParameters::getValue(const QString & label) const {
QMap<QString,QString>::const_iterator it = _map_label_value.constFind(label);
if (it == _map_label_value.end()) {
throw pappso::ExceptionNotFound(QObject::tr("X!Tandem preset label %1 not found in method %2").arg(label).arg(_method_name));
}
return it.value();
}
void TandemParameters::setParamLabelValue(const QString & label, const QString & value) { void TandemParameters::setParamLabelValue(const QString & label, const QString & value) {
//list path //list path
//<note type="input" label="list path, default parameters">/gorgone/pappso/tmp/temp_condor_job24872841484824316495370334631825647/QExactive_analysis_FDR_nosemi.xml</note> //<note type="input" label="list path, default parameters">/gorgone/pappso/tmp/temp_condor_job24872841484824316495370334631825647/QExactive_analysis_FDR_nosemi.xml</note>
......
...@@ -40,6 +40,7 @@ public: ...@@ -40,6 +40,7 @@ public:
TandemParameters(const TandemParameters & other); TandemParameters(const TandemParameters & other);
virtual ~TandemParameters(); virtual ~TandemParameters();
const QString & getValue(const QString & label) const;
void setMethodName(const QString & method); void setMethodName(const QString & method);
void setParamLabelValue(const QString & label, const QString & value); void setParamLabelValue(const QString & label, const QString & value);
const QMap<QString, QString> & getMapLabelValue() const; const QMap<QString, QString> & getMapLabelValue() const;
......
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
#include <pappsomspp/pappsoexception.h> #include <pappsomspp/pappsoexception.h>
#include "../input/xtandemparamsaxhandler.h" #include "../input/xtandemparamsaxhandler.h"
TandemParametersFile::TandemParametersFile()
{
qDebug() << "TandemParametersFile::TandemParametersFile no source";
}
TandemParametersFile::TandemParametersFile(const QString & fasta_source) : _param_source(fasta_source) TandemParametersFile::TandemParametersFile(const QString & fasta_source) : _param_source(fasta_source)
{ {
qDebug() << "TandemParametersFile::TandemParametersFile "<< fasta_source; qDebug() << "TandemParametersFile::TandemParametersFile "<< fasta_source;
......
...@@ -36,8 +36,10 @@ ...@@ -36,8 +36,10 @@
class TandemParametersFile class TandemParametersFile
{ {
public: public:
TandemParametersFile(const QString & param_file); TandemParametersFile(const QString & param_file);
TandemParametersFile();
TandemParametersFile(const QFileInfo & param_file); TandemParametersFile(const QFileInfo & param_file);
TandemParametersFile(const TandemParametersFile & other); TandemParametersFile(const TandemParametersFile & other);
~TandemParametersFile(); ~TandemParametersFile();
...@@ -61,4 +63,6 @@ private : ...@@ -61,4 +63,6 @@ private :
const QFileInfo _param_source; const QFileInfo _param_source;
}; };
Q_DECLARE_METATYPE(TandemParametersFile)
#endif // TANDEMPARAMETERSFILE_H #endif // TANDEMPARAMETERSFILE_H
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include <pappsomspp/pappsoexception.h> #include <pappsomspp/pappsoexception.h>
#include "../../files/tandemparametersfile.h"
//Q_DECLARE_METATYPE(QFileInfo) //Q_DECLARE_METATYPE(QFileInfo)
...@@ -69,6 +70,16 @@ TandemRunDialog::~TandemRunDialog() ...@@ -69,6 +70,16 @@ TandemRunDialog::~TandemRunDialog()
void TandemRunDialog::setPresetName(QString preset_name) { void TandemRunDialog::setPresetName(QString preset_name) {
QSettings settings; QSettings settings;
settings.setValue("tandem/preset_name", preset_name); settings.setValue("tandem/preset_name", preset_name);
//get presets :
TandemParametersFile param_file = ui->preset_combobox->itemData(ui->preset_combobox->currentIndex()).data(Qt::UserRole).value<TandemParametersFile>();
param_file.getTandemParameters().getValue("spectrum, threads");
} }
void TandemRunDialog::fillPresetComboBox() { void TandemRunDialog::fillPresetComboBox() {
ui->preset_combobox->clear(); ui->preset_combobox->clear();
......
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