// us know what our threshold and window sizes were when we load a muway
window = the_paths.get_window();
threshold = the_paths.get_threshold();
- soft_thres = threshold;
+ soft_thres = the_paths.get_soft_threshold();
//--------------------------------------------------------
// add a function para new_thres defaults to -1 to later deal with
// reanalysis with higher thres - if statement whether to record base thres
// or new thres (ie if -1, then base)
- save_file << " thres=" << threshold << " >\n";
+ save_file << " thres=" << threshold << " soft_thres=" << soft_thres << " >\n";
path_i = refined_pathz.begin();
paths_end = refined_pathz.end();
data = file_data_line.substr(equal_split_i+1);
threshold = atoi (data.c_str());
file_data_line = file_data_line.substr(space_split_i+1);
-
+ // get cur_threshold
+ //std::cout << "file_data_line: " << file_data_line << "\n";
+ //std::cout << "find(\">\"): " << file_data_line.find(">") << "\n";
+ if (file_data_line.find(">") != 0)
+ {
+ space_split_i = file_data_line.find(" ");
+ header_data = file_data_line.substr(0,space_split_i);
+ equal_split_i = header_data.find("=");
+ data = file_data_line.substr(equal_split_i+1);
+ soft_thres = atoi (data.c_str());
+ file_data_line = file_data_line.substr(space_split_i+1);
+ }
+ else
+ {
+ soft_thres = threshold;
+ }
+ //std::cout << "nway_soft_thres: " << soft_thres << "\n";
//cout << "seq_num=" << species_num << " win=" << win_size;
//cout << " thres=" << threshold << endl;
if (new_analysis != 0) {
// only switch mussas if we loaded without error
clear();
+ //std::cout << "analysis soft: " << analysis->get_soft_threshold()
+ // << " new analysis soft: " << new_analysis->get_soft_threshold()
+ // << "\n";
analysis.swap(new_analysis);
+ //std::cout << "after swap soft thres: " << analysis->get_soft_threshold()
+ // << "\n";
+ threshold->disconnect(this);
+ threshold->reset(analysis->get_threshold(),
+ analysis->get_window(),
+ analysis->get_soft_threshold());
+ connect(threshold, SIGNAL(thresholdChanged(int)),
+ this, SLOT(setSoftThreshold(int)));
updateTitle();
updateAnalysis();
}
void MussaWindow::setSoftThreshold(int value)
{
+ //std::cout << "Soft: " << analysis->get_soft_threshold()
+ // << " Value: " << value << "\n";
if (analysis->get_soft_threshold() != value) {
threshold->setEnabled( false );
+ //std::cout << "Updating!!!!\n";
analysis->set_soft_threshold(value);
analysis->nway();
updateLinks();
update();
threshold->setEnabled( true );
}
+ //else
+ //{
+ // std::cout << "NOT Updating!!!!\n";
+ //}
}
void MussaWindow::showMussaToolbar()
// but it's possible for us to not have had a chance to set out sequences
// yet.
threshold->setRange(analysis->get_threshold(),analysis->get_window());
+ threshold->setBasepairThreshold(analysis->get_soft_threshold());
updateLinks();
browser->zoomOut();
zoom->setValue(browser->zoom());
ThresholdWidget::ThresholdWidget(QWidget *parent, int min, int max)
: QWidget(parent),
layout(0),
+ cur_bp_threshold(0),
basepair_spinner(0),
window_size_label(0),
percent_label(0)
void ThresholdWidget::setRange(int min, int max)
{
basepair_spinner->setRange(min, max);
- cur_bp_threshold = min;
- basepair_spinner->setValue(min);
+ if (cur_bp_threshold < min || cur_bp_threshold > max)
+ {
+ cur_bp_threshold = min;
+ basepair_spinner->setValue(min);
+ }
QString num;
num.setNum(max);
{
return cur_bp_threshold;
}
+
+void ThresholdWidget::reset(int min, int max, int threshold)
+{
+
+ cur_bp_threshold = threshold;
+ cur_percent_threshold = (int)(roundl(ratio() * 100));
+ setRange(min, max);
+ basepair_spinner->setValue(threshold);
+ updatePercentThreshold();
+
+}
int threshold() const;
//! update percent threshold
void updatePercentThreshold();
+
+ void reset(int min, int max, int threshold);
public slots:
void setBasepairThreshold(int threshold);