1 #include <boost/iterator.hpp>
3 #include <boost/python.hpp>
4 #include <boost/python/return_value_policy.hpp>
6 #include <boost/python/register_ptr_to_python.hpp>
7 using namespace boost::python;
9 #include "alg/seq_span.hpp"
11 #include "stl_container_adapter.hpp"
13 void export_seq_span()
15 enum_<SeqSpan::strand_type>("strand_type")
16 .value("unknown", SeqSpan::UnknownStrand)
17 .value("minus", SeqSpan::MinusStrand)
18 .value("plus", SeqSpan::PlusStrand)
19 .value("both", SeqSpan::BothStrand)
20 .value("same", SeqSpan::SameStrand)
21 .value("opposite", SeqSpan::OppositeStrand)
22 .value("single", SeqSpan::SingleStrand)
26 class_<SeqSpan>("SeqSpan",
27 init<std::string, optional<AlphabetRef,
30 .def("__len__", &SeqSpan::size)
31 .def("__getitem__", &std_item<SeqSpan>::get_const,
32 return_value_policy<copy_const_reference>())
33 .def("__str__", &SeqSpan::sequence)
34 .def("empty", &SeqSpan::empty)
35 .add_property("start", &SeqSpan::start, &SeqSpan::setStart,
36 "start position relative to root sequence")
37 .add_property("stop", &SeqSpan::stop, &SeqSpan::setStop,
38 "one past the last position relative to the root sequence.")
39 .add_property("strand", &SeqSpan::strand,
40 "describe which strand the span is on")
42 .add_property("parentStart", &SeqSpan::parentStart, &SeqSpan::setParentStart,
43 "start position relative to parent sequence")
44 .add_property("parentStop", &SeqSpan::parentStop, &SeqSpan::setParentStop,
45 "one past the last position relative to the parent sequence.")
46 .add_property("parent", &SeqSpan::parent)
48 .def("subseq", &SeqSpan::subseq)
51 register_ptr_to_python< boost::shared_ptr<SeqSpan> >();