Store Sequence sequence location in a shared_ptr class
[mussa.git] / py / nway_paths.cpp
1 #include <boost/python.hpp>
2 namespace py = boost::python;
3
4 #include "alg/nway_paths.hpp"
5
6 void export_nway_paths()
7 {
8   /*py::class_<NwayPaths::ConservedPaths>("ConservedPaths")
9     .def("__len__", &NwayPaths::ConservedPaths::size, "return length of paths")
10     .def("__contains__", &std_item<NwayPaths::ConservedPaths>::in)
11     .def("__iter__", py::iterator<NwayPaths::ConservedPaths>())
12     .def("clear", &NwayPaths::ConservedPaths::clear, "remove all the paths")
13     .def("append", &std_item<NwayPaths::ConservedPaths>::add,
14         py::with_custodian_and_ward<1,2>()) // to let container keep value
15     .def("__getitem__", &std_item<NwayPaths::ConservedPaths>::get,
16         py::return_value_policy<py::copy_non_const_reference>())
17     .def("__setitem__", &std_item<NwayPaths::ConservedPaths>::set,
18         py::with_custodian_and_ward<1,2>()) // to let container keep value
19     .def("__delitem__", &std_item<NwayPaths::ConservedPaths>::del)
20   ;*/
21  
22    py::class_<NwayPaths>("NwayPaths")
23     .def("__len__", &NwayPaths::size, "number of paths")
24     .def("sequence_count", &NwayPaths::sequence_count,
25          "number of sequences in this analysis")
26     .def("clear", &NwayPaths::clear, "remove all paths")
27     .add_property("threshold", &NwayPaths::get_threshold, "Get hard threshold")
28     .add_property("soft_threshold", &NwayPaths::get_soft_threshold, &NwayPaths::set_soft_threshold)
29     .add_property("window_size", &NwayPaths::get_window)
30     .add_property("pathz", py::range(&NwayPaths::pbegin, &NwayPaths::pend))
31     .def("path_size", &NwayPaths::path_size, "number of nway paths")
32     .add_property("refinedPathz", py::range(&NwayPaths::rpbegin, &NwayPaths::rpend))
33     .def("refined_path_size", &NwayPaths::refined_path_size, 
34          "number of paths that match the soft threshold")
35    ;
36 }
37