add callback for tracking analysis progress
[mussa.git] / py / mussa.cpp
1 #include <boost/python.hpp>
2
3 using namespace boost::python;
4
5 #include "alg/mussa.hpp"
6
7 void export_mussa()
8 {
9   void (Mussa::*load_mupa_string)(std::string) = &Mussa::load_mupa_file;
10
11   class_<Mussa>("Mussa")
12     .def("save", &Mussa::save)
13     .def("load", &Mussa::load, "Load previous run analysis")
14     .def("load_mupa", load_mupa_string, "Load mussa parameter file")
15     .def("clear", &Mussa::clear, "Clear the current analysis")
16     .add_property("name", &Mussa::get_name, &Mussa::set_name)
17     .def("size", &Mussa::size, "Number of sequences to be used "
18                                "in this analysis")
19     .add_property("window", &Mussa::get_window, &Mussa::set_window,
20                   "the number of base pairs in the sliding window")
21     .add_property("threshold", &Mussa::get_threshold, &Mussa::set_threshold,
22                   "how many base pairs must match between two windows")
23     .def("softThreshold", &Mussa::set_soft_threshold)
24     .add_property("analysisMode", &Mussa::get_analysis_mode, 
25                                    &Mussa::set_analysis_mode)
26     .add_property("analysisModeName", &Mussa::get_analysis_mode_name)
27     .def("analyze", &Mussa::analyze, "Run the analysis")
28     .def("paths", &Mussa::paths, return_internal_reference<>())
29     //.def("sequences", &Mussa::sequences)
30     .def("addSequence", &Mussa::add_a_seq)  ;
31
32   enum_<Mussa::analysis_modes>("analysis_modes")
33     .value("TransitiveNway", Mussa::TransitiveNway )
34     .value("RadialNway", Mussa::RadialNway )
35     .value("EntropyNway", Mussa::EntropyNway )
36     .value("RecursiveNway", Mussa::RecursiveNway )
37   ;
38 }