// ----------------------------------------
// ---------- mussa_class.cc -----------
// ----------------------------------------
+
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
namespace fs = boost::filesystem;
using namespace std;
-void callback(const std::string& desc, int cur, int end)
-{
- std::cout << "analysis:" << desc << " " << cur << "/" << end << std::endl;
-}
Mussa::Mussa()
{
clear();
+ connect(&the_paths, SIGNAL(progress(const std::string&, int, int)),
+ this, SIGNAL(progress(const std::string&, int, int)));
}
Mussa::Mussa(const Mussa& m)
ana_mode(m.ana_mode),
win_append(m.win_append),
thres_append(m.thres_append),
- analysis_cb(m.analysis_cb),
motif_sequences(m.motif_sequences),
color_mapper(m.color_mapper)
{
+ connect(&the_paths, SIGNAL(progress(const std::string&, int, int)),
+ this, SIGNAL(progress(const std::string&, int, int)));
}
// set all parameters to null state
soft_thres = 0;
win_append = false;
thres_append = false;
- analysis_cb = callback;
motif_sequences.clear();
color_mapper.clear();
+ the_paths.clear();
}
// these 5 simple methods manually set the parameters for doing an analysis
return 0;
}
-
-void Mussa::set_analysis_callback(analysis_callback cb)
-{
- analysis_cb = cb;
-}
-
-analysis_callback Mussa::get_analysis_calback() const
-{
- return analysis_cb;
-}
-
void
Mussa::set_window(int a_window)
{
end = time(NULL);
totaltime = difftime(end, begin);
-
//cout << "seqload\tseqcomp\tnway\tsave\ttotal\n";
//cout << seqloadtime << "\t";
//cout << seqcomptime << "\t";
for(vector<Sequence>::size_type i2 = 0; i2 < the_seqs.size(); i2++)
all_comps[i].push_back(dummy_comp);
}
- for(vector<Sequence>::size_type i = 0; i < the_seqs.size(); i++)
+ for(vector<Sequence>::size_type i = 0; i < the_seqs.size(); i++) {
seq_lens.push_back(the_seqs[i].size());
-
+ }
int seqcomps_done = 0;
int seqcomps_todo = (the_seqs.size() * (the_seqs.size()-1)) / 2;
+ emit progress("seqcomp", seqcomps_done, seqcomps_todo);
for(vector<Sequence>::size_type i = 0; i < the_seqs.size(); i++)
for(vector<Sequence>::size_type i2 = i+1; i2 < the_seqs.size(); i2++)
all_comps[i][i2].seqcomp(the_seqs[i].get_seq(), the_seqs[i2].get_seq(), false);
all_comps[i][i2].seqcomp(the_seqs[i].get_seq(),the_seqs[i2].rev_comp(),true);
++seqcomps_done;
- if (analysis_cb) {
- analysis_cb("seqcomp", seqcomps_done, seqcomps_todo);
- }
+ emit progress("seqcomp", seqcomps_done, seqcomps_todo);
}
}
vector<string> some_Seqs;
the_paths.set_soft_threshold(soft_thres);
- the_paths.set_progress_callback(analysis_cb);
if (ana_mode == TransitiveNway) {
the_paths.trans_path_search(all_comps);