Mussa::set_threshold(int a_threshold)
{
threshold = a_threshold;
- //soft_thres = a_threshold;
+ if (a_threshold > soft_thres)
+ soft_thres = a_threshold;
}
int Mussa::get_threshold() const
}
void
-Mussa::set_soft_thres(int sft_thres)
+Mussa::set_soft_threshold(int new_threshold)
{
- soft_thres = sft_thres;
+ if (new_threshold < threshold) {
+ soft_thres = threshold;
+ } else if (new_threshold > window) {
+ soft_thres = window;
+ } else {
+ soft_thres = new_threshold;
+ }
}
-int Mussa::get_soft_thres() const
+int Mussa::get_soft_threshold() const
{
return soft_thres;
}
{
vector<string> some_Seqs;
- the_paths.set_soft_thres(soft_thres);
+ the_paths.set_soft_threshold(soft_thres);
if (ana_mode == TransitiveNway) {
the_paths.trans_path_search(all_comps);
void set_window(int a_window);
//! get number of bases for the sliding window
int get_window() const;
- //! set number of bases that must match for a window to be saved
+ //! set number of bases that must match for a window to be saved
+ //! if threshold > soft_threshold this also sets soft_threshold
void set_threshold(int a_threshold);
//! get number of bases that must match for a window to be saved
int get_threshold() const;
- void set_soft_thres(int sft_thres);
- int get_soft_thres() const;
+ //! sets the threshold used for computing the nway paths
+ //! must be in range [threshold..window size]
+ void set_soft_threshold(int sft_thres);
+ int get_soft_threshold() const;
void set_analysis_mode(enum analysis_modes new_ana_mode);
enum analysis_modes get_analysis_mode() const;
}
void
-NwayPaths::set_soft_thres(int sft_thres)
+NwayPaths::set_soft_threshold(int sft_thres)
{
soft_thres = sft_thres;
}
//! threshold
void setup(int w, int t);
void setup_ent(double new_entropy_thres, std::vector<std::string> some_Seqs);
- void set_soft_thres(int soft_thres);
+ void set_soft_threshold(int soft_thres);
//! return minimum threshold for this analysis
int get_threshold() const;
//! return window size used for this analysis
BOOST_CHECK_EQUAL(m.get_window(), 30);
m.set_threshold(21);
BOOST_CHECK_EQUAL(m.get_threshold(), 21);
+ BOOST_CHECK_EQUAL(m.get_soft_threshold(), 21);
+ m.set_soft_threshold(19);
+ BOOST_CHECK_EQUAL(m.get_soft_threshold(), 21);
+ m.set_soft_threshold(35);
+ BOOST_CHECK_EQUAL(m.get_soft_threshold(), 30);
+ m.set_soft_threshold(25);
+ BOOST_CHECK_EQUAL(m.get_soft_threshold(), 25);
m.set_analysis_mode(Mussa::RadialNway);
BOOST_CHECK_EQUAL(m.get_analysis_mode(), Mussa::RadialNway);
BOOST_AUTO_TEST_CASE ( empty_mussa_set_threshold )
{
Mussa m;
- m.set_soft_thres(15);
+ m.set_soft_threshold(15);
m.nway();
- m.set_soft_thres(25);
+ m.set_soft_threshold(25);
m.nway();
}
BOOST_CHECK( first_refined_size > 0 );
// we're using a window size 30 (threshold 20) example
- m1.set_soft_thres(22);
+ m1.set_soft_threshold(22);
m1.nway();
BOOST_CHECK( npath.refined_path_size() > 0);
BOOST_CHECK( npath.refined_path_size() < first_refined_size);
- m1.set_soft_thres(20);
+ m1.set_soft_threshold(20);
m1.nway();
BOOST_CHECK_EQUAL(npath.refined_path_size(), first_refined_size);
}
m1.add_a_seq(seq3);
m1.analyze(10, 8);
- m1.set_soft_thres(10);
+ m1.set_soft_threshold(10);
m1.nway();
}
"the number of base pairs in the sliding window")
.add_property("threshold", &Mussa::get_threshold, &Mussa::set_threshold,
"how many base pairs must match between two windows")
- .def("softThreshold", &Mussa::set_soft_thres)
+ .def("softThreshold", &Mussa::set_soft_threshold)
.add_property("analysisMode", &Mussa::get_analysis_mode,
&Mussa::set_analysis_mode)
.add_property("analysisModeName", &Mussa::get_analysis_mode_name)
void MussaWindow::setSoftThreshold(int threshold)
{
- if (analysis->get_soft_thres() != threshold) {
- analysis->set_soft_thres(threshold);
+ if (analysis->get_soft_threshold() != threshold) {
+ analysis->set_soft_threshold(threshold);
analysis->nway();
updateLinks();
update();