Commits

James Taylor  committed 4bf1f32

Add chrom to intersection.Interval since it is used in a few places (wrongly)

  • Participants
  • Parent commits 0129222

Comments (0)

Files changed (2)

File lib/bx/intervals/intersection.c

-/* Generated by Cython 0.11.1 on Mon Apr 27 13:39:35 2009 */
+/* Generated by Cython 0.11.1 on Tue Apr 28 12:23:04 2009 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *croot;
 };
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":307
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":308
  *         return cmp( self.start, other.start ) or cmp( self.end, other.end )
  * 
  * cdef class IntervalTree:             # <<<<<<<<<<<<<<
   int start;
   int end;
   PyObject *value;
+  PyObject *chrom;
   PyObject *strand;
 };
 
 static PyObject *__pyx_kp_func;
 static char __pyx_k_value[] = "value";
 static PyObject *__pyx_kp_value;
+static char __pyx_k_chrom[] = "chrom";
+static PyObject *__pyx_kp_chrom;
 static char __pyx_k_strand[] = "strand";
 static PyObject *__pyx_kp_strand;
 static char __pyx_k_other[] = "other";
 }
 
 /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":290
- *     cdef public object value, strand
- * 
- *     def __init__(self, int start, int end, object value=None, object strand=None ):             # <<<<<<<<<<<<<<
+ *     cdef public object value, chrom, strand
+ * 
+ *     def __init__(self, int start, int end, object value=None, object chrom=None, object strand=None ):             # <<<<<<<<<<<<<<
  *         assert start <= end, "start must be less than end"
  *         self.start  = start
  */
   int __pyx_v_start;
   int __pyx_v_end;
   PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_chrom = 0;
   PyObject *__pyx_v_strand = 0;
   int __pyx_r;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_start,&__pyx_kp_end,&__pyx_kp_value,&__pyx_kp_strand,0};
+  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_start,&__pyx_kp_end,&__pyx_kp_value,&__pyx_kp_chrom,&__pyx_kp_strand,0};
   __Pyx_SetupRefcountContext("__init__");
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
-    PyObject* values[4] = {0,0,0,0};
+    PyObject* values[5] = {0,0,0,0,0};
     values[2] = Py_None;
     values[3] = Py_None;
+    values[4] = Py_None;
     switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_end);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
       if (kw_args > 1) {
       }
       case  3:
       if (kw_args > 1) {
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_chrom);
+        if (unlikely(value)) { values[3] = value; kw_args--; }
+      }
+      case  4:
+      if (kw_args > 1) {
         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_strand);
-        if (unlikely(value)) { values[3] = value; kw_args--; }
+        if (unlikely(value)) { values[4] = value; kw_args--; }
       }
     }
     if (unlikely(kw_args > 0)) {
     __pyx_v_start = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_end = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_value = values[2];
-    __pyx_v_strand = values[3];
+    __pyx_v_chrom = values[3];
+    __pyx_v_strand = values[4];
   } else {
     __pyx_v_value = Py_None;
+    __pyx_v_chrom = Py_None;
     __pyx_v_strand = Py_None;
     switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  5:
+      __pyx_v_strand = PyTuple_GET_ITEM(__pyx_args, 4);
       case  4:
-      __pyx_v_strand = PyTuple_GET_ITEM(__pyx_args, 3);
+      __pyx_v_chrom = PyTuple_GET_ITEM(__pyx_args, 3);
       case  3:
       __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 2);
       case  2:
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.Interval.__init__");
   return -1;
 
   /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":291
  * 
- *     def __init__(self, int start, int end, object value=None, object strand=None ):
+ *     def __init__(self, int start, int end, object value=None, object chrom=None, object strand=None ):
  *         assert start <= end, "start must be less than end"             # <<<<<<<<<<<<<<
  *         self.start  = start
  *         self.end   = end
   #endif
 
   /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":292
- *     def __init__(self, int start, int end, object value=None, object strand=None ):
+ *     def __init__(self, int start, int end, object value=None, object chrom=None, object strand=None ):
  *         assert start <= end, "start must be less than end"
  *         self.start  = start             # <<<<<<<<<<<<<<
  *         self.end   = end
  *         self.start  = start
  *         self.end   = end             # <<<<<<<<<<<<<<
  *         self.value = value
- *         self.strand = strand
+ *         self.chrom = chrom
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->end = __pyx_v_end;
 
  *         self.start  = start
  *         self.end   = end
  *         self.value = value             # <<<<<<<<<<<<<<
+ *         self.chrom = chrom
  *         self.strand = strand
- * 
  */
   __Pyx_INCREF(__pyx_v_value);
   __Pyx_GIVEREF(__pyx_v_value);
   /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":295
  *         self.end   = end
  *         self.value = value
+ *         self.chrom = chrom             # <<<<<<<<<<<<<<
+ *         self.strand = strand
+ * 
+ */
+  __Pyx_INCREF(__pyx_v_chrom);
+  __Pyx_GIVEREF(__pyx_v_chrom);
+  __Pyx_GOTREF(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->chrom);
+  __Pyx_DECREF(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->chrom);
+  ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->chrom = __pyx_v_chrom;
+
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":296
+ *         self.value = value
+ *         self.chrom = chrom
  *         self.strand = strand             # <<<<<<<<<<<<<<
  * 
  *     def __repr__(self):
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":297
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":298
  *         self.strand = strand
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
   __Pyx_SetupRefcountContext("__repr__");
   __pyx_v_fstr = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":298
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":299
  * 
  *     def __repr__(self):
  *         fstr = "Interval(%d, %d" % (self.start, self.end)             # <<<<<<<<<<<<<<
  *         if not self.value is None:
  *             fstr += ", value=" + str(self.value)
  */
-  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_1 = 0;
   __pyx_t_2 = 0;
-  __pyx_t_2 = PyNumber_Remainder(__pyx_kp_8, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyNumber_Remainder(__pyx_kp_8, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_v_fstr);
   __pyx_v_fstr = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":299
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":300
  *     def __repr__(self):
  *         fstr = "Interval(%d, %d" % (self.start, self.end)
  *         if not self.value is None:             # <<<<<<<<<<<<<<
   __pyx_t_5 = (!__pyx_t_4);
   if (__pyx_t_5) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":300
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":301
  *         fstr = "Interval(%d, %d" % (self.start, self.end)
  *         if not self.value is None:
  *             fstr += ", value=" + str(self.value)             # <<<<<<<<<<<<<<
  *         fstr += ")"
  *         return fstr
  */
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
     __Pyx_INCREF(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->value);
     PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->value);
     __Pyx_GIVEREF(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->value);
-    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    __pyx_t_2 = PyNumber_Add(__pyx_kp_9, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_9, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_fstr, __pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_fstr, __pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_v_fstr);
   }
   __pyx_L5:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":301
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":302
  *         if not self.value is None:
  *             fstr += ", value=" + str(self.value)
  *         fstr += ")"             # <<<<<<<<<<<<<<
  *         return fstr
  * 
  */
-  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_fstr, __pyx_kp_10); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_fstr, __pyx_kp_10); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
   __Pyx_DECREF(__pyx_v_fstr);
   __pyx_v_fstr = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":302
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":303
  *             fstr += ", value=" + str(self.value)
  *         fstr += ")"
  *         return fstr             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":304
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":305
  *         return fstr
  * 
  *     def __cmp__(self, other):             # <<<<<<<<<<<<<<
   int __pyx_t_6;
   __Pyx_SetupRefcountContext("__cmp__");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":305
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":306
  * 
  *     def __cmp__(self, other):
  *         return cmp( self.start, other.start ) or cmp( self.end, other.end )             # <<<<<<<<<<<<<<
  * 
  * cdef class IntervalTree:
  */
-  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_1 = 0;
   __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (!__pyx_t_4) {
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_kp_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_kp_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_1);
     __pyx_t_3 = 0;
     __pyx_t_1 = 0;
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
     __pyx_t_5 = __pyx_t_1;
     __pyx_t_5 = __pyx_t_2;
     __pyx_t_2 = 0;
   }
-  __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_r = __pyx_t_6;
   goto __pyx_L0;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":365
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":366
  *     cdef IntervalNode root
  * 
  *     def __cinit__( self ):             # <<<<<<<<<<<<<<
   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":366
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":367
  * 
  *     def __cinit__( self ):
  *         root = None             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":370
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":371
  *     # ---- Position based interfaces -----------------------------------------
  * 
  *     def insert( self, int start, int end, object value=None ):             # <<<<<<<<<<<<<<
       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_end);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
       if (kw_args > 1) {
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "insert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "insert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
-    __pyx_v_start = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_end = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_start = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_end = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_value = values[2];
   } else {
     __pyx_v_value = Py_None;
       case  3:
       __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 2);
       case  2:
-      __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       break;
       default: goto __pyx_L5_argtuple_error;
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("insert", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.insert");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":374
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":375
  *         Insert the interval [start,end) associated with value `value`.
  *         """
  *         if self.root is None:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root) == Py_None);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":375
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":376
  *         """
  *         if self.root is None:
  *             self.root = IntervalNode( start, end, value )             # <<<<<<<<<<<<<<
  *         else:
  *             self.root = self.root.insert( start, end, value )
  */
-    __pyx_t_2 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
     __Pyx_GIVEREF(__pyx_t_2);
     __Pyx_GIVEREF(__pyx_v_value);
     __pyx_t_2 = 0;
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalNode)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalNode)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_2bx_9intervals_12intersection_IntervalNode))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_2bx_9intervals_12intersection_IntervalNode))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GIVEREF(__pyx_t_3);
     __Pyx_GOTREF(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root);
     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root));
   }
   /*else*/ {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":377
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":378
  *             self.root = IntervalNode( start, end, value )
  *         else:
  *             self.root = self.root.insert( start, end, value )             # <<<<<<<<<<<<<<
  * 
  *     add = insert
  */
-    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->insert(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_start, __pyx_v_end, __pyx_v_value, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->insert(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_start, __pyx_v_end, __pyx_v_value, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_3);
     __Pyx_GOTREF(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root);
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":382
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":383
  * 
  * 
  *     def find( self, start, end ):             # <<<<<<<<<<<<<<
       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_end);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("find", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("find", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_start = values[0];
     __pyx_v_end = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("find", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("find", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.find");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":386
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":387
  *         Return a sorted list of all intervals overlapping [start,end).
  *         """
  *         return self.root.find( start, end )             # <<<<<<<<<<<<<<
  *     def before( self, position, num_intervals=1, max_dist=2500 ):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root), __pyx_kp_find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root), __pyx_kp_find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
   __Pyx_INCREF(__pyx_v_start);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start);
   __Pyx_INCREF(__pyx_v_end);
   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end);
   __Pyx_GIVEREF(__pyx_v_end);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":388
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":389
  *         return self.root.find( start, end )
  * 
  *     def before( self, position, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "before") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "before") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_position = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("before", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("before", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.before");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":393
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":394
  *         further than `max_dist` positions aways
  *         """
  *         return self.root.left( position, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *     def after( self, position, num_intervals=1, max_dist=2500 ):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_1.__pyx_n = 2;
   __pyx_1.n = __pyx_t_1;
   __pyx_1.max_dist = __pyx_t_2;
-  __pyx_t_3 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":395
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":396
  *         return self.root.left( position, num_intervals, max_dist )
  * 
  *     def after( self, position, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "after") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "after") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_position = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("after", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("after", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.after");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":400
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":401
  *         further than `max_dist` positions aways
  *         """
  *         return self.root.right( position, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *     # ---- Interval-like object based interfaces -----------------------------
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_1.__pyx_n = 2;
   __pyx_1.n = __pyx_t_1;
   __pyx_1.max_dist = __pyx_t_2;
-  __pyx_t_3 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":404
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":405
  *     # ---- Interval-like object based interfaces -----------------------------
  * 
  *     def insert_interval( self, interval ):             # <<<<<<<<<<<<<<
   PyObject *__pyx_t_4 = NULL;
   __Pyx_SetupRefcountContext("insert_interval");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":409
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":410
  *         attributes)
  *         """
  *         self.insert( interval.start, interval.end, interval )             # <<<<<<<<<<<<<<
  * 
  *     add_interval = insert_interval
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_2);
   __Pyx_GIVEREF(__pyx_v_interval);
   __pyx_t_2 = 0;
   __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":413
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":414
  *     add_interval = insert_interval
  * 
  *     def before_interval( self, interval, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "before_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "before_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_interval = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("before_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("before_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.before_interval");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":418
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":419
  *         and are no further than `max_dist` positions aways
  *         """
  *         return self.root.left( interval.start, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *     def after_interval( self, interval, num_intervals=1, max_dist=2500 ):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_1.__pyx_n = 2;
   __pyx_1.n = __pyx_t_2;
   __pyx_1.max_dist = __pyx_t_3;
-  __pyx_t_4 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_4;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":420
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":421
  *         return self.root.left( interval.start, num_intervals, max_dist )
  * 
  *     def after_interval( self, interval, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "after_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "after_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_interval = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("after_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("after_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.after_interval");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":425
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":426
  *         are no further than `max_dist` positions aways
  *         """
  *         return self.root.right( interval.end, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *     def upstream_of_interval( self, interval, num_intervals=1, max_dist=2500 ):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_1.__pyx_n = 2;
   __pyx_1.n = __pyx_t_2;
   __pyx_1.max_dist = __pyx_t_3;
-  __pyx_t_4 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_4;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":427
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":428
  *         return self.root.right( interval.end, num_intervals, max_dist )
  * 
  *     def upstream_of_interval( self, interval, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "upstream_of_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "upstream_of_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_interval = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("upstream_of_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("upstream_of_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.upstream_of_interval");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":432
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":433
  *         `interval` and are no further than `max_dist` positions aways
  *         """
  *         if interval.strand == -1 or interval.strand == "-":             # <<<<<<<<<<<<<<
  *             return self.root.right( interval.end, num_intervals, max_dist )
  *         else:
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!__pyx_t_3) {
-    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_11, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_11, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = __pyx_t_4;
   } else {
   }
   if (__pyx_t_5) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":433
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":434
  *         """
  *         if interval.strand == -1 or interval.strand == "-":
  *             return self.root.right( interval.end, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *             return self.root.left( interval.start, num_intervals, max_dist )
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_1.__pyx_n = 2;
     __pyx_1.n = __pyx_t_6;
     __pyx_1.max_dist = __pyx_t_7;
-    __pyx_t_2 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_2;
   }
   /*else*/ {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":435
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":436
  *             return self.root.right( interval.end, num_intervals, max_dist )
  *         else:
  *             return self.root.left( interval.start, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *     def downstream_of_interval( self, interval, num_intervals=1, max_dist=2500 ):
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_2.__pyx_n = 2;
     __pyx_2.n = __pyx_t_7;
     __pyx_2.max_dist = __pyx_t_6;
-    __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_2, 0, &__pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_2, 0, &__pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __pyx_t_1;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":437
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":438
  *             return self.root.left( interval.start, num_intervals, max_dist )
  * 
  *     def downstream_of_interval( self, interval, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "downstream_of_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "downstream_of_interval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_interval = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("downstream_of_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("downstream_of_interval", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.downstream_of_interval");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":442
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":443
  *         `interval` and are no further than `max_dist` positions aways
  *         """
  *         if interval.strand == -1 or interval.strand == "-":             # <<<<<<<<<<<<<<
  *             return self.root.left( interval.start, num_intervals, max_dist )
  *         else:
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (!__pyx_t_3) {
-    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_strand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_12, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_12, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = __pyx_t_4;
   } else {
   }
   if (__pyx_t_5) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":443
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":444
  *         """
  *         if interval.strand == -1 or interval.strand == "-":
  *             return self.root.left( interval.start, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *             return self.root.right( interval.end, num_intervals, max_dist )
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_1.__pyx_n = 2;
     __pyx_1.n = __pyx_t_6;
     __pyx_1.max_dist = __pyx_t_7;
-    __pyx_t_2 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_1, 0, &__pyx_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_2;
   }
   /*else*/ {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":445
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":446
  *             return self.root.left( interval.start, num_intervals, max_dist )
  *         else:
  *             return self.root.right( interval.end, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  *     def traverse(self, fn):
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_2.__pyx_n = 2;
     __pyx_2.n = __pyx_t_7;
     __pyx_2.max_dist = __pyx_t_6;
-    __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_2, 0, &__pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_t_2, 0, &__pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __pyx_t_1;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":447
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":448
  *             return self.root.right( interval.end, num_intervals, max_dist )
  * 
  *     def traverse(self, fn):             # <<<<<<<<<<<<<<
   PyObject *__pyx_t_3 = NULL;
   __Pyx_SetupRefcountContext("traverse");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":451
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":452
  *         call fn for each element in the tree
  *         """
  *         return self.root.traverse(fn)             # <<<<<<<<<<<<<<
  * # For backward compatibility
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root), __pyx_kp_traverse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root), __pyx_kp_traverse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
   __Pyx_INCREF(__pyx_v_fn);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fn);
   __Pyx_GIVEREF(__pyx_v_fn);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   if (!o) return 0;
   p = ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)o);
   p->value = Py_None; Py_INCREF(Py_None);
+  p->chrom = Py_None; Py_INCREF(Py_None);
   p->strand = Py_None; Py_INCREF(Py_None);
   return o;
 }
 static void __pyx_tp_dealloc_2bx_9intervals_12intersection_Interval(PyObject *o) {
   struct __pyx_obj_2bx_9intervals_12intersection_Interval *p = (struct __pyx_obj_2bx_9intervals_12intersection_Interval *)o;
   Py_XDECREF(p->value);
+  Py_XDECREF(p->chrom);
   Py_XDECREF(p->strand);
   (*Py_TYPE(o)->tp_free)(o);
 }
   if (p->value) {
     e = (*v)(p->value, a); if (e) return e;
   }
+  if (p->chrom) {
+    e = (*v)(p->chrom, a); if (e) return e;
+  }
   if (p->strand) {
     e = (*v)(p->strand, a); if (e) return e;
   }
   tmp = ((PyObject*)p->value);
   p->value = Py_None; Py_INCREF(Py_None);
   Py_XDECREF(tmp);
+  tmp = ((PyObject*)p->chrom);
+  p->chrom = Py_None; Py_INCREF(Py_None);
+  Py_XDECREF(tmp);
   tmp = ((PyObject*)p->strand);
   p->strand = Py_None; Py_INCREF(Py_None);
   Py_XDECREF(tmp);
   {(char *)"start", T_INT, offsetof(struct __pyx_obj_2bx_9intervals_12intersection_Interval, start), 0, 0},
   {(char *)"end", T_INT, offsetof(struct __pyx_obj_2bx_9intervals_12intersection_Interval, end), 0, 0},
   {(char *)"value", T_OBJECT, offsetof(struct __pyx_obj_2bx_9intervals_12intersection_Interval, value), 0, 0},
+  {(char *)"chrom", T_OBJECT, offsetof(struct __pyx_obj_2bx_9intervals_12intersection_Interval, chrom), 0, 0},
   {(char *)"strand", T_OBJECT, offsetof(struct __pyx_obj_2bx_9intervals_12intersection_Interval, strand), 0, 0},
   {0, 0, 0, 0, 0}
 };
   {&__pyx_kp_max_dist, __pyx_k_max_dist, sizeof(__pyx_k_max_dist), 1, 1, 1},
   {&__pyx_kp_func, __pyx_k_func, sizeof(__pyx_k_func), 1, 1, 1},
   {&__pyx_kp_value, __pyx_k_value, sizeof(__pyx_k_value), 1, 1, 1},
+  {&__pyx_kp_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 1, 1, 1},
   {&__pyx_kp_strand, __pyx_k_strand, sizeof(__pyx_k_strand), 1, 1, 1},
   {&__pyx_kp_other, __pyx_k_other, sizeof(__pyx_k_other), 1, 1, 1},
   {&__pyx_kp_num_intervals, __pyx_k_num_intervals, sizeof(__pyx_k_num_intervals), 1, 1, 1},
   {0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_kp_cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_kp_cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
   if (PyType_Ready(&__pyx_type_2bx_9intervals_12intersection_Interval) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (__Pyx_SetAttrString(__pyx_m, "Interval", (PyObject *)&__pyx_type_2bx_9intervals_12intersection_Interval) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_ptype_2bx_9intervals_12intersection_Interval = &__pyx_type_2bx_9intervals_12intersection_Interval;
-  if (PyType_Ready(&__pyx_type_2bx_9intervals_12intersection_IntervalTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IntervalTree", (PyObject *)&__pyx_type_2bx_9intervals_12intersection_IntervalTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyType_Ready(&__pyx_type_2bx_9intervals_12intersection_IntervalTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__Pyx_SetAttrString(__pyx_m, "IntervalTree", (PyObject *)&__pyx_type_2bx_9intervals_12intersection_IntervalTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_ptype_2bx_9intervals_12intersection_IntervalTree = &__pyx_type_2bx_9intervals_12intersection_IntervalTree;
   /*--- Type import code ---*/
   /*--- Function import code ---*/
   __pyx_v_2bx_9intervals_12intersection_EmptyNode = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":379
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":380
  *             self.root = self.root.insert( start, end, value )
  * 
  *     add = insert             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_1 = __Pyx_GetName((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree, __pyx_kp_insert); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree, __pyx_kp_insert); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree->tp_dict, __pyx_kp_add, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree->tp_dict, __pyx_kp_add, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   PyType_Modified(__pyx_ptype_2bx_9intervals_12intersection_IntervalTree);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":411
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":412
  *         self.insert( interval.start, interval.end, interval )
  * 
  *     add_interval = insert_interval             # <<<<<<<<<<<<<<
  * 
  *     def before_interval( self, interval, num_intervals=1, max_dist=2500 ):
  */
-  __pyx_1 = __Pyx_GetName((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree, __pyx_kp_insert_interval); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree, __pyx_kp_insert_interval); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree->tp_dict, __pyx_kp_add_interval, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree->tp_dict, __pyx_kp_add_interval, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   PyType_Modified(__pyx_ptype_2bx_9intervals_12intersection_IntervalTree);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":454
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":455
  * 
  * # For backward compatibility
  * Intersecter = IntervalTree             # <<<<<<<<<<<<<<
  */
-  if (PyObject_SetAttr(__pyx_m, __pyx_kp_Intersecter, ((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_kp_Intersecter, ((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalTree))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_1);

File lib/bx/intervals/intersection.pyx

 
     """
     cdef public int start, end
-    cdef public object value, strand
+    cdef public object value, chrom, strand
 
-    def __init__(self, int start, int end, object value=None, object strand=None ):
+    def __init__(self, int start, int end, object value=None, object chrom=None, object strand=None ):
         assert start <= end, "start must be less than end"
         self.start  = start
         self.end   = end
         self.value = value
+        self.chrom = chrom
         self.strand = strand
 
     def __repr__(self):