para_file.close();
soft_thres = threshold;
- cout << "nway mupa: analysis_name = " << analysis_name << " seq_num = " << seq_num;
- cout << " window = " << window << " threshold = " << threshold << endl;
+ cout << "nway mupa: analysis_name = " << analysis_name
+ << " seq_num = " << seq_num
+ << " window = " << window
+ << " threshold = " << threshold << endl;
return "";
}
*/
{
aSeq.load_fasta(*seq_files_i, *fasta_indices_i,*seq_starts_i, *seq_ends_i);
- aSeq.load_annot(*annot_files_i, *seq_starts_i, *seq_ends_i);
+ if (annot_files_i->size() > 0)
+ aSeq.load_annot(*annot_files_i, *seq_starts_i, *seq_ends_i);
the_Seqs.push_back(aSeq);
cout << aSeq.get_header() << endl;
string save_file_string;
empty_FLP_vector.clear();
- for(i = 0; i < seq_num; i++)
+ for(i = 0; i < the_Seqs.size(); i++)
{
all_comps.push_back(empty_FLP_vector);
- for(i2 = 0; i2 < seq_num; i2++)
+ for(i2 = 0; i2 < the_Seqs.size(); i2++)
all_comps[i].push_back(dummy_comp);
}
- for(i = 0; i < seq_num; i++)
+ for(i = 0; i < the_Seqs.size(); i++)
seq_lens.push_back(the_Seqs[i].len());
- for(i = 0; i < seq_num; i++)
- for(i2 = i+1; i2 < seq_num; i2++)
+ for(i = 0; i < the_Seqs.size(); i++)
+ for(i2 = i+1; i2 < the_Seqs.size(); i2++)
{
cout << "seqcomping: " << i << " v. " << i2 << endl;
all_comps[i][i2].setup("m", window, threshold, seq_lens[i],seq_lens[i2]);
}
}
-
-
void
Mussa::nway()
{
{
//unlike other methods, entropy needs to look at the sequence at this stage
some_Seqs.clear();
- for(i = 0; i < seq_num; i++)
+ for(i = 0; i < the_Seqs.size(); i++)
some_Seqs.push_back(the_Seqs[i].get_seq());
the_paths.setup_ent(ent_thres, some_Seqs); // ent analysis extra setup
save_file << "<Mussa_Sequence>" << endl;
//save_file.close();
- for(i = 0; i < seq_num; i++)
+ for(i = 0; i < the_Seqs.size(); i++)
the_Seqs[i].save(save_file);
//save_file.open(save_path.c_str(), ios::app);
//save_path = file_path_base + save_name + "/" + save_name + ".muway"; //os X
the_paths.save(save_path);
- for(i = 0; i < seq_num; i++)
- for(i2 = i+1; i2 < seq_num; i2++)
+ for(i = 0; i < the_Seqs.size(); i++)
+ for(i2 = i+1; i2 < the_Seqs.size(); i2++)
{
append_info.str("");
append_info << "_sp_" << i << "v" << i2;
save_file.open(analysis_name.c_str(), ios::out);
- for(i = 0; i < seq_num; i++)
+ for(i = 0; i < the_Seqs.size(); i++)
save_file << the_Seqs[i].get_seq() << endl;
save_file << window << endl;
enum analysis_modes get_analysis_mode() const;
//! return a string name for an analysis mode
std::string get_analysis_mode_name() const;
+ //! actually run the nway comparison
+ void nway();
//! appends a string sequence to the list of the_Seqs
void add_a_seq(std::string a_seq);
//! loads sequence and annotations from fasta and annotation file
void load_sequence_data();
void seqcomp();
- /*! actually run the nway comparison
- * it appears there are 4 modes, t (trans_path_search),
- * r (radiate_path_search), e (entropy_path_search), and
- * o, (find_paths_r (old recursive analysis))
- */
- void nway();
};
#endif
if (err_msg == "")
{
// relabel window with the analysis name
- window_name = "Mussa: " + an_analysis->analysis_name;
+ window_name = "Mussa: " + an_analysis->get_name();
label((const char*)window_name.c_str());
// show the user the analysis
- conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num,
- an_analysis->window, &(an_analysis->the_Seqs),
+ conn_box->setup(an_analysis->get_name(), an_analysis->seq_num,
+ an_analysis->get_window(), &(an_analysis->the_Seqs),
&(an_analysis->the_paths));
conn_box->scale_paths();
}
if (err_msg == "")
{
// relabel window with the analysis name
- window_name = "Mussa: " + an_analysis->analysis_name;
+ window_name = "Mussa: " + an_analysis->get_name();
label((const char*)window_name.c_str());
// show the user the analysis
- conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num,
- an_analysis->window, &(an_analysis->the_Seqs),
+ conn_box->setup(an_analysis->get_name(), an_analysis->seq_num,
+ an_analysis->get_window(), &(an_analysis->the_Seqs),
&(an_analysis->the_paths));
conn_box->scale_paths();
}
if (setup_win->done())
{
// relabel window with the analysis name
- window_name = "Mussa: " + an_analysis->analysis_name;
+ window_name = "Mussa: " + an_analysis->get_name();
label((const char*)window_name.c_str());
// is it this easy? what if setup window encounters an error...??
- conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num,
- an_analysis->window, &(an_analysis->the_Seqs),
+ conn_box->setup(an_analysis->get_name(), an_analysis->seq_num,
+ an_analysis->get_window(), &(an_analysis->the_Seqs),
&(an_analysis->the_paths));
conn_box->scale_paths();
if (subana_win->done())
{
- subana_name = "SubMussa: " + sub_analysis->analysis_name;
+ subana_name = "SubMussa: " + sub_analysis->get_name();
sub_conn_win = new ConnWindow(w(), h(), (const char*) subana_name.c_str());
cout << "Like a warm day in may\n";
sub_conn_win->add_ana(sub_analysis);
string save_path;
ostringstream append_info;
- save_path = an_analysis->analysis_name + "/"
- + an_analysis->analysis_name.substr(0,an_analysis->analysis_name.find("_t"));
+ save_path = an_analysis->get_name() + "/"
+ + an_analysis->get_name().substr(0,an_analysis->get_name().find("_t"));
append_info.str("");
append_info << "_t" << new_soft_thres << ".muway";
//<< "_w" << an_analysis->window
an_analysis = the_ana;
// relabel window with the analysis name
- window_name = "Mussa: " + an_analysis->analysis_name;
+ window_name = "Mussa: " + an_analysis->get_name();
label((const char*)window_name.c_str());
- conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num,
- an_analysis->window, &(an_analysis->the_Seqs),
+ conn_box->setup(an_analysis->get_name(), an_analysis->seq_num,
+ an_analysis->get_window(), &(an_analysis->the_Seqs),
&(an_analysis->the_paths));
conn_box->scale_paths();
}
#include "SetupWindow.hh"
-#include "mussa_class.hh"
+#include "alg/mussa_class.hh"
#include <iostream>
#include <FL/Fl_File_Chooser.H>
#include "SubAnalysisWindow.hh"
+#include "alg/mussa_class.hh"
#include <iostream>
using namespace std;
BOOST_CHECK_EQUAL( m.get_analysis_mode_name(), "[deprecated] Recursive" );
}
+#include <unistd.h>
+BOOST_AUTO_TEST_CASE( mussa_load_mupa )
+{
+ Mussa m;
+ chdir( "examples" );
+ m.load_mupa_file( "mck3test.mupa" );
+ m.analyze(30, 25);
+ chdir( ".." );
+}