Use CMAKE_BINARY_DIR instead of the very wrong MUSSA_BINARY_DIR
[mussa.git] / py / mussa.cpp
1 #include <boost/python.hpp>
2 namespace py = boost::python;
3
4 #include "alg/mussa.hpp"
5
6 void export_mussa()
7 {
8   void (Mussa::*load_mupa_string)(std::string) = &Mussa::load_mupa_file;
9
10   py::class_<Mussa>("Mussa")
11     .def("save", &Mussa::save)
12     .def("load", &Mussa::load, "Load previous run analysis")
13     .def("load_mupa", load_mupa_string, "Load mussa parameter file")
14     .def("clear", &Mussa::clear, "Clear the current analysis")
15     .add_property("name", &Mussa::get_name, &Mussa::set_name)
16     .def("size", &Mussa::size, "Number of sequences to be used "
17                                "in this analysis")
18     .add_property("window", &Mussa::get_window, &Mussa::set_window,
19                   "the number of base pairs in the sliding window")
20     .add_property("threshold", &Mussa::get_threshold, &Mussa::set_threshold,
21                   "how many base pairs must match between two windows")
22     .def("softThreshold", &Mussa::set_soft_threshold)
23     .add_property("analysisMode", &Mussa::get_analysis_mode, 
24                                    &Mussa::set_analysis_mode)
25     .add_property("analysisModeName", &Mussa::get_analysis_mode_name)
26     .def("analyze", &Mussa::analyze, "Run the analysis")
27     .def("paths", &Mussa::paths, py::return_internal_reference<>())
28     //.def("sequences", &Mussa::sequences)
29     //.def("addSequence", &Mussa::append_sequence)  
30   ;
31
32   py::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 }