+#include <boost/iterator.hpp>
+
+#include <boost/python.hpp>
+#include <boost/python/return_value_policy.hpp>
+
+#include <boost/python/register_ptr_to_python.hpp>
+using namespace boost::python;
+
+#include "alg/seq_span.hpp"
+
+#include "stl_container_adapter.hpp"
+
+void export_seq_span()
+{
+ enum_<SeqSpan::strand_type>("strand_type")
+ .value("unknown", SeqSpan::UnknownStrand)
+ .value("minus", SeqSpan::MinusStrand)
+ .value("plus", SeqSpan::PlusStrand)
+ .value("both", SeqSpan::BothStrand)
+ .value("same", SeqSpan::SameStrand)
+ .value("opposite", SeqSpan::OppositeStrand)
+ .value("single", SeqSpan::SingleStrand)
+ ;
+
+
+ class_<SeqSpan>("SeqSpan",
+ init<std::string, optional<AlphabetRef,
+ SeqSpan::strand_type>
+ >() )
+ .def("__len__", &SeqSpan::size)
+ .def("__getitem__", &std_item<SeqSpan>::get_const,
+ return_value_policy<copy_const_reference>())
+ .def("__str__", &SeqSpan::sequence)
+ .def("empty", &SeqSpan::empty)
+ .add_property("start", &SeqSpan::start, &SeqSpan::setStart,
+ "start position relative to root sequence")
+ .add_property("stop", &SeqSpan::stop, &SeqSpan::setStop,
+ "one past the last position relative to the root sequence.")
+ .add_property("strand", &SeqSpan::strand,
+ "describe which strand the span is on")
+
+ .add_property("parentStart", &SeqSpan::parentStart, &SeqSpan::setParentStart,
+ "start position relative to parent sequence")
+ .add_property("parentStop", &SeqSpan::parentStop, &SeqSpan::setParentStop,
+ "one past the last position relative to the parent sequence.")
+ .add_property("parent", &SeqSpan::parent)
+
+ .def("subseq", &SeqSpan::subseq)
+ ;
+
+ register_ptr_to_python< boost::shared_ptr<SeqSpan> >();
+}