connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
closeAction->setIcon(QIcon(":/icons/exit.png"));
- createNewAnalysisAction = new QAction(tr("Define Analysis"), this);
+ createNewAnalysisAction = new QAction(tr("Create Analysis"), this);
connect(createNewAnalysisAction, SIGNAL(triggered()),
this, SLOT(createNewAnalysis()));
createNewAnalysisAction->setIcon(QIcon(":/icons/filenew.png"));
this, SLOT(loadMotifList()));
loadMotifListAction->setIcon(QIcon(":/icons/fileopen.png"));
- loadMupaAction = new QAction(tr("Load Mussa Parameters"), this);
+ loadMupaAction = new QAction(tr("Create Analysis from File"), this);
connect(loadMupaAction, SIGNAL(triggered()),
this, SLOT(loadMupa()));
loadMupaAction->setIcon(QIcon(":/icons/fileopen.png"));
- loadSavedAnalysisAction = new QAction(tr("Load &Analysis"), this);
+ loadSavedAnalysisAction = new QAction(tr("Load Existing &Analysis"), this);
connect(loadSavedAnalysisAction, SIGNAL(triggered()),
this, SLOT(loadSavedAnalysis()));
loadSavedAnalysisAction->setIcon(QIcon(":/icons/fileopen.png"));
{
// if we're done
if (current == max) {
- cout << "done with dialog" << endl;
if (progress_dialog != 0) {
progress_dialog->hide();
delete progress_dialog;
} else {
// if we're starting, create the dialog
if (progress_dialog == 0) {
- cout << "creating dialog" << endl;
QString desc(description.c_str());
QString cancel("Cancel");
progress_dialog = new QProgressDialog(desc, cancel, current, max, this);
connect(&basepair_spinner, SIGNAL(valueChanged(int)),
this, SLOT(setBasepairThreshold(int)));
- connect(&percent_spinner, SIGNAL(valueChanged(int)),
- this, SLOT(setPercentThreshold(int)));
basepair_spinner.setValue(min);
+ updatePercentThreshold();
QHBoxLayout *layout = new QHBoxLayout;
+ layout->addWidget(new QLabel("Threshold"));
layout->addWidget(&basepair_spinner);
layout->addWidget(&window_size_label);
- layout->addWidget(&percent_spinner);
- layout->addWidget(new QLabel("%"));
+ layout->addWidget(&percent_label);
setLayout(layout);
}
QString num;
num.setNum(max);
window_size_label.setText("/"+num);
- int min_percent =(int)fmaxl(0.0, roundl(min_ratio()*100));
- cur_percent_threshold = min_percent;
- percent_spinner.setRange( min_percent, 100);
- if (min_percent != 0.0) {
- percent_spinner.setSingleStep((int)(roundl(1.0/(double)(max)*100.0)));
- }
- percent_spinner.setValue(min_percent);
+ updatePercentThreshold();
}
double ThresholdWidget::min_ratio() const
cur_bp_threshold = threshold;
cur_percent_threshold = (int)(roundl(ratio() * 100));
basepair_spinner.setValue(threshold);
- percent_spinner.setValue(cur_percent_threshold);
+ updatePercentThreshold();
emit thresholdChanged(threshold);
}
}
-void ThresholdWidget::setPercentThreshold(int percent_threshold)
+void ThresholdWidget::updatePercentThreshold()
{
- if (cur_percent_threshold != percent_threshold)
- {
- cur_percent_threshold = percent_threshold;
- long t=lround(basepair_spinner.maximum()*((float)percent_threshold/100.0));
- cur_bp_threshold = (int)t;
- percent_spinner.setValue(percent_threshold);
- basepair_spinner.setValue(cur_bp_threshold);
- emit thresholdChanged(cur_bp_threshold);
- }
+ std::cout << "update percent" << std::endl;
+ int min_percent = (int)fmaxl(0.0, roundl(ratio()*100));
+ QString label;
+ label.setNum(min_percent);
+ label += "%";
+ percent_label.setText(label);
}
int ThresholdWidget::threshold() const
double ratio() const;
//! return our current threshold
int threshold() const;
+ //! update percent threshold
+ void updatePercentThreshold();
public slots:
void setBasepairThreshold(int threshold);
- void setPercentThreshold(int percent_threshold);
+ //void setPercentThreshold(int percent_threshold);
//! set the min and max base pair range
void setRange(int min, int max);
protected:
QSpinBox basepair_spinner;
QLabel window_size_label;
- QSpinBox percent_spinner;
+ QLabel percent_label;
int cur_bp_threshold;
int cur_percent_threshold;
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(zoomLabel);
layout->addWidget(&zoom);
+ layout->addWidget(new QLabel("bp/pix"));
setLayout(layout);
setToolTip(tr("Zoom"));
analysisNameLabel->setBuddy(&analysisNameLineEdit);
// Window
- QLabel *windowLabel = new QLabel(tr("Window"));
+ QLabel *windowLabel = new QLabel(tr("Window (nt)"));
windowLabel->setBuddy(&windowLineEdit);
// Threshold
- QLabel *thresholdLabel = new QLabel(tr("Threshold"));
+ QLabel *thresholdLabel = new QLabel(tr("Threshold (nt)"));
thresholdLabel->setBuddy(&thresholdLineEdit);
// Number of sequences
QString annotFilePath = QFileDialog::getOpenFileName(this,
"Choose a annotation file",
".",
- "Annot (*.txt)");
+ "Annot (*.txt *.annot)");
if (annotFilePath.isEmpty())
return;