Commit bd4b8dff authored by Olivier Langella's avatar Olivier Langella
Browse files

WIP: using tandem parameters files in tandem run dialog

parent 635e44fb
......@@ -29,6 +29,7 @@
#include "tandemparameters.h"
#include <QDebug>
#include <pappsomspp/exception/exceptionnotfound.h>
TandemParameters::TandemParameters() {
}
......@@ -51,7 +52,13 @@ TandemParameters::TandemParameters(const TandemParameters & other) {
const QString TandemParameters::getLabelCategory(const QString & value) const {
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) {
//list path
//<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:
TandemParameters(const TandemParameters & other);
virtual ~TandemParameters();
const QString & getValue(const QString & label) const;
void setMethodName(const QString & method);
void setParamLabelValue(const QString & label, const QString & value);
const QMap<QString, QString> & getMapLabelValue() const;
......
......@@ -33,6 +33,10 @@
#include <pappsomspp/pappsoexception.h>
#include "../input/xtandemparamsaxhandler.h"
TandemParametersFile::TandemParametersFile()
{
qDebug() << "TandemParametersFile::TandemParametersFile no source";
}
TandemParametersFile::TandemParametersFile(const QString & fasta_source) : _param_source(fasta_source)
{
qDebug() << "TandemParametersFile::TandemParametersFile "<< fasta_source;
......
......@@ -36,8 +36,10 @@
class TandemParametersFile
{
public:
TandemParametersFile(const QString & param_file);
TandemParametersFile();
TandemParametersFile(const QFileInfo & param_file);
TandemParametersFile(const TandemParametersFile & other);
~TandemParametersFile();
......@@ -61,4 +63,6 @@ private :
const QFileInfo _param_source;
};
Q_DECLARE_METATYPE(TandemParametersFile)
#endif // TANDEMPARAMETERSFILE_H
......@@ -34,6 +34,7 @@
#include <QFileDialog>
#include <QMessageBox>
#include <pappsomspp/pappsoexception.h>
#include "../../files/tandemparametersfile.h"
//Q_DECLARE_METATYPE(QFileInfo)
......@@ -69,6 +70,16 @@ TandemRunDialog::~TandemRunDialog()
void TandemRunDialog::setPresetName(QString preset_name) {
QSettings settings;
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() {
ui->preset_combobox->clear();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment