allow running without using the gui
[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   //BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(mussa_analyze_overloads, 
10   //                                       &Mussa::analyze, 0, 4);
11
12   class_<Mussa>("Mussa")
13     .def("save", &Mussa::save)
14     .def("load", &Mussa::load, "Load previous run analysis")
15     .def("load_mupa", &Mussa::load_mupa_file, "Load mussa parameter file")
16     .def("clear", &Mussa::clear, "Clear the current analysis")
17     .add_property("name", &Mussa::get_name, &Mussa::set_name)
18     .def("size", &Mussa::size, "Number of sequences to be used "
19                                "in this analysis")
20     .add_property("window", &Mussa::get_window, &Mussa::set_window,
21                   "the number of base pairs in the sliding window")
22     .add_property("threshold", &Mussa::get_threshold, &Mussa::set_threshold,
23                   "how many base pairs must match between two windows")
24     .def("softThreshold", &Mussa::set_soft_thres)
25     .add_property("analysisMode", &Mussa::get_analysis_mode, 
26                                    &Mussa::set_analysis_mode)
27     .add_property("analysisModeName", &Mussa::get_analysis_mode_name)
28     .def("analyze", &Mussa::analyze, "Run the analysis")
29     .def("paths", &Mussa::paths, return_internal_reference<>())
30     //.def("sequences", &Mussa::sequences)
31     .def("addSequence", &Mussa::add_a_seq)  ;
32
33   enum_<Mussa::analysis_modes>("analysis_modes")
34     .value("TransitiveNway", Mussa::TransitiveNway )
35     .value("RadialNway", Mussa::RadialNway )
36     .value("EntropyNway", Mussa::EntropyNway )
37     .value("RecursiveNway", Mussa::RecursiveNway )
38   ;
39 }