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