win_append(m.win_append),
thres_append(m.thres_append),
motif_sequences(m.motif_sequences),
- color_mapper(m.color_mapper)
+ color_mapper(m.color_mapper),
+ dirty(m.dirty)
{
connect(&the_paths, SIGNAL(progress(const std::string&, int, int)),
this, SIGNAL(progress(const std::string&, int, int)));
motif_sequences.clear();
if(color_mapper) color_mapper->clear();
the_paths.clear();
+ dirty = false;
}
// these 5 simple methods manually set the parameters for doing an analysis
Mussa::set_name(string a_name)
{
analysis_name = a_name;
+ dirty = true;
}
string Mussa::get_name()
Mussa::set_window(int a_window)
{
window = a_window;
+ dirty = true;
}
int Mussa::get_window() const
Mussa::set_threshold(int a_threshold)
{
threshold = a_threshold;
- if (a_threshold > soft_thres)
+ dirty = true;
+ if (a_threshold > soft_thres) {
soft_thres = a_threshold;
+ }
}
int Mussa::get_threshold() const
Mussa::set_analysis_mode(enum analysis_modes new_ana_mode)
{
ana_mode = new_ana_mode;
+ dirty = true;
}
enum Mussa::analysis_modes Mussa::get_analysis_mode() const
{
boost::shared_ptr<Sequence> seq_copy(new Sequence(a_seq));
the_seqs.push_back(seq_copy);
+ dirty = true;
}
void Mussa::append_sequence(boost::shared_ptr<Sequence> a_seq)
{
the_seqs.push_back(a_seq);
+ dirty = true;
}
aseq->set_species(*name);
}
the_seqs.push_back(aseq);
+ dirty = true;
}
void
{
throw mussa_load_error("Config File: " + para_file_path.string() + " not found");
}
+ dirty = true;
}
} else {
throw mussa_error("Can't save analysis without an analysis name");
}
+ dirty = false;
}
void
enum analysis_modes get_analysis_mode() const;
//! return a string name for an analysis mode
std::string get_analysis_mode_name() const;
+ //! return if we have unsaved changes
+ bool is_dirty() const { return dirty; }
//! return the refined paths found by the nway analysis.
const NwayPaths& paths() const;
std::set<Sequence> motif_sequences;
//! color manager
boost::shared_ptr<AnnotationColors> color_mapper;
+ //! flag indicating if we have unsaved changes
+ bool dirty;
// Private methods
//! runs all the seqcomps needed to support the nway comparison
BOOST_CHECK( perfect_match_count < one_mismatch_count );
}
+BOOST_AUTO_TEST_CASE( dirty_flag )
+{
+ Mussa m;
+ BOOST_CHECK_EQUAL(m.is_dirty(), false);
+ m.set_name("foo");
+ BOOST_CHECK_EQUAL(m.is_dirty(), true);
+ m.clear();
+ m.set_window(30);
+ BOOST_CHECK_EQUAL(m.is_dirty(), true);
+ m.clear();
+ m.set_threshold(1);
+ BOOST_CHECK_EQUAL(m.is_dirty(), true);
+ m.clear();
+ m.set_soft_threshold(1);
+ BOOST_CHECK_EQUAL(m.is_dirty(), false);
+ m.clear();
+ m.append_sequence("AAGGCCTT");
+ BOOST_CHECK_EQUAL(m.is_dirty(), true);
+}
+