LIBEXT := .a
CXX := g++
-CXXFLAGS :=
+CXXFLAGS := -g -fPIC -I/usr/include/python2.3
LDFLAGS :=
CURDIR := $(shell pwd)
void save_old(std::string save_file_path);
void print(std::list<std::vector<int> >&);
+ std::list<ConservedPath>::iterator pbegin() { return pathz.begin() ; }
+ std::list<ConservedPath>::iterator pend() { return pathz.end() ; }
+ std::list<ExtendedConservedPath>::iterator rpbegin() { return refined_pathz.begin() ; }
+ std::list<ExtendedConservedPath>::iterator rpend() { return refined_pathz.end() ; }
// these probably shouldn't be public, but lets start
// simple
std::list<ConservedPath> pathz;
--- /dev/null
+#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
+#include <boost/python.hpp>
+#include <vector>
+using namespace boost::python;
+
+#include "alg/conserved_path.h"
+
+void export_conserved_path()
+{
+
+ class_<std::vector<int> >("intvec")
+ .def(vector_indexing_suite<std::vector<int> >())
+ ;
+
+ class_<ConservedPath>("ConservedPath")
+ .def_readwrite("score", &ConservedPath::score)
+ .def_readwrite("track_indexes", &ConservedPath::track_indexes)
+ //.add_property("track_indexes", //iterator<std::vector<int> >())
+ // range(&ConservedPath::track_indexes.begin(),
+ // &ConservedPath::track_indexes.end()))
+ ;
+
+ class_<ExtendedConservedPath, bases<ConservedPath> >("ExtendedConservedPath")
+ .def_readwrite("window_size", &ExtendedConservedPath::window_size)
+ ;
+}
--- /dev/null
+#include <boost/python.hpp>
+using namespace boost::python;
+
+void export_mussa();
+void export_nway_paths();
+void export_conserved_path();
+
+BOOST_PYTHON_MODULE(mussa)
+{
+ export_mussa();
+ export_nway_paths();
+ export_conserved_path();
+}
--- /dev/null
+CURDIR := $(BASEDIR)py/
+
+SOURCES.cxx := module.cxx \
+ conserved_path.cxx \
+ mussa.cxx \
+ nway_paths.cxx
+
+
+MUSSA_PY_SRC := $(addprefix $(CURDIR), $(SOURCES.cxx))
+MUSSA_PY_OBJ := $(MUSSA_PY_SRC:.cxx=$(OBJEXT))
+
+SRC += $(MUSSA_PY_SRC)
+CXXFLAGS +=
+
+MUSSAPY := $(BASEDIR)/mussa.so
+TARGETBINS += $(MUSSAPY)
+
+$(MUSSAPY): $(MUSSA_PY_OBJ) $(MUSSA_ALG_OBJ)
+ g++ -shared $(CXXFLAGS) -lpython2.3 -lboost_python -o $@ $^
--- /dev/null
+#include <boost/python.hpp>
+
+using namespace boost::python;
+
+#include "alg/mussa_class.hh"
+
+void export_mussa()
+{
+ //BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(mussa_analyze_overloads,
+ // &Mussa::analyze, 0, 4);
+
+ class_<Mussa>("Mussa")
+ .def("save", &Mussa::save)
+ .def("load", &Mussa::load, "Load previous run analysis")
+ .def("load_mupa", &Mussa::load_mupa_file, "Load mussa parameter file")
+ .def("clear", &Mussa::clear, "Clear the current analysis")
+ .add_property("name", &Mussa::get_name, &Mussa::set_name)
+ .def("size", &Mussa::size, "Number of sequences to be used "
+ "in this analysis")
+ .add_property("window", &Mussa::get_window, &Mussa::set_window,
+ "the number of base pairs in the sliding window")
+ .add_property("threshold", &Mussa::get_threshold, &Mussa::set_threshold,
+ "how many base pairs must match between two windows")
+ .def("softThreshold", &Mussa::set_soft_thres)
+ .add_property("analysisMode", &Mussa::get_analysis_mode,
+ &Mussa::set_analysis_mode)
+ .add_property("analysisModeName", &Mussa::get_analysis_mode_name)
+ .def("analyze", &Mussa::analyze)
+ .def("paths", &Mussa::paths, return_internal_reference<>())
+ //.def("sequences", &Mussa::sequences)
+ .def("addSequence", &Mussa::add_a_seq) ;
+
+ enum_<Mussa::analysis_modes>("analysis_modes")
+ .value("TransitiveNway", Mussa::TransitiveNway )
+ .value("RadialNway", Mussa::RadialNway )
+ .value("EntropyNway", Mussa::EntropyNway )
+ .value("RecursiveNway", Mussa::RecursiveNway )
+ ;
+}
--- /dev/null
+#include <boost/python.hpp>
+using namespace boost::python;
+
+#include "alg/nway_paths.hh"
+
+void export_nway_paths()
+{
+ class_<NwayPaths>("NwayPaths")
+ .add_property("pathz", range(&NwayPaths::pbegin,
+ &NwayPaths::pend))
+ .add_property("refinedPathz", range(&NwayPaths::rpbegin,
+ &NwayPaths::rpend))
+ ;
+}
+