Kanwei Li avatar Kanwei Li committed 557f4b7

Added array_tree tests, bump to version 1

Comments (0)

Files changed (3)

lib/bx/arrays/array_tree.c

-/* Generated by Cython 0.11.3 on Mon Sep 28 19:24:07 2009 */
+/* Generated by Cython 0.11.3 on Thu Nov 12 17:39:16 2009 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 static INLINE PY_LONG_LONG __Pyx_pow_PY_LONG_LONG(PY_LONG_LONG, PY_LONG_LONG); /* proto */
 
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
 static INLINE int __Pyx_pow_int(int, int); /* proto */
 
 #if __PYX_USE_C99_COMPLEX
 
 #endif
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
 static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
 static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
   __pyx_e_2bx_6arrays_6wiggle_MODE_VARIABLE
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":199
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":197
  *             return min
  * 
  * cdef class Summary:             # <<<<<<<<<<<<<<
   PyObject *sumsquares;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":211
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":209
  * 
  * cdef class ArrayTreeNode
  * cdef class ArrayTreeLeaf             # <<<<<<<<<<<<<<
   long start_offset;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":119
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":116
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
  * 
  * cdef class FileArrayTree:             # <<<<<<<<<<<<<<
   PyObject *io;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":213
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":211
  * cdef class ArrayTreeLeaf
  * 
  * cdef class ArrayTree:             # <<<<<<<<<<<<<<
   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *root;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":78
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":75
  * 
  * 
  * cdef class FileArrayTreeDict:             # <<<<<<<<<<<<<<
   PyObject *cdb_dict;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":210
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":208
  *     cdef public object sumsquares
  * 
  * cdef class ArrayTreeNode             # <<<<<<<<<<<<<<
 };
 
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":119
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":116
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
  * 
  * cdef class FileArrayTree:             # <<<<<<<<<<<<<<
 static struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *__pyx_vtabptr_2bx_6arrays_10array_tree_FileArrayTree;
 
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":298
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":296
  *         return tree
  * 
  * cdef class ArrayTreeNode:             # <<<<<<<<<<<<<<
 
 /* Implementation of bx.arrays.array_tree */
 static PyObject *__pyx_int_0x310ec7dc;
-static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
 static PyObject *__pyx_int_2147483647;
 static PyObject *__pyx_int_1000;
-static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_3;
 static PyObject *__pyx_int_5;
 static PyObject *__pyx_int_neg_1;
 static PyObject *__pyx_kp_itemsize;
 static char __pyx_k_read_raw_array[] = "read_raw_array";
 static PyObject *__pyx_kp_read_raw_array;
+static char __pyx_k_ValueError[] = "ValueError";
+static PyObject *__pyx_kp_ValueError;
 static char __pyx_k_counts[] = "counts";
 static PyObject *__pyx_kp_counts;
 static char __pyx_k_sums[] = "sums";
 static PyObject *__pyx_kp_maxs;
 static char __pyx_k_sumsquares[] = "sumsquares";
 static PyObject *__pyx_kp_sumsquares;
-static char __pyx_k_49[] = "read_uint64";
-static PyObject *__pyx_kp_49;
+static char __pyx_k_50[] = "read_uint64";
+static PyObject *__pyx_kp_50;
 static char __pyx_k_write[] = "write";
 static PyObject *__pyx_kp_write;
 static char __pyx_k_char[] = "char";
 static PyObject *__pyx_kp_summary;
 static char __pyx_k_write_raw_array[] = "write_raw_array";
 static PyObject *__pyx_kp_write_raw_array;
-static char __pyx_k_53[] = "write_uint64";
-static PyObject *__pyx_kp_53;
+static char __pyx_k_54[] = "write_uint64";
+static PyObject *__pyx_kp_54;
 static char __pyx_k_start_offset[] = "start_offset";
 static PyObject *__pyx_kp_start_offset;
+static PyObject *__pyx_builtin_ValueError;
 static PyObject *__pyx_builtin_range;
 static PyObject *__pyx_builtin_sum;
 static PyObject *__pyx_kp_48;
 static char __pyx_k_48[] = "max < block_size not yet handled";
-static PyObject *__pyx_kp_50;
-static char __pyx_k_50[] = "max < block_size not yet handled";
+static PyObject *__pyx_kp_49;
+static char __pyx_k_49[] = "level must be <= self.levels";
 static PyObject *__pyx_kp_51;
-static char __pyx_k_51[] = "\000\000\000";
+static char __pyx_k_51[] = "max < block_size not yet handled";
 static PyObject *__pyx_kp_52;
-static char __pyx_k_52[] = "Writing without summaries is currently not supported";
+static char __pyx_k_52[] = "\000\000\000";
+static PyObject *__pyx_kp_53;
+static char __pyx_k_53[] = "Writing without summaries is currently not supported";
 static PyObject *__pyx_int_15;
 static char __pyx_k___getbuffer__[] = "__getbuffer__";
 static PyObject *__pyx_kp___getbuffer__;
 static PyObject *__pyx_kp_info;
 static char __pyx_k_flags[] = "flags";
 static PyObject *__pyx_kp_flags;
-static char __pyx_k_ValueError[] = "ValueError";
-static PyObject *__pyx_kp_ValueError;
 static char __pyx_k_RuntimeError[] = "RuntimeError";
 static PyObject *__pyx_kp_RuntimeError;
 static PyObject *__pyx_kp_1;
 static PyObject *__pyx_kp_2;
 static PyObject *__pyx_kp_5;
 static PyObject *__pyx_kp_23;
-static PyObject *__pyx_builtin_ValueError;
 static PyObject *__pyx_builtin_RuntimeError;
 static char __pyx_k_1[] = "ndarray is not C contiguous";
 static char __pyx_k_2[] = "ndarray is not Fortran contiguous";
 static char __pyx_k_29[] = "Format string allocated too short.";
 static char __pyx_k_30[] = "unknown dtype code in numpy.pxd (%d)";
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":61
- * VERSION = 0
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":58
+ * VERSION = 1
  * 
  * def array_tree_dict_from_wiggle_reader( bx.arrays.wiggle.IntervalReader reader, sizes, default_size=2147483647, block_size=1000 ):             # <<<<<<<<<<<<<<
  *     # Create empty array trees
       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_sizes);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("array_tree_dict_from_wiggle_reader", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("array_tree_dict_from_wiggle_reader", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
       if (kw_args > 0) {
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "array_tree_dict_from_wiggle_reader") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "array_tree_dict_from_wiggle_reader") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_reader = ((struct __pyx_obj_2bx_6arrays_6wiggle_IntervalReader *)values[0]);
     __pyx_v_sizes = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("array_tree_dict_from_wiggle_reader", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("array_tree_dict_from_wiggle_reader", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.arrays.array_tree.array_tree_dict_from_wiggle_reader");
   return NULL;
   __pyx_v_end = Py_None; __Pyx_INCREF(Py_None);
   __pyx_v__ = Py_None; __Pyx_INCREF(Py_None);
   __pyx_v_val = Py_None; __Pyx_INCREF(Py_None);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reader), __pyx_ptype_2bx_6arrays_6wiggle_IntervalReader, 1, "reader", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":63
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reader), __pyx_ptype_2bx_6arrays_6wiggle_IntervalReader, 1, "reader", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":60
  * def array_tree_dict_from_wiggle_reader( bx.arrays.wiggle.IntervalReader reader, sizes, default_size=2147483647, block_size=1000 ):
  *     # Create empty array trees
  *     rval = {}             # <<<<<<<<<<<<<<
  *     ## for key, size in sizes.iteritems():
  *     ##    rval[ key ] = ArrayTree( size, 1000 )
  */
-  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_1));
   __Pyx_DECREF(__pyx_v_rval);
   __pyx_v_rval = ((PyObject *)__pyx_1);
   __pyx_1 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":67
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":64
  *     ##    rval[ key ] = ArrayTree( size, 1000 )
  *     # Fill
  *     last_chrom = None             # <<<<<<<<<<<<<<
   __Pyx_DECREF(__pyx_v_last_chrom);
   __pyx_v_last_chrom = Py_None;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":68
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":65
  *     # Fill
  *     last_chrom = None
  *     last_array_tree = None             # <<<<<<<<<<<<<<
   __Pyx_DECREF(__pyx_v_last_array_tree);
   __pyx_v_last_array_tree = Py_None;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":69
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":66
  *     last_chrom = None
  *     last_array_tree = None
  *     for chrom, start, end, _, val in reader:             # <<<<<<<<<<<<<<
   if (PyList_CheckExact(((PyObject *)__pyx_v_reader)) || PyTuple_CheckExact(((PyObject *)__pyx_v_reader))) {
     __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_reader); __Pyx_INCREF(__pyx_t_2);
   } else {
-    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_reader)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_reader)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
   }
   for (;;) {
     } else {
       __pyx_t_3 = PyIter_Next(__pyx_t_2);
       if (!__pyx_t_3) {
-        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         break;
       }
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_v_val = __pyx_6;
       __pyx_6 = 0;
     } else {
-      __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_2);
-      __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_3);
-      __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_4);
-      __pyx_5 = __Pyx_UnpackItem(__pyx_1, 3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_5 = __Pyx_UnpackItem(__pyx_1, 3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_5);
-      __pyx_6 = __Pyx_UnpackItem(__pyx_1, 4); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_6 = __Pyx_UnpackItem(__pyx_1, 4); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_6);
-      if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
       __Pyx_DECREF(__pyx_v_chrom);
       __pyx_v_chrom = __pyx_2;
       __pyx_6 = 0;
     }
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":70
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":67
  *     last_array_tree = None
  *     for chrom, start, end, _, val in reader:
  *         if chrom != last_chrom:             # <<<<<<<<<<<<<<
  *             if chrom not in rval:
  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size )
  */
-    __pyx_t_3 = PyObject_RichCompare(__pyx_v_chrom, __pyx_v_last_chrom, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_chrom, __pyx_v_last_chrom, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_4) {
 
-      /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":71
+      /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":68
  *     for chrom, start, end, _, val in reader:
  *         if chrom != last_chrom:
  *             if chrom not in rval:             # <<<<<<<<<<<<<<
  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size )
  *             last_array_tree = rval[chrom]
  */
-      __pyx_t_4 = (!PySequence_Contains(__pyx_v_rval, __pyx_v_chrom)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = (!PySequence_Contains(__pyx_v_rval, __pyx_v_chrom)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       if (__pyx_t_4) {
 
-        /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":72
+        /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":69
  *         if chrom != last_chrom:
  *             if chrom not in rval:
  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size )             # <<<<<<<<<<<<<<
  *             last_array_tree = rval[chrom]
  *         last_array_tree.set_range( start, end, val )
  */
-        __pyx_t_3 = PyObject_GetAttr(__pyx_v_sizes, __pyx_kp_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyObject_GetAttr(__pyx_v_sizes, __pyx_kp_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
         __Pyx_INCREF(__pyx_v_chrom);
         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
         __Pyx_INCREF(__pyx_v_default_size);
         PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_default_size);
         __Pyx_GIVEREF(__pyx_v_default_size);
-        __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
         __Pyx_GIVEREF(__pyx_t_6);
         PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_block_size);
         __Pyx_GIVEREF(__pyx_v_block_size);
         __pyx_t_6 = 0;
-        __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-        if (PyObject_SetItem(__pyx_v_rval, __pyx_v_chrom, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (PyObject_SetItem(__pyx_v_rval, __pyx_v_chrom, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         goto __pyx_L9;
       }
       __pyx_L9:;
 
-      /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":73
+      /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":70
  *             if chrom not in rval:
  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size )
  *             last_array_tree = rval[chrom]             # <<<<<<<<<<<<<<
  *         last_array_tree.set_range( start, end, val )
  *     return rval
  */
-      __pyx_1 = PyObject_GetItem(__pyx_v_rval, __pyx_v_chrom); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyObject_GetItem(__pyx_v_rval, __pyx_v_chrom); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_1);
       __Pyx_DECREF(__pyx_v_last_array_tree);
       __pyx_v_last_array_tree = __pyx_1;
     }
     __pyx_L8:;
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":74
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":71
  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size )
  *             last_array_tree = rval[chrom]
  *         last_array_tree.set_range( start, end, val )             # <<<<<<<<<<<<<<
  *     return rval
  * 
  */
-    __pyx_t_6 = PyObject_GetAttr(__pyx_v_last_array_tree, __pyx_kp_set_range); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_last_array_tree, __pyx_kp_set_range); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
     __Pyx_INCREF(__pyx_v_start);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_start);
     __Pyx_INCREF(__pyx_v_val);
     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_val);
     __Pyx_GIVEREF(__pyx_v_val);
-    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":75
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":72
  *             last_array_tree = rval[chrom]
  *         last_array_tree.set_range( start, end, val )
  *     return rval             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":84
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":81
  *     cdef object io
  *     cdef object cdb_dict
  *     def __init__( self, file ):             # <<<<<<<<<<<<<<
       else goto __pyx_L5_argtuple_error;
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_file = values[0];
   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.__init__");
   return -1;
   __pyx_L4_argument_unpacking_done:;
   __pyx_v_io = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":85
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":82
  *     cdef object cdb_dict
  *     def __init__( self, file ):
  *         self.io = io = BinaryFileReader( file, MAGIC )             # <<<<<<<<<<<<<<
  *         assert io.read_uint32() == VERSION
  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_BinaryFileReader); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_BinaryFileReader); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_MAGIC); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_MAGIC); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_2);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __Pyx_INCREF(__pyx_v_file);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file);
   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_2);
   __Pyx_GIVEREF(__pyx_2);
   __pyx_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
   __pyx_v_io = __pyx_t_2;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":86
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":83
  *     def __init__( self, file ):
  *         self.io = io = BinaryFileReader( file, MAGIC )
  *         assert io.read_uint32() == VERSION             # <<<<<<<<<<<<<<
  *     def __getitem__( self, key ):
  */
   #ifndef PYREX_WITHOUT_ASSERTIONS
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_VERSION); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_VERSION); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_2);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(!__pyx_t_3)) {
     PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  #endif
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":87
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  #endif
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":84
  *         self.io = io = BinaryFileReader( file, MAGIC )
  *         assert io.read_uint32() == VERSION
  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )             # <<<<<<<<<<<<<<
  *     def __getitem__( self, key ):
  *         offset = self.cdb_dict[key]
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_FileCDBDict); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_FileCDBDict); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __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 = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
   __Pyx_INCREF(__pyx_v_file);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
   __Pyx_GIVEREF(__pyx_v_file);
-  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_2));
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_is_little_endian); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_is_little_endian); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":88
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":85
  *         assert io.read_uint32() == VERSION
  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
  *     def __getitem__( self, key ):             # <<<<<<<<<<<<<<
   __Pyx_SetupRefcountContext("__getitem__");
   __pyx_v_offset = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":89
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":86
  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
  *     def __getitem__( self, key ):
  *         offset = self.cdb_dict[key]             # <<<<<<<<<<<<<<
  *         offset = self.io.unpack( "L", offset )[0]
  *         self.io.seek( offset )
  */
-  __pyx_1 = PyObject_GetItem(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->cdb_dict, __pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyObject_GetItem(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->cdb_dict, __pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
   __Pyx_DECREF(__pyx_v_offset);
   __pyx_v_offset = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":90
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":87
  *     def __getitem__( self, key ):
  *         offset = self.cdb_dict[key]
  *         offset = self.io.unpack( "L", offset )[0]             # <<<<<<<<<<<<<<
  *         self.io.seek( offset )
  *         return FileArrayTree( self.io.file, self.io.is_little_endian )
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __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 = 90; __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 = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
   __Pyx_INCREF(__pyx_kp_44);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_44);
   __Pyx_INCREF(__pyx_v_offset);
   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_offset);
   __Pyx_GIVEREF(__pyx_v_offset);
-  __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 = 90; __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 = 87; __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;
-  __pyx_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_v_offset);
   __pyx_v_offset = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":91
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":88
  *         offset = self.cdb_dict[key]
  *         offset = self.io.unpack( "L", offset )[0]
  *         self.io.seek( offset )             # <<<<<<<<<<<<<<
  *         return FileArrayTree( self.io.file, self.io.is_little_endian )
  * 
  */
-  __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_seek); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_seek); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
   __Pyx_INCREF(__pyx_v_offset);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_offset);
   __Pyx_GIVEREF(__pyx_v_offset);
-  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":92
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":89
  *         offset = self.io.unpack( "L", offset )[0]
  *         self.io.seek( offset )
  *         return FileArrayTree( self.io.file, self.io.is_little_endian )             # <<<<<<<<<<<<<<
  *     @classmethod
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_is_little_endian); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self)->io, __pyx_kp_is_little_endian); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __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 = 92; __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 = 89; __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(((PyObject *)((PyObject*)__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTree)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTree)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_2;
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":95
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":92
  * 
  *     @classmethod
  *     def dict_to_file( Class, dict, file, is_little_endian=True ):             # <<<<<<<<<<<<<<
       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("dict_to_file", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("dict_to_file", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __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), "dict_to_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dict_to_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_dict = values[0];
     __pyx_v_file = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("dict_to_file", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("dict_to_file", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.dict_to_file");
   return NULL;
   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
   __pyx_v_offset = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":100
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":97
  *         read efficiently using this class.
  *         """
  *         io = BinaryFileWriter( file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
  *         # Write magic number and version
  *         io.write_uint32( MAGIC )
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_BinaryFileWriter); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_BinaryFileWriter); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __Pyx_INCREF(__pyx_v_file);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file);
   __Pyx_GIVEREF(__pyx_v_file);
-  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_2));
-  if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
   __pyx_v_io = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":102
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":99
  *         io = BinaryFileWriter( file, is_little_endian=is_little_endian )
  *         # Write magic number and version
  *         io.write_uint32( MAGIC )             # <<<<<<<<<<<<<<
  *         io.write_uint32( VERSION )
  *         # Write cdb index with fake values just to fill space
  */
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_45); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_45); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_MAGIC); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_MAGIC); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_1);
   __Pyx_GIVEREF(__pyx_1);
   __pyx_1 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":103
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":100
  *         # Write magic number and version
  *         io.write_uint32( MAGIC )
  *         io.write_uint32( VERSION )             # <<<<<<<<<<<<<<
  *         # Write cdb index with fake values just to fill space
  *         cdb_dict = {}
  */
-  __pyx_t_3 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_45); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_45); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_VERSION); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_VERSION); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_2);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_2);
   __Pyx_GIVEREF(__pyx_2);
   __pyx_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":105
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":102
  *         io.write_uint32( VERSION )
  *         # Write cdb index with fake values just to fill space
  *         cdb_dict = {}             # <<<<<<<<<<<<<<
  *         for key in dict.iterkeys():
  *             cdb_dict[ key ] = io.pack( "L", 0 )
  */
-  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_1));
   __Pyx_DECREF(__pyx_v_cdb_dict);
   __pyx_v_cdb_dict = ((PyObject *)__pyx_1);
   __pyx_1 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":106
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":103
  *         # Write cdb index with fake values just to fill space
  *         cdb_dict = {}
  *         for key in dict.iterkeys():             # <<<<<<<<<<<<<<
  *             cdb_dict[ key ] = io.pack( "L", 0 )
  *         cdb_offset = io.tell()
  */
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_dict, __pyx_kp_iterkeys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_dict, __pyx_kp_iterkeys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
     __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
   } else {
-    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     } else {
       __pyx_t_1 = PyIter_Next(__pyx_t_2);
       if (!__pyx_t_1) {
-        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         break;
       }
       __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_key = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":107
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":104
  *         cdb_dict = {}
  *         for key in dict.iterkeys():
  *             cdb_dict[ key ] = io.pack( "L", 0 )             # <<<<<<<<<<<<<<
  *         cdb_offset = io.tell()
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
  */
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
     __Pyx_INCREF(__pyx_kp_46);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_46);
     __Pyx_INCREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
-    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if (PyObject_SetItem(__pyx_v_cdb_dict, __pyx_v_key, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (PyObject_SetItem(__pyx_v_cdb_dict, __pyx_v_key, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":108
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":105
  *         for key in dict.iterkeys():
  *             cdb_dict[ key ] = io.pack( "L", 0 )
  *         cdb_offset = io.tell()             # <<<<<<<<<<<<<<
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
  *         # Write each tree and save offset
  */
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_v_cdb_offset);
   __pyx_v_cdb_offset = __pyx_t_5;
   __pyx_t_5 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":109
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":106
  *             cdb_dict[ key ] = io.pack( "L", 0 )
  *         cdb_offset = io.tell()
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
  *         # Write each tree and save offset
  *         for key, value in dict.iteritems():
  */
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_FileCDBDict); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_FileCDBDict); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_2);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_to_file); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_to_file); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
   __Pyx_INCREF(__pyx_v_cdb_dict);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cdb_dict);
   __Pyx_INCREF(__pyx_v_file);
   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_file);
   __Pyx_GIVEREF(__pyx_v_file);
-  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_1));
-  if (PyDict_SetItem(__pyx_1, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_1, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":111
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":108
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
  *         # Write each tree and save offset
  *         for key, value in dict.iteritems():             # <<<<<<<<<<<<<<
  *             offset = io.tell()
  *             cdb_dict[ key ] = io.pack( "L", offset )
  */
-  __pyx_t_3 = PyObject_GetAttr(__pyx_v_dict, __pyx_kp_iteritems); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_dict, __pyx_kp_iteritems); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
     __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
   } else {
-    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     } else {
       __pyx_t_2 = PyIter_Next(__pyx_t_3);
       if (!__pyx_t_2) {
-        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         break;
       }
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_v_value = __pyx_3;
       __pyx_3 = 0;
     } else {
-      __pyx_2 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_2);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_1 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_1);
-      __pyx_3 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_3);
-      if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
       __Pyx_DECREF(__pyx_v_key);
       __pyx_v_key = __pyx_1;
       __pyx_3 = 0;
     }
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":112
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":109
  *         # Write each tree and save offset
  *         for key, value in dict.iteritems():
  *             offset = io.tell()             # <<<<<<<<<<<<<<
  *             cdb_dict[ key ] = io.pack( "L", offset )
  *             value.to_file( file, is_little_endian=is_little_endian )
  */
-    __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_v_offset);
     __pyx_v_offset = __pyx_t_5;
     __pyx_t_5 = 0;
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":113
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":110
  *         for key, value in dict.iteritems():
  *             offset = io.tell()
  *             cdb_dict[ key ] = io.pack( "L", offset )             # <<<<<<<<<<<<<<
  *             value.to_file( file, is_little_endian=is_little_endian )
  *         # Go back and write the index again
  */
-    __pyx_t_5 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_pack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_pack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
     __Pyx_INCREF(__pyx_kp_47);
     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_47);
     __Pyx_INCREF(__pyx_v_offset);
     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_offset);
     __Pyx_GIVEREF(__pyx_v_offset);
-    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    if (PyObject_SetItem(__pyx_v_cdb_dict, __pyx_v_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (PyObject_SetItem(__pyx_v_cdb_dict, __pyx_v_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":114
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":111
  *             offset = io.tell()
  *             cdb_dict[ key ] = io.pack( "L", offset )
  *             value.to_file( file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
  *         # Go back and write the index again
  *         io.seek( cdb_offset )
  */
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_value, __pyx_kp_to_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_value, __pyx_kp_to_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __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 = 114; __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
     __Pyx_INCREF(__pyx_v_file);
     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
     __Pyx_GIVEREF(__pyx_v_file);
-    __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_2));
-    if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   }
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":116
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":113
  *             value.to_file( file, is_little_endian=is_little_endian )
  *         # Go back and write the index again
  *         io.seek( cdb_offset )             # <<<<<<<<<<<<<<
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
  * 
  */
-  __pyx_t_3 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_seek); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_io, __pyx_kp_seek); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
   __Pyx_INCREF(__pyx_v_cdb_offset);
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cdb_offset);
   __Pyx_GIVEREF(__pyx_v_cdb_offset);
-  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":117
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":114
  *         # Go back and write the index again
  *         io.seek( cdb_offset )
  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
  * 
  * cdef class FileArrayTree:
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_FileCDBDict); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_FileCDBDict); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_to_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_to_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
   __Pyx_INCREF(__pyx_v_cdb_dict);
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cdb_dict);
   __Pyx_INCREF(__pyx_v_file);
   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_file);
   __Pyx_GIVEREF(__pyx_v_file);
-  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_3));
-  if (PyDict_SetItem(__pyx_3, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_3, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":131
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":128
  *     cdef object io
  * 
  *     def __init__( self, file, is_little_endian=True ):             # <<<<<<<<<<<<<<
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_file = values[0];
     __pyx_v_is_little_endian = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.__init__");
   return -1;
   __pyx_L4_argument_unpacking_done:;
   __pyx_v_dt = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":132
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":129
  * 
  *     def __init__( self, file, is_little_endian=True ):
  *         self.io = BinaryFileReader( file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
  *         self.offset = self.io.tell()
  *         # Read basic info about the tree
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_BinaryFileReader); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_BinaryFileReader); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __Pyx_INCREF(__pyx_v_file);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file);
   __Pyx_GIVEREF(__pyx_v_file);
-  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_2));
-  if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_2, __pyx_kp_is_little_endian, __pyx_v_is_little_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
   ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":133
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":130
  *     def __init__( self, file, is_little_endian=True ):
  *         self.io = BinaryFileReader( file, is_little_endian=is_little_endian )
  *         self.offset = self.io.tell()             # <<<<<<<<<<<<<<
  *         # Read basic info about the tree
  *         self.max = self.io.read_uint32()
  */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->offset = __pyx_t_3;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":132
+ *         self.offset = self.io.tell()
+ *         # Read basic info about the tree
+ *         self.max = self.io.read_uint32()             # <<<<<<<<<<<<<<
+ *         self.block_size = self.io.read_uint32()
+ *         # Read dtype and canonicalize
+ */
+  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_43); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __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_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->max = __pyx_t_3;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":133
+ *         # Read basic info about the tree
+ *         self.max = self.io.read_uint32()
+ *         self.block_size = self.io.read_uint32()             # <<<<<<<<<<<<<<
+ *         # Read dtype and canonicalize
+ *         dt = self.io.read( 1 )
+ */
+  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->offset = __pyx_t_3;
+  ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size = __pyx_t_3;
 
   /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":135
- *         self.offset = self.io.tell()
- *         # Read basic info about the tree
- *         self.max = self.io.read_uint32()             # <<<<<<<<<<<<<<
- *         self.block_size = self.io.read_uint32()
- *         # Read dtype and canonicalize
- */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_43); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __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_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->max = __pyx_t_3;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":136
- *         # Read basic info about the tree
- *         self.max = self.io.read_uint32()
- *         self.block_size = self.io.read_uint32()             # <<<<<<<<<<<<<<
- *         # Read dtype and canonicalize
- *         dt = self.io.read( 1 )
- */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_43); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size = __pyx_t_3;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":138
  *         self.block_size = self.io.read_uint32()
  *         # Read dtype and canonicalize
  *         dt = self.io.read( 1 )             # <<<<<<<<<<<<<<
  *         self.dtype = numpy.dtype( dt )
  *         self.io.skip( 3 )
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __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 = 138; __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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
   __Pyx_INCREF(__pyx_int_1);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
   __Pyx_GIVEREF(__pyx_int_1);
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   __pyx_v_dt = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":139
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":136
  *         # Read dtype and canonicalize
  *         dt = self.io.read( 1 )
  *         self.dtype = numpy.dtype( dt )             # <<<<<<<<<<<<<<
  *         self.io.skip( 3 )
  *         # How many levels are needed to cover the entire range?
  */
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
   __Pyx_INCREF(__pyx_v_dt);
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_dt);
   __Pyx_GIVEREF(__pyx_v_dt);
-  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
   __Pyx_GIVEREF(__pyx_t_2);
   ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":140
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":137
  *         dt = self.io.read( 1 )
  *         self.dtype = numpy.dtype( dt )
  *         self.io.skip( 3 )             # <<<<<<<<<<<<<<
  *         # How many levels are needed to cover the entire range?
  *         self.levels = 0
  */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
   __Pyx_INCREF(__pyx_int_3);
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_3);
   __Pyx_GIVEREF(__pyx_int_3);
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":142
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":139
  *         self.io.skip( 3 )
  *         # How many levels are needed to cover the entire range?
  *         self.levels = 0             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":143
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":140
  *         # How many levels are needed to cover the entire range?
  *         self.levels = 0
  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:             # <<<<<<<<<<<<<<
     __pyx_t_5 = (__Pyx_pow_PY_LONG_LONG(((PY_LONG_LONG)((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size), (((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels + 1)) < ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->max);
     if (!__pyx_t_5) break;
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":144
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":141
  *         self.levels = 0
  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:
  *             self.levels += 1             # <<<<<<<<<<<<<<
     ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels += 1;
   }
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":146
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":143
  *             self.levels += 1
  *         # Not yet dealing with the case where the root is a Leaf
  *         assert self.levels > 0, "max < block_size not yet handled"             # <<<<<<<<<<<<<<
   #ifndef PYREX_WITHOUT_ASSERTIONS
   if (unlikely(!(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels > 0))) {
     PyErr_SetObject(PyExc_AssertionError, __pyx_kp_48);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  #endif
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":148
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  #endif
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":145
  *         assert self.levels > 0, "max < block_size not yet handled"
  *         # Save offset of root
  *         self.root_offset = self.io.tell()             # <<<<<<<<<<<<<<
  * 
  *     def __getitem__( self, index ):
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->root_offset = __pyx_t_3;
 
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":150
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":147
  *         self.root_offset = self.io.tell()
  * 
  *     def __getitem__( self, index ):             # <<<<<<<<<<<<<<
   __Pyx_SetupRefcountContext("__getitem__");
   __pyx_v_min = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":151
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":148
  * 
  *     def __getitem__( self, index ):
  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )             # <<<<<<<<<<<<<<
  *         if min < 0:
  *             return nan
  */
-  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->__pyx_vtab)->r_seek_to_node(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), __pyx_t_1, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->root_offset, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->__pyx_vtab)->r_seek_to_node(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), __pyx_t_1, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->root_offset, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_v_min);
   __pyx_v_min = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":152
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":149
  *     def __getitem__( self, index ):
  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )
  *         if min < 0:             # <<<<<<<<<<<<<<
  *             return nan
  *         self.io.skip( self.dtype.itemsize * ( index - min ) )
  */
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_min, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_RichCompare(__pyx_v_min, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __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 = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":153
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":150
  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )
  *         if min < 0:
  *             return nan             # <<<<<<<<<<<<<<
  *         return self.io.read_raw_array( self.dtype, 1 )[0]
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_nan); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_nan); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_1);
     __pyx_r = __pyx_1;
     __pyx_1 = 0;
   }
   __pyx_L5:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":154
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":151
  *         if min < 0:
  *             return nan
  *         self.io.skip( self.dtype.itemsize * ( index - min ) )             # <<<<<<<<<<<<<<
  *         return self.io.read_raw_array( self.dtype, 1 )[0]
  * 
  */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype, __pyx_kp_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype, __pyx_kp_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyNumber_Subtract(__pyx_v_index, __pyx_v_min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyNumber_Subtract(__pyx_v_index, __pyx_v_min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":155
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":152
  *             return nan
  *         self.io.skip( self.dtype.itemsize * ( index - min ) )
  *         return self.io.read_raw_array( self.dtype, 1 )[0]             # <<<<<<<<<<<<<<
  *     def get_summary( self, index, level ):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __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 = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
   __Pyx_INCREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
   PyTuple_SET_ITEM(__pyx_t_5, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
   __Pyx_INCREF(__pyx_int_1);
   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_1);
   __Pyx_GIVEREF(__pyx_int_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  __pyx_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_1;
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":157
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":154
  *         return self.io.read_raw_array( self.dtype, 1 )[0]
  * 
  *     def get_summary( self, index, level ):             # <<<<<<<<<<<<<<
- *         assert 0 < level <= self.levels
- *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
+ *         if level <= 0 or level > self.levels:
+ *             raise ValueError, "level must be <= self.levels"
  */
 
 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_get_summary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
   PyObject *__pyx_v_s;
   PyObject *__pyx_r = NULL;
   PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
   int __pyx_t_4;
   int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
+  int __pyx_t_6;
+  int __pyx_t_7;
+  PyObject *__pyx_t_8 = NULL;
   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_index,&__pyx_kp_level,0};
   __Pyx_SetupRefcountContext("get_summary");
   if (unlikely(__pyx_kwds)) {
       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_level);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("get_summary", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("get_summary", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __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), "get_summary") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_summary") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_index = values[0];
     __pyx_v_level = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get_summary", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("get_summary", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.get_summary");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":158
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":155
  * 
  *     def get_summary( self, index, level ):
- *         assert 0 < level <= self.levels             # <<<<<<<<<<<<<<
+ *         if level <= 0 or level > self.levels:             # <<<<<<<<<<<<<<
+ *             raise ValueError, "level must be <= self.levels"
+ *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
+ */
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_level, __pyx_int_0, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!__pyx_t_2) {
+    __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_level, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = __pyx_t_4;
+  } else {
+    __pyx_t_5 = __pyx_t_2;
+  }
+  if (__pyx_t_5) {
+
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":156
+ *     def get_summary( self, index, level ):
+ *         if level <= 0 or level > self.levels:
+ *             raise ValueError, "level must be <= self.levels"             # <<<<<<<<<<<<<<
  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
  *             return None
  */
-  #ifndef PYREX_WITHOUT_ASSERTIONS
-  __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_level, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
-    __Pyx_DECREF(__pyx_t_1);
-    __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_level, __pyx_t_2, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  }
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_3)) {
-    PyErr_SetNone(PyExc_AssertionError);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  #endif
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":159
- *     def get_summary( self, index, level ):
- *         assert 0 < level <= self.levels
+    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_49, 0);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":157
+ *         if level <= 0 or level > self.levels:
+ *             raise ValueError, "level must be <= self.levels"
  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:             # <<<<<<<<<<<<<<
  *             return None
  *         # Read summary arrays
  */
-  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_level); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = (((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->__pyx_vtab)->r_seek_to_node(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), __pyx_t_4, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->root_offset, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels, __pyx_t_5) < 0);
-  if (__pyx_t_3) {
-
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":160
- *         assert 0 < level <= self.levels
+  __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_level); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = (((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->__pyx_vtab)->r_seek_to_node(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), __pyx_t_6, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->root_offset, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels, __pyx_t_7) < 0);
+  if (__pyx_t_5) {
+
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":158
+ *             raise ValueError, "level must be <= self.levels"
  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
  *             return None             # <<<<<<<<<<<<<<
  *         # Read summary arrays
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":162
+    goto __pyx_L7;
+  }
+  __pyx_L7:;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":160
  *             return None
  *         # Read summary arrays
  *         s = Summary()             # <<<<<<<<<<<<<<
  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
  */
-  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_6arrays_10array_tree_Summary)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_6arrays_10array_tree_Summary)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_v_s);
-  __pyx_v_s = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":163
+  __pyx_v_s = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":161
  *         # Read summary arrays
  *         s = Summary()
  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
   __Pyx_INCREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
   __Pyx_GIVEREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_counts, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_counts, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":164
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":162
  *         s = Summary()
  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
  */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_8 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
   __Pyx_INCREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
   __Pyx_GIVEREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_sums, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":165
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_8);
+  __pyx_t_8 = 0;
+  __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_sums, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":163
  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)             # <<<<<<<<<<<<<<
  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )
  */
-  __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __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 = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __pyx_t_8 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __Pyx_INCREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
   __Pyx_GIVEREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_mins, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":166
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_mins, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":164
  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )
  *         return s
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
   __Pyx_INCREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
   __Pyx_GIVEREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_maxs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_maxs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":167
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":165
  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
  *         return s
  * 
  */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->io, __pyx_kp_read_raw_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_8 = PyInt_FromLong(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->block_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
   __Pyx_INCREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
   __Pyx_GIVEREF(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->dtype);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_sumsquares, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":168
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_8);
+  __pyx_t_8 = 0;
+  __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_v_s, __pyx_kp_sumsquares, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":166
  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )
  *         return s             # <<<<<<<<<<<<<<
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_8);
   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.get_summary");
   __pyx_r = NULL;
   __pyx_L0:;
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":170
+/* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":168
  *         return s
  * 
  *     def get_leaf( self, index ):             # <<<<<<<<<<<<<<
  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:
- *             return None
+ *             return []
  */
 
 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_get_leaf(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
   PyObject *__pyx_t_5 = NULL;
   __Pyx_SetupRefcountContext("get_leaf");
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":171
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":169
  * 
  *     def get_leaf( self, index ):
  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:             # <<<<<<<<<<<<<<
- *             return None
+ *             return []
  *         return self.io.read_raw_array( self.dtype, self.block_size )
  */
-  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_2 = (((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->__pyx_vtab)->r_seek_to_node(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), __pyx_t_1, 0, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->root_offset, ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self)->levels, 0) < 0);
   if (__pyx_t_2) {
 
-    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":172
+    /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":170
  *     def get_leaf( self, index ):
  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:
- *             return None             # <<<<<<<<<<<<<<
+ *             return []             # <<<<<<<<<<<<<<
  *         return self.io.read_raw_array( self.dtype, self.block_size )
  * 
  */
     __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
+    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_r = ((PyObject *)__pyx_t_3);
+    __pyx_t_3 = 0;
     goto __pyx_L0;
     goto __pyx_L5;
   }
   __pyx_L5:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":173
+  /* "/Users/kanwei/bx-python/lib/bx/arrays/array_tree.pyx":171
  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0: