<commit_before>#include <QDir>
#include <QDateTime>
#include <QFileDialog>
#include "dialogsnpldb.h"
#include "ui_dialogsnpldb.h"
#include "parameter.h"

DialogSNPLDB::DialogSNPLDB(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogSNPLDB)
{
    ui->setupUi(this);

    ui->lineEditVcf->setText(Parameter::geno);
    ui->lineEditBlock->setText(Parameter::block);

    connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(apply()));
}

DialogSNPLDB::~DialogSNPLDB()
{
    delete ui;
}

QString DialogSNPLDB::getProg() const
{
    return QDir(QApplication::applicationDirPath()).filePath(QLatin1String("snpldb"));
}

QStringList DialogSNPLDB::getArgs() const
{
    QStringList args;

    if ( ! ui->lineEditVcf->text().isEmpty() )
        args << QLatin1String("--vcf") << ui->lineEditVcf->text();

    if ( ! ui->lineEditBlock->text().isEmpty() )
        args << QLatin1String("--block") << ui->lineEditBlock->text();

    if ( ! ui->lineEditMaf->text().isEmpty() )
        args << QLatin1String("--maf") << ui->lineEditMaf->text();

    if ( ! ui->lineEditMaxlen->text().isEmpty() )
        args << QLatin1String("--maxlen") << ui->lineEditMaxlen->text();

    if ( ! ui->lineEditLlim->text().isEmpty() )
        args << QLatin1String("--llim") << ui->lineEditLlim->text();

    if ( ! ui->lineEditUlim->text().isEmpty() )
        args << QLatin1String("--ulim") << ui->lineEditUlim->text();

    if ( ! ui->lineEditRecomb->text().isEmpty() )
        args << QLatin1String("--recomb") << ui->lineEditRecomb->text();

    if ( ! ui->lineEditInform->text().isEmpty() )
        args << QLatin1String("--inform") << ui->lineEditInform->text();

    QString prefix = QLatin1String("snpldb.out.");
    prefix += QDateTime::currentDateTime().toString(QLatin1String("yyMMdd_hhmmsszzz"));

    args << QLatin1String("--out") << QDir(Parameter::work).absoluteFilePath(prefix);

    return args;
}

void DialogSNPLDB::apply()
{
    Parameter::geno = ui->lineEditVcf->text();
    Parameter::block = ui->lineEditBlock->text();<commit_msg>Fixed cmd<commit_after>#include <QDir>
#include <QDateTime>
#include <QFileDialog>
#include "dialogsnpldb.h"
#include "ui_dialogsnpldb.h"
#include "parameter.h"

DialogSNPLDB::DialogSNPLDB(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogSNPLDB)
{
    ui->setupUi(this);

    ui->lineEditVcf->setText(Parameter::geno);
    ui->lineEditBlock->setText(Parameter::block);

    connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(apply()));
}

DialogSNPLDB::~DialogSNPLDB()
{
    delete ui;
}

QString DialogSNPLDB::getProg() const
{
    return QDir(QApplication::applicationDirPath()).filePath(QLatin1String("snpldb"));
}

QStringList DialogSNPLDB::getArgs() const
{
    QStringList args;

    if ( ! ui->lineEditVcf->text().isEmpty() )
        args << QLatin1String("--vcf") << ui->lineEditVcf->text();

    if ( ! ui->lineEditBlock->text().isEmpty() )
        args << QLatin1String("--blk") << ui->lineEditBlock->text();

    if ( ! ui->lineEditMaf->text().isEmpty() )
        args << QLatin1String("--maf") << ui->lineEditMaf->text();

    if ( ! ui->lineEditMaxlen->text().isEmpty() )
        args << QLatin1String("--maxlen") << ui->lineEditMaxlen->text();

    if ( ! ui->lineEditLlim->text().isEmpty() )
        args << QLatin1String("--llim") << ui->lineEditLlim->text();

    if ( ! ui->lineEditUlim->text().isEmpty() )
        args << QLatin1String("--ulim") << ui->lineEditUlim->text();

    if ( ! ui->lineEditRecomb->text().isEmpty() )
        args << QLatin1String("--recomb") << ui->lineEditRecomb->text();

    if ( ! ui->lineEditInform->text().isEmpty() )
        args << QLatin1String("--inform") << ui->lineEditInform->text();

    QString prefix = QLatin1String("snpldb.out.");
    prefix += QDateTime::currentDateTime().toString(QLatin1String("yyMMdd_hhmmsszzz"));

    args << QLatin1String("--out") << QDir(Parameter::work).absoluteFilePath(prefix);

    return args;
}

void DialogSNPLDB::apply()
{
    Parameter::geno = ui->lineEditVcf->text();
    Parameter::block = ui->lineEditBlock->text();
{'fraction_non_alphanumeric': 0.20223084384093112, 'fraction_numerical': 0.005819592628516004, 'mean_word_length': 4.15625, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5783863', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1399, 'n_words': 186}