Commits

James Taylor committed a728753

Fix issue #2 (size problem in interval io).

Comments (0)

Files changed (2)

lib/bx/intervals/io.py

                     last_chrom = chrom
                     last_bitset = bitsets[chrom]
                 start = max( int( interval[self.start_col] ), 0 )
-                end = min( int( interval[self.end_col] ), size)
+                end = min( int( interval[self.end_col] ), last_bitset.size )
                 last_bitset.set_range( start, end-start )
         return bitsets
 

lib/bx/seq/_twobit.c

-/* Generated by Cython 0.9.6.14 on Tue May 13 14:02:43 2008 */
+/* Generated by Cython 0.10.3 on Thu Feb 19 17:05:26 2009 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
+#ifndef DL_EXPORT
+  #define DL_EXPORT(t) t
+#endif
+#if PY_VERSION_HEX < 0x02040000
+  #define METH_COEXIST 0
+#endif
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
   #define PyNumber_Index(o)    PyNumber_Int(o)
   #define PyIndex_Check(o)     PyNumber_Check(o)
 #endif
-#if PY_VERSION_HEX < 0x02040000
-  #define METH_COEXIST 0
+#if PY_VERSION_HEX < 0x02060000
+  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
+  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
+  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
+  #define PyVarObject_HEAD_INIT(type, size) \
+          PyObject_HEAD_INIT(type) size,
+  #define PyType_Modified(t)
+
+  typedef struct {
+       void *buf;
+       PyObject *obj;
+       Py_ssize_t len;
+       Py_ssize_t itemsize;
+       int readonly;
+       int ndim;
+       char *format;
+       Py_ssize_t *shape;
+       Py_ssize_t *strides;
+       Py_ssize_t *suboffsets;
+       void *internal;
+  } Py_buffer;
+
+  #define PyBUF_SIMPLE 0
+  #define PyBUF_WRITABLE 0x0001
+  #define PyBUF_LOCK 0x0002
+  #define PyBUF_FORMAT 0x0004
+  #define PyBUF_ND 0x0008
+  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
+  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
+  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
+  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
+  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
+
 #endif
-#ifndef __stdcall
-  #define __stdcall
+#if PY_MAJOR_VERSION < 3
+  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+#else
+  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 #endif
-#ifndef __cdecl
-  #define __cdecl
+#if PY_MAJOR_VERSION >= 3
+  #define Py_TPFLAGS_CHECKTYPES 0
+  #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
+  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_MAJOR_VERSION >= 3
+  #define PyBaseString_Type            PyUnicode_Type
+  #define PyString_Type                PyBytes_Type
+  #define PyInt_Type                   PyLong_Type
+  #define PyInt_Check(op)              PyLong_Check(op)
+  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
+  #define PyInt_FromString             PyLong_FromString
+  #define PyInt_FromUnicode            PyLong_FromUnicode
+  #define PyInt_FromLong               PyLong_FromLong
+  #define PyInt_FromSize_t             PyLong_FromSize_t
+  #define PyInt_FromSsize_t            PyLong_FromSsize_t
+  #define PyInt_AsLong                 PyLong_AsLong
+  #define PyInt_AS_LONG                PyLong_AS_LONG
+  #define PyInt_AsSsize_t              PyLong_AsSsize_t
+  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
+  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define PyBytes_Type                 PyString_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+  #ifndef __stdcall
+    #define __stdcall
+  #endif
+  #ifndef __cdecl
+    #define __cdecl
+  #endif
+#else
+  #define _USE_MATH_DEFINES
 #endif
 #ifdef __cplusplus
 #define __PYX_EXTERN_C extern "C"
 #define __PYX_EXTERN_C extern
 #endif
 #include <math.h>
+#define __PYX_HAVE_API__bx__seq___twobit
 #include "ctype.h"
 #include "string.h"
 
 #define INLINE 
 #endif
 
-typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
-typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
 
 
 
 
 /* Type Conversion Predeclarations */
 
+#if PY_MAJOR_VERSION < 3
+#define __Pyx_PyBytes_FromString PyString_FromString
+#define __Pyx_PyBytes_AsString   PyString_AsString
+#else
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_AsString   PyBytes_AsString
+#endif
+
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static INLINE int __Pyx_PyObject_IsTrue(PyObject* x);
 static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x);
 static PyObject *__pyx_empty_tuple;
 static int __pyx_lineno;
 static int __pyx_clineno = 0;
-static char * __pyx_cfilenm= __FILE__;
-static char *__pyx_filename;
-static char **__pyx_f;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+static const char **__pyx_f;
 
-static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name, PyObject* kw_name); /*proto*/
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
+
+static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) {
+    PyObject *r;
+    if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
+        r = PyList_GET_ITEM(o, i);
+        Py_INCREF(r);
+    }
+    else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) {
+        r = PyTuple_GET_ITEM(o, i);
+        Py_INCREF(r);
+    }
+    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned))
+        r = PySequence_GetItem(o, i);
+    else {
+        PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
+        if (!j)
+            return 0;
+        r = PyObject_GetItem(o, j);
+        Py_DECREF(j);
+    }
+    return r;
+}
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname); /*proto*/
 
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
-/* Declarations */
+/* Type declarations */
+/* Module declarations from bx.seq._twobit */
 
 static char *__pyx_v_2bx_3seq_7_twobit_valToNt;
+static PyObject *__pyx_k_14;
 
 
 /* Implementation of bx.seq._twobit */
+static char __pyx_k_13[] = "TCAG";
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static char __pyx_k_file[] = "file";
+static PyObject *__pyx_kp_file;
+static char __pyx_k_seq[] = "seq";
+static PyObject *__pyx_kp_seq;
+static char __pyx_k_fragStart[] = "fragStart";
+static PyObject *__pyx_kp_fragStart;
+static char __pyx_k_fragEnd[] = "fragEnd";
+static PyObject *__pyx_kp_fragEnd;
+static char __pyx_k_do_mask[] = "do_mask";
+static PyObject *__pyx_kp_do_mask;
+static char __pyx_k_struct[] = "struct";
+static PyObject *__pyx_kp_struct;
+static char __pyx_k_sys[] = "sys";
+static PyObject *__pyx_kp_sys;
+static char __pyx_k_bisect[] = "bisect";
+static PyObject *__pyx_kp_bisect;
+static char __pyx_k_seek[] = "seek";
+static PyObject *__pyx_kp_seek;
+static char __pyx_k_sequence_offset[] = "sequence_offset";
+static PyObject *__pyx_kp_sequence_offset;
+static char __pyx_k_read[] = "read";
+static PyObject *__pyx_kp_read;
+static char __pyx_k_n_block_starts[] = "n_block_starts";
+static PyObject *__pyx_kp_n_block_starts;
+static char __pyx_k_n_block_sizes[] = "n_block_sizes";
+static PyObject *__pyx_kp_n_block_sizes;
+static char __pyx_k_15[] = "N";
+static PyObject *__pyx_kp_15;
+static char __pyx_k_masked_block_starts[] = "masked_block_starts";
+static PyObject *__pyx_kp_masked_block_starts;
+static char __pyx_k_masked_block_sizes[] = "masked_block_sizes";
+static PyObject *__pyx_kp_masked_block_sizes;
 
-static char __pyx_k_5[] = "TCAG";
-
-static PyObject *__pyx_n_struct;
-static PyObject *__pyx_n_sys;
-static PyObject *__pyx_n_bisect;
-
-/* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":19
+/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":19
  * valToNt = "TCAG"
  * 
- * def read( file, seq, int fragStart, int fragEnd, do_mask=False ):             # <<<<<<<<<<<<<< 
+ * def read( file, seq, int fragStart, int fragEnd, do_mask=False ):             # <<<<<<<<<<<<<<
  *     """
  *     Stolen directly from Jim Kent's twoBit.c
  */
 
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-
-static PyObject *__pyx_n_seek;
-static PyObject *__pyx_n_sequence_offset;
-static PyObject *__pyx_n_read;
-static PyObject *__pyx_n_n_block_starts;
-static PyObject *__pyx_n_n_block_sizes;
-static PyObject *__pyx_n_masked_block_starts;
-static PyObject *__pyx_n_masked_block_sizes;
-
-static char __pyx_k_6[] = "N";
-
 static PyObject *__pyx_pf_2bx_3seq_7_twobit_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_2bx_3seq_7_twobit_read[] = "\n    Stolen directly from Jim Kent\'s twoBit.c\n    ";
+static char __pyx_doc_2bx_3seq_7_twobit_read[] = "\n    Stolen directly from Jim Kent's twoBit.c\n    ";
 static PyObject *__pyx_pf_2bx_3seq_7_twobit_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_file = 0;
   PyObject *__pyx_v_seq = 0;
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
   PyObject *__pyx_3 = 0;
-  PyObject *__pyx_4 = 0;
-  int __pyx_5;
-  Py_ssize_t __pyx_6 = 0;
+  int __pyx_4;
+  Py_ssize_t __pyx_5 = 0;
+  PyObject *__pyx_6 = 0;
   int __pyx_7;
   int __pyx_8;
   int __pyx_9;
-  static char *__pyx_argnames[] = {"file","seq","fragStart","fragEnd","do_mask",0};
-  __pyx_v_do_mask = Py_False;
-  if (likely(!__pyx_kwds) && likely(4 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 5)) {
-    __pyx_v_file = PyTuple_GET_ITEM(__pyx_args, 0);
-    __pyx_v_seq = PyTuple_GET_ITEM(__pyx_args, 1);
-    __pyx_v_fragStart = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_fragStart == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L2;}
-    __pyx_v_fragEnd = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_fragEnd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L2;}
-    if (PyTuple_GET_SIZE(__pyx_args) > 4) {
+  PyObject *__pyx_t_1 = NULL;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_file,&__pyx_kp_seq,&__pyx_kp_fragStart,&__pyx_kp_fragEnd,&__pyx_kp_do_mask,0};
+  __pyx_self = __pyx_self;
+  __pyx_v_do_mask = __pyx_k_14;
+  if (unlikely(__pyx_kwds)) {
+    PyObject* values[5] = {0,0,0,0,0};
+    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      case  0: break;
+      default: goto __pyx_L5_argtuple_error;
+    }
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  0:
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
+      if (likely(values[0])) kw_args--;
+      else goto __pyx_L5_argtuple_error;
+      case  1:
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_seq);
+      if (likely(values[1])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("read", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  2:
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_fragStart);
+      if (likely(values[2])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("read", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  3:
+      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_fragEnd);
+      if (likely(values[3])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("read", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __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), "read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    }
+    __pyx_v_file = values[0];
+    __pyx_v_seq = values[1];
+    __pyx_v_fragStart = __pyx_PyInt_int(values[2]); if (unlikely((__pyx_v_fragStart == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_fragEnd = __pyx_PyInt_int(values[3]); if (unlikely((__pyx_v_fragEnd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (values[4]) {
+      __pyx_v_do_mask = values[4];
+    }
+  } else {
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  5:
       __pyx_v_do_mask = PyTuple_GET_ITEM(__pyx_args, 4);
+      case  4:
+      __pyx_v_fragEnd = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_fragEnd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      __pyx_v_fragStart = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_fragStart == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      __pyx_v_seq = PyTuple_GET_ITEM(__pyx_args, 1);
+      __pyx_v_file = PyTuple_GET_ITEM(__pyx_args, 0);
+      break;
+      default: goto __pyx_L5_argtuple_error;
     }
   }
-  else {
-    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOii|O", __pyx_argnames, &__pyx_v_file, &__pyx_v_seq, &__pyx_v_fragStart, &__pyx_v_fragEnd, &__pyx_v_do_mask))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L2;}
-  }
-  goto __pyx_L3;
-  __pyx_L2:;
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("read", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
   __Pyx_AddTraceback("bx.seq._twobit.read");
   return NULL;
-  __pyx_L3:;
+  __pyx_L4_argument_unpacking_done:;
   __pyx_v_dna_py = Py_None; Py_INCREF(Py_None);
   __pyx_v_packed_py = Py_None; Py_INCREF(Py_None);
   __pyx_v_midEnd = Py_None; Py_INCREF(Py_None);
   __pyx_v_start_ix = Py_None; Py_INCREF(Py_None);
   __pyx_v_m_block_count = Py_None; Py_INCREF(Py_None);
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":29
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":29
  *     cdef char * packed, * dna, *dna_orig
  *     cdef char partial
- *     packedStart = (fragStart>>2);             # <<<<<<<<<<<<<< 
+ *     packedStart = (fragStart>>2);             # <<<<<<<<<<<<<<
  *     packedEnd = ((fragEnd+3)>>2);
  *     packByteCount = packedEnd - packedStart;
  */
   __pyx_v_packedStart = (__pyx_v_fragStart >> 2);
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":30
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":30
  *     cdef char partial
  *     packedStart = (fragStart>>2);
- *     packedEnd = ((fragEnd+3)>>2);             # <<<<<<<<<<<<<< 
+ *     packedEnd = ((fragEnd+3)>>2);             # <<<<<<<<<<<<<<
  *     packByteCount = packedEnd - packedStart;
  *     # Empty string in which to write unpacked DNA
  */
   __pyx_v_packedEnd = ((__pyx_v_fragEnd + 3) >> 2);
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":31
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":31
  *     packedStart = (fragStart>>2);
  *     packedEnd = ((fragEnd+3)>>2);
- *     packByteCount = packedEnd - packedStart;             # <<<<<<<<<<<<<< 
+ *     packByteCount = packedEnd - packedStart;             # <<<<<<<<<<<<<<
  *     # Empty string in which to write unpacked DNA
  *     dna_py = PyString_FromStringAndSize( NULL, fragEnd - fragStart )
  */
   __pyx_v_packByteCount = (__pyx_v_packedEnd - __pyx_v_packedStart);
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":33
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":33
  *     packByteCount = packedEnd - packedStart;
  *     # Empty string in which to write unpacked DNA
- *     dna_py = PyString_FromStringAndSize( NULL, fragEnd - fragStart )             # <<<<<<<<<<<<<< 
+ *     dna_py = PyString_FromStringAndSize( NULL, fragEnd - fragStart )             # <<<<<<<<<<<<<<
  *     dna = PyString_AsString( dna_py )
  *     # Read it
  */
-  __pyx_1 = PyString_FromStringAndSize(NULL, (__pyx_v_fragEnd - __pyx_v_fragStart)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyString_FromStringAndSize(NULL, (__pyx_v_fragEnd - __pyx_v_fragStart)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_v_dna_py);
   __pyx_v_dna_py = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":34
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":34
  *     # Empty string in which to write unpacked DNA
  *     dna_py = PyString_FromStringAndSize( NULL, fragEnd - fragStart )
- *     dna = PyString_AsString( dna_py )             # <<<<<<<<<<<<<< 
+ *     dna = PyString_AsString( dna_py )             # <<<<<<<<<<<<<<
  *     # Read it
  *     file.seek( seq.sequence_offset + packedStart )
  */
   __pyx_v_dna = PyString_AsString(__pyx_v_dna_py);
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":36
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":36
  *     dna = PyString_AsString( dna_py )
  *     # Read it
- *     file.seek( seq.sequence_offset + packedStart )             # <<<<<<<<<<<<<< 
+ *     file.seek( seq.sequence_offset + packedStart )             # <<<<<<<<<<<<<<
  *     packed_py = file.read( packByteCount )
  *     packed = PyString_AsString( packed_py )
  */
-  __pyx_1 = PyObject_GetAttr(__pyx_v_file, __pyx_n_seek); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  __pyx_2 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_sequence_offset); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  __pyx_3 = PyInt_FromLong(__pyx_v_packedStart); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  __pyx_4 = PyNumber_Add(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyObject_GetAttr(__pyx_v_file, __pyx_kp_seek); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_sequence_offset); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyInt_FromLong(__pyx_v_packedStart); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Add(__pyx_2, __pyx_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
-  __pyx_4 = 0;
-  __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":37
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":37
  *     # Read it
  *     file.seek( seq.sequence_offset + packedStart )
- *     packed_py = file.read( packByteCount )             # <<<<<<<<<<<<<< 
+ *     packed_py = file.read( packByteCount )             # <<<<<<<<<<<<<<
  *     packed = PyString_AsString( packed_py )
- *     # Handle case where everything is in one packed byte 
+ *     # Handle case where everything is in one packed byte
  */
-  __pyx_4 = PyObject_GetAttr(__pyx_v_file, __pyx_n_read); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  __pyx_1 = PyInt_FromLong(__pyx_v_packByteCount); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
-  __pyx_1 = 0;
-  __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  Py_DECREF(__pyx_4); __pyx_4 = 0;
-  Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
+  __pyx_1 = PyObject_GetAttr(__pyx_v_file, __pyx_kp_read); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyInt_FromLong(__pyx_v_packByteCount); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
   Py_DECREF(__pyx_v_packed_py);
-  __pyx_v_packed_py = __pyx_3;
-  __pyx_3 = 0;
+  __pyx_v_packed_py = __pyx_2;
+  __pyx_2 = 0;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":38
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":38
  *     file.seek( seq.sequence_offset + packedStart )
  *     packed_py = file.read( packByteCount )
- *     packed = PyString_AsString( packed_py )             # <<<<<<<<<<<<<< 
- *     # Handle case where everything is in one packed byte 
+ *     packed = PyString_AsString( packed_py )             # <<<<<<<<<<<<<<
+ *     # Handle case where everything is in one packed byte
  *     if packByteCount == 1:
  */
   __pyx_v_packed = PyString_AsString(__pyx_v_packed_py);
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":40
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":40
  *     packed = PyString_AsString( packed_py )
- *     # Handle case where everything is in one packed byte 
- *     if packByteCount == 1:             # <<<<<<<<<<<<<< 
+ *     # Handle case where everything is in one packed byte
+ *     if packByteCount == 1:             # <<<<<<<<<<<<<<
  *         pOff = (packedStart<<2)
  *         pStart = fragStart - pOff
  */
-  __pyx_5 = (__pyx_v_packByteCount == 1);
-  if (__pyx_5) {
+  __pyx_4 = (__pyx_v_packByteCount == 1);
+  if (__pyx_4) {
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":41
- *     # Handle case where everything is in one packed byte 
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":41
+ *     # Handle case where everything is in one packed byte
  *     if packByteCount == 1:
- *         pOff = (packedStart<<2)             # <<<<<<<<<<<<<< 
+ *         pOff = (packedStart<<2)             # <<<<<<<<<<<<<<
  *         pStart = fragStart - pOff
  *         pEnd = fragEnd - pOff
  */
     __pyx_v_pOff = (__pyx_v_packedStart << 2);
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":42
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":42
  *     if packByteCount == 1:
  *         pOff = (packedStart<<2)
- *         pStart = fragStart - pOff             # <<<<<<<<<<<<<< 
+ *         pStart = fragStart - pOff             # <<<<<<<<<<<<<<
  *         pEnd = fragEnd - pOff
  *         partial = packed[0]
  */
     __pyx_v_pStart = (__pyx_v_fragStart - __pyx_v_pOff);
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":43
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":43
  *         pOff = (packedStart<<2)
  *         pStart = fragStart - pOff
- *         pEnd = fragEnd - pOff             # <<<<<<<<<<<<<< 
+ *         pEnd = fragEnd - pOff             # <<<<<<<<<<<<<<
  *         partial = packed[0]
  *         assert pEnd <= 4
  */
     __pyx_v_pEnd = (__pyx_v_fragEnd - __pyx_v_pOff);
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":44
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":44
  *         pStart = fragStart - pOff
  *         pEnd = fragEnd - pOff
- *         partial = packed[0]             # <<<<<<<<<<<<<< 
+ *         partial = packed[0]             # <<<<<<<<<<<<<<
  *         assert pEnd <= 4
  *         assert pStart >= 0
  */
     __pyx_v_partial = (__pyx_v_packed[0]);
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":45
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":45
  *         pEnd = fragEnd - pOff
  *         partial = packed[0]
- *         assert pEnd <= 4             # <<<<<<<<<<<<<< 
+ *         assert pEnd <= 4             # <<<<<<<<<<<<<<
  *         assert pStart >= 0
  *         for i from pStart <= i < pEnd:
  */
     #ifndef PYREX_WITHOUT_ASSERTIONS
     if (unlikely(!(__pyx_v_pEnd <= 4))) {
       PyErr_SetNone(PyExc_AssertionError);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
     #endif
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":46
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":46
  *         partial = packed[0]
  *         assert pEnd <= 4
- *         assert pStart >= 0             # <<<<<<<<<<<<<< 
+ *         assert pStart >= 0             # <<<<<<<<<<<<<<
  *         for i from pStart <= i < pEnd:
  *             dna[0] = valToNt[(partial >> (6-i-i)) & 3]
  */
     #ifndef PYREX_WITHOUT_ASSERTIONS
     if (unlikely(!(__pyx_v_pStart >= 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
     #endif
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":47
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":47
  *         assert pEnd <= 4
  *         assert pStart >= 0
- *         for i from pStart <= i < pEnd:             # <<<<<<<<<<<<<< 
+ *         for i from pStart <= i < pEnd:             # <<<<<<<<<<<<<<
  *             dna[0] = valToNt[(partial >> (6-i-i)) & 3]
  *             dna = dna + 1
  */
     for (__pyx_v_i = __pyx_v_pStart; __pyx_v_i < __pyx_v_pEnd; __pyx_v_i++) {
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":48
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":48
  *         assert pStart >= 0
  *         for i from pStart <= i < pEnd:
- *             dna[0] = valToNt[(partial >> (6-i-i)) & 3]             # <<<<<<<<<<<<<< 
+ *             dna[0] = valToNt[(partial >> (6-i-i)) & 3]             # <<<<<<<<<<<<<<
  *             dna = dna + 1
  *     else:
  */
       (__pyx_v_dna[0]) = (__pyx_v_2bx_3seq_7_twobit_valToNt[((__pyx_v_partial >> ((6 - __pyx_v_i) - __pyx_v_i)) & 3)]);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":49
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":49
  *         for i from pStart <= i < pEnd:
  *             dna[0] = valToNt[(partial >> (6-i-i)) & 3]
- *             dna = dna + 1             # <<<<<<<<<<<<<< 
+ *             dna = dna + 1             # <<<<<<<<<<<<<<
  *     else:
  *         # Handle partial first packed byte.
  */
       __pyx_v_dna = (__pyx_v_dna + 1);
     }
-    goto __pyx_L4;
+    goto __pyx_L6;
   }
   /*else*/ {
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":52
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":52
  *     else:
  *         # Handle partial first packed byte.
- *         midStart = fragStart;             # <<<<<<<<<<<<<< 
+ *         midStart = fragStart;             # <<<<<<<<<<<<<<
  *         remainder = ( fragStart&3 )
  *         if remainder > 0:
  */
     __pyx_v_midStart = __pyx_v_fragStart;
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":53
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":53
  *         # Handle partial first packed byte.
  *         midStart = fragStart;
- *         remainder = ( fragStart&3 )             # <<<<<<<<<<<<<< 
+ *         remainder = ( fragStart&3 )             # <<<<<<<<<<<<<<
  *         if remainder > 0:
  *             partial = packed[0]; packed = packed + 1
  */
     __pyx_v_remainder = (__pyx_v_fragStart & 3);
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":54
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":54
  *         midStart = fragStart;
  *         remainder = ( fragStart&3 )
- *         if remainder > 0:             # <<<<<<<<<<<<<< 
+ *         if remainder > 0:             # <<<<<<<<<<<<<<
  *             partial = packed[0]; packed = packed + 1
  *             partCount = 4 - remainder;
  */
-    __pyx_5 = (__pyx_v_remainder > 0);
-    if (__pyx_5) {
+    __pyx_4 = (__pyx_v_remainder > 0);
+    if (__pyx_4) {
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":55
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":55
  *         remainder = ( fragStart&3 )
  *         if remainder > 0:
- *             partial = packed[0]; packed = packed + 1             # <<<<<<<<<<<<<< 
+ *             partial = packed[0]; packed = packed + 1             # <<<<<<<<<<<<<<
  *             partCount = 4 - remainder;
  *             for i from partCount - 1 >= i >= 0:
  */
       __pyx_v_partial = (__pyx_v_packed[0]);
       __pyx_v_packed = (__pyx_v_packed + 1);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":56
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":56
  *         if remainder > 0:
  *             partial = packed[0]; packed = packed + 1
- *             partCount = 4 - remainder;             # <<<<<<<<<<<<<< 
+ *             partCount = 4 - remainder;             # <<<<<<<<<<<<<<
  *             for i from partCount - 1 >= i >= 0:
  *                 dna[i] = valToNt[ partial & 3 ]
  */
       __pyx_v_partCount = (4 - __pyx_v_remainder);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":57
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":57
  *             partial = packed[0]; packed = packed + 1
  *             partCount = 4 - remainder;
- *             for i from partCount - 1 >= i >= 0:             # <<<<<<<<<<<<<< 
+ *             for i from partCount - 1 >= i >= 0:             # <<<<<<<<<<<<<<
  *                 dna[i] = valToNt[ partial & 3 ]
  *                 partial = partial >> 2
  */
       for (__pyx_v_i = (__pyx_v_partCount - 1); __pyx_v_i >= 0; __pyx_v_i--) {
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":58
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":58
  *             partCount = 4 - remainder;
  *             for i from partCount - 1 >= i >= 0:
- *                 dna[i] = valToNt[ partial & 3 ]             # <<<<<<<<<<<<<< 
+ *                 dna[i] = valToNt[ partial & 3 ]             # <<<<<<<<<<<<<<
  *                 partial = partial >> 2
  *             midStart = midStart + partCount
  */
         (__pyx_v_dna[__pyx_v_i]) = (__pyx_v_2bx_3seq_7_twobit_valToNt[(__pyx_v_partial & 3)]);
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":59
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":59
  *             for i from partCount - 1 >= i >= 0:
  *                 dna[i] = valToNt[ partial & 3 ]
- *                 partial = partial >> 2             # <<<<<<<<<<<<<< 
+ *                 partial = partial >> 2             # <<<<<<<<<<<<<<
  *             midStart = midStart + partCount
  *             dna = dna + partCount
  */
         __pyx_v_partial = (__pyx_v_partial >> 2);
       }
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":60
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":60
  *                 dna[i] = valToNt[ partial & 3 ]
  *                 partial = partial >> 2
- *             midStart = midStart + partCount             # <<<<<<<<<<<<<< 
+ *             midStart = midStart + partCount             # <<<<<<<<<<<<<<
  *             dna = dna + partCount
  *         # Handle middle bytes.
  */
       __pyx_v_midStart = (__pyx_v_midStart + __pyx_v_partCount);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":61
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":61
  *                 partial = partial >> 2
  *             midStart = midStart + partCount
- *             dna = dna + partCount             # <<<<<<<<<<<<<< 
+ *             dna = dna + partCount             # <<<<<<<<<<<<<<
  *         # Handle middle bytes.
  *         remainder = fragEnd&3
  */
       __pyx_v_dna = (__pyx_v_dna + __pyx_v_partCount);
-      goto __pyx_L7;
+      goto __pyx_L9;
     }
-    __pyx_L7:;
+    __pyx_L9:;
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":63
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":63
  *             dna = dna + partCount
  *         # Handle middle bytes.
- *         remainder = fragEnd&3             # <<<<<<<<<<<<<< 
+ *         remainder = fragEnd&3             # <<<<<<<<<<<<<<
  *         midEnd = fragEnd - remainder
  *         i = midStart
  */
     __pyx_v_remainder = (__pyx_v_fragEnd & 3);
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":64
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":64
  *         # Handle middle bytes.
  *         remainder = fragEnd&3
- *         midEnd = fragEnd - remainder             # <<<<<<<<<<<<<< 
+ *         midEnd = fragEnd - remainder             # <<<<<<<<<<<<<<
  *         i = midStart
  *         while i < midEnd:
  */
-    __pyx_1 = PyInt_FromLong((__pyx_v_fragEnd - __pyx_v_remainder)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_1 = PyInt_FromLong((__pyx_v_fragEnd - __pyx_v_remainder)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_v_midEnd);
     __pyx_v_midEnd = __pyx_1;
     __pyx_1 = 0;
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":65
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":65
  *         remainder = fragEnd&3
  *         midEnd = fragEnd - remainder
- *         i = midStart             # <<<<<<<<<<<<<< 
+ *         i = midStart             # <<<<<<<<<<<<<<
  *         while i < midEnd:
  *             partial = packed[0]
  */
     __pyx_v_i = __pyx_v_midStart;
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":66
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":66
  *         midEnd = fragEnd - remainder
  *         i = midStart
- *         while i < midEnd:             # <<<<<<<<<<<<<< 
+ *         while i < midEnd:             # <<<<<<<<<<<<<<
  *             partial = packed[0]
  *             packed = packed + 1;
  */
     while (1) {
-      __pyx_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_v_midEnd, Py_LT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
-      __pyx_5 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;}
+      __pyx_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyObject_RichCompare(__pyx_3, __pyx_v_midEnd, Py_LT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_2); __pyx_2 = 0;
-      if (!__pyx_5) break;
+      if (!__pyx_4) break;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":67
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":67
  *         i = midStart
  *         while i < midEnd:
- *             partial = packed[0]             # <<<<<<<<<<<<<< 
+ *             partial = packed[0]             # <<<<<<<<<<<<<<
  *             packed = packed + 1;
  *             dna[3] = valToNt[partial&3];
  */
       __pyx_v_partial = (__pyx_v_packed[0]);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":68
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":68
  *         while i < midEnd:
  *             partial = packed[0]
- *             packed = packed + 1;             # <<<<<<<<<<<<<< 
+ *             packed = packed + 1;             # <<<<<<<<<<<<<<
  *             dna[3] = valToNt[partial&3];
  *             partial = partial >> 2
  */
       __pyx_v_packed = (__pyx_v_packed + 1);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":69
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":69
  *             partial = packed[0]
  *             packed = packed + 1;
- *             dna[3] = valToNt[partial&3];             # <<<<<<<<<<<<<< 
+ *             dna[3] = valToNt[partial&3];             # <<<<<<<<<<<<<<
  *             partial = partial >> 2
  *             dna[2] = valToNt[partial&3];
  */
       (__pyx_v_dna[3]) = (__pyx_v_2bx_3seq_7_twobit_valToNt[(__pyx_v_partial & 3)]);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":70
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":70
  *             packed = packed + 1;
  *             dna[3] = valToNt[partial&3];
- *             partial = partial >> 2             # <<<<<<<<<<<<<< 
+ *             partial = partial >> 2             # <<<<<<<<<<<<<<
  *             dna[2] = valToNt[partial&3];
  *             partial = partial >> 2
  */
       __pyx_v_partial = (__pyx_v_partial >> 2);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":71
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":71
  *             dna[3] = valToNt[partial&3];
  *             partial = partial >> 2
- *             dna[2] = valToNt[partial&3];             # <<<<<<<<<<<<<< 
+ *             dna[2] = valToNt[partial&3];             # <<<<<<<<<<<<<<
  *             partial = partial >> 2
  *             dna[1] = valToNt[partial&3];
  */
       (__pyx_v_dna[2]) = (__pyx_v_2bx_3seq_7_twobit_valToNt[(__pyx_v_partial & 3)]);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":72
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":72
  *             partial = partial >> 2
  *             dna[2] = valToNt[partial&3];
- *             partial = partial >> 2             # <<<<<<<<<<<<<< 
+ *             partial = partial >> 2             # <<<<<<<<<<<<<<
  *             dna[1] = valToNt[partial&3];
  *             partial = partial >> 2
  */
       __pyx_v_partial = (__pyx_v_partial >> 2);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":73
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":73
  *             dna[2] = valToNt[partial&3];
  *             partial = partial >> 2
- *             dna[1] = valToNt[partial&3];             # <<<<<<<<<<<<<< 
+ *             dna[1] = valToNt[partial&3];             # <<<<<<<<<<<<<<
  *             partial = partial >> 2
  *             dna[0] = valToNt[partial&3];
  */
       (__pyx_v_dna[1]) = (__pyx_v_2bx_3seq_7_twobit_valToNt[(__pyx_v_partial & 3)]);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":74
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":74
  *             partial = partial >> 2
  *             dna[1] = valToNt[partial&3];
- *             partial = partial >> 2             # <<<<<<<<<<<<<< 
+ *             partial = partial >> 2             # <<<<<<<<<<<<<<
  *             dna[0] = valToNt[partial&3];
- *             dna = dna + 4;            
+ *             dna = dna + 4;
  */
       __pyx_v_partial = (__pyx_v_partial >> 2);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":75
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":75
  *             dna[1] = valToNt[partial&3];
  *             partial = partial >> 2
- *             dna[0] = valToNt[partial&3];             # <<<<<<<<<<<<<< 
- *             dna = dna + 4;            
+ *             dna[0] = valToNt[partial&3];             # <<<<<<<<<<<<<<
+ *             dna = dna + 4;
  *             # Increment
  */
       (__pyx_v_dna[0]) = (__pyx_v_2bx_3seq_7_twobit_valToNt[(__pyx_v_partial & 3)]);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":76
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":76
  *             partial = partial >> 2
  *             dna[0] = valToNt[partial&3];
- *             dna = dna + 4;             # <<<<<<<<<<<<<< 
+ *             dna = dna + 4;             # <<<<<<<<<<<<<<
  *             # Increment
  *             i = i + 4
  */
       __pyx_v_dna = (__pyx_v_dna + 4);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":78
- *             dna = dna + 4;            
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":78
+ *             dna = dna + 4;
  *             # Increment
- *             i = i + 4             # <<<<<<<<<<<<<< 
+ *             i = i + 4             # <<<<<<<<<<<<<<
  *             ## sys.stderr.write( "!!!< " + dna_py + " >!!!\n" ); sys.stderr.flush()
  *         # End
  */
       __pyx_v_i = (__pyx_v_i + 4);
     }
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":81
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":81
  *             ## sys.stderr.write( "!!!< " + dna_py + " >!!!\n" ); sys.stderr.flush()
  *         # End
- *         if remainder > 0:             # <<<<<<<<<<<<<< 
+ *         if remainder > 0:             # <<<<<<<<<<<<<<
  *             partial = packed[0];
  *             partial = partial >> (8-remainder-remainder)
  */
-    __pyx_5 = (__pyx_v_remainder > 0);
-    if (__pyx_5) {
+    __pyx_4 = (__pyx_v_remainder > 0);
+    if (__pyx_4) {
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":82
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":82
  *         # End
  *         if remainder > 0:
- *             partial = packed[0];             # <<<<<<<<<<<<<< 
+ *             partial = packed[0];             # <<<<<<<<<<<<<<
  *             partial = partial >> (8-remainder-remainder)
  *             for i from remainder - 1 >= i >= 0:
  */
       __pyx_v_partial = (__pyx_v_packed[0]);
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":83
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":83
  *         if remainder > 0:
  *             partial = packed[0];
- *             partial = partial >> (8-remainder-remainder)             # <<<<<<<<<<<<<< 
+ *             partial = partial >> (8-remainder-remainder)             # <<<<<<<<<<<<<<
  *             for i from remainder - 1 >= i >= 0:
  *                 dna[i] = valToNt[partial&3]
  */
       __pyx_v_partial = (__pyx_v_partial >> ((8 - __pyx_v_remainder) - __pyx_v_remainder));
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":84
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":84
  *             partial = packed[0];
  *             partial = partial >> (8-remainder-remainder)
- *             for i from remainder - 1 >= i >= 0:             # <<<<<<<<<<<<<< 
+ *             for i from remainder - 1 >= i >= 0:             # <<<<<<<<<<<<<<
  *                 dna[i] = valToNt[partial&3]
  *                 partial = partial >> 2
  */
       for (__pyx_v_i = (__pyx_v_remainder - 1); __pyx_v_i >= 0; __pyx_v_i--) {
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":85
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":85
  *             partial = partial >> (8-remainder-remainder)
  *             for i from remainder - 1 >= i >= 0:
- *                 dna[i] = valToNt[partial&3]             # <<<<<<<<<<<<<< 
+ *                 dna[i] = valToNt[partial&3]             # <<<<<<<<<<<<<<
  *                 partial = partial >> 2
  *     # Restore DNA pointer
  */
         (__pyx_v_dna[__pyx_v_i]) = (__pyx_v_2bx_3seq_7_twobit_valToNt[(__pyx_v_partial & 3)]);
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":86
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":86
  *             for i from remainder - 1 >= i >= 0:
  *                 dna[i] = valToNt[partial&3]
- *                 partial = partial >> 2             # <<<<<<<<<<<<<< 
+ *                 partial = partial >> 2             # <<<<<<<<<<<<<<
  *     # Restore DNA pointer
  *     dna = PyString_AsString( dna_py )
  */
         __pyx_v_partial = (__pyx_v_partial >> 2);
       }
-      goto __pyx_L12;
+      goto __pyx_L14;
     }
-    __pyx_L12:;
+    __pyx_L14:;
   }
-  __pyx_L4:;
+  __pyx_L6:;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":88
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":88
  *                 partial = partial >> 2
  *     # Restore DNA pointer
- *     dna = PyString_AsString( dna_py )             # <<<<<<<<<<<<<< 
+ *     dna = PyString_AsString( dna_py )             # <<<<<<<<<<<<<<
  *     # N's
  *     n_block_count = len( seq.n_block_starts )
  */
   __pyx_v_dna = PyString_AsString(__pyx_v_dna_py);
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":90
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":90
  *     dna = PyString_AsString( dna_py )
  *     # N's
- *     n_block_count = len( seq.n_block_starts )             # <<<<<<<<<<<<<< 
+ *     n_block_count = len( seq.n_block_starts )             # <<<<<<<<<<<<<<
  *     if n_block_count > 0:
  *         start_ix = bisect( seq.n_block_starts, fragStart ) - 1
  */
-  __pyx_3 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_n_block_starts); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  __pyx_6 = PyObject_Length(__pyx_3); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_1 = PyInt_FromSsize_t(__pyx_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_n_block_starts); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyObject_Length(__pyx_1); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_3 = PyInt_FromSsize_t(__pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_v_n_block_count);
-  __pyx_v_n_block_count = __pyx_1;
-  __pyx_1 = 0;
+  __pyx_v_n_block_count = __pyx_3;
+  __pyx_3 = 0;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":91
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":91
  *     # N's
  *     n_block_count = len( seq.n_block_starts )
- *     if n_block_count > 0:             # <<<<<<<<<<<<<< 
+ *     if n_block_count > 0:             # <<<<<<<<<<<<<<
  *         start_ix = bisect( seq.n_block_starts, fragStart ) - 1
- *         if start_ix < 0: start_ix = 0            
+ *         if start_ix < 0: start_ix = 0
  */
-  __pyx_4 = PyObject_RichCompare(__pyx_v_n_block_count, __pyx_int_0, Py_GT); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  __pyx_5 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  Py_DECREF(__pyx_4); __pyx_4 = 0;
-  if (__pyx_5) {
+  __pyx_2 = PyObject_RichCompare(__pyx_v_n_block_count, __pyx_int_0, Py_GT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  if (__pyx_4) {
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":92
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":92
  *     n_block_count = len( seq.n_block_starts )
  *     if n_block_count > 0:
- *         start_ix = bisect( seq.n_block_starts, fragStart ) - 1             # <<<<<<<<<<<<<< 
- *         if start_ix < 0: start_ix = 0            
+ *         start_ix = bisect( seq.n_block_starts, fragStart ) - 1             # <<<<<<<<<<<<<<
+ *         if start_ix < 0: start_ix = 0
  *         for i from start_ix <= i < n_block_count:
  */
-    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_bisect); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    __pyx_3 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_n_block_starts); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    __pyx_1 = PyInt_FromLong(__pyx_v_fragStart); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
-    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_1);
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_bisect); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_n_block_starts); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = PyInt_FromLong(__pyx_v_fragStart); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3);
+    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_2);
     __pyx_3 = 0;
-    __pyx_1 = 0;
-    __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    Py_DECREF(__pyx_2); __pyx_2 = 0;
-    Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
-    __pyx_1 = PyNumber_Subtract(__pyx_3, __pyx_int_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_2 = 0;
+    __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0;
+    __pyx_t_1 = PyNumber_Subtract(__pyx_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
     Py_DECREF(__pyx_v_start_ix);
-    __pyx_v_start_ix = __pyx_1;
-    __pyx_1 = 0;
+    __pyx_v_start_ix = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":93
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":93
  *     if n_block_count > 0:
  *         start_ix = bisect( seq.n_block_starts, fragStart ) - 1
- *         if start_ix < 0: start_ix = 0             # <<<<<<<<<<<<<< 
+ *         if start_ix < 0: start_ix = 0             # <<<<<<<<<<<<<<
  *         for i from start_ix <= i < n_block_count:
  *             s = seq.n_block_starts[i];
  */
-    __pyx_2 = PyObject_RichCompare(__pyx_v_start_ix, __pyx_int_0, Py_LT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    __pyx_5 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_2 = PyObject_RichCompare(__pyx_v_start_ix, __pyx_int_0, Py_LT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
-    if (__pyx_5) {
+    if (__pyx_4) {
       Py_INCREF(__pyx_int_0);
       Py_DECREF(__pyx_v_start_ix);
       __pyx_v_start_ix = __pyx_int_0;
-      goto __pyx_L16;
+      goto __pyx_L18;
     }
-    __pyx_L16:;
+    __pyx_L18:;
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":94
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":94
  *         start_ix = bisect( seq.n_block_starts, fragStart ) - 1
- *         if start_ix < 0: start_ix = 0            
- *         for i from start_ix <= i < n_block_count:             # <<<<<<<<<<<<<< 
+ *         if start_ix < 0: start_ix = 0
+ *         for i from start_ix <= i < n_block_count:             # <<<<<<<<<<<<<<
  *             s = seq.n_block_starts[i];
  *             e = s + seq.n_block_sizes[i];
  */
-    __pyx_7 = __pyx_PyInt_int(__pyx_v_start_ix); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    __pyx_8 = __pyx_PyInt_int(__pyx_v_n_block_count); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_7 = __pyx_PyInt_int(__pyx_v_start_ix); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_8 = __pyx_PyInt_int(__pyx_v_n_block_count); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     for (__pyx_v_i = __pyx_7; __pyx_v_i < __pyx_8; __pyx_v_i++) {
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":95
- *         if start_ix < 0: start_ix = 0            
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":95
+ *         if start_ix < 0: start_ix = 0
  *         for i from start_ix <= i < n_block_count:
- *             s = seq.n_block_starts[i];             # <<<<<<<<<<<<<< 
+ *             s = seq.n_block_starts[i];             # <<<<<<<<<<<<<<
  *             e = s + seq.n_block_sizes[i];
  *             if (s >= fragEnd):
  */
-      __pyx_4 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_n_block_starts); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      if (PyList_CheckExact(__pyx_4) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_4)) {
-        __pyx_1 = PyList_GET_ITEM(__pyx_4, __pyx_v_i); Py_INCREF(__pyx_1);
-        } else if (PyTuple_CheckExact(__pyx_4) && 0 <= __pyx_v_i && __pyx_v_i < PyTuple_GET_SIZE(__pyx_4)) {
-        __pyx_1 = PyTuple_GET_ITEM(__pyx_4, __pyx_v_i); Py_INCREF(__pyx_1);
-        } else {
-        __pyx_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        __pyx_1 = PyObject_GetItem(__pyx_4, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        Py_DECREF(__pyx_3); __pyx_3 = 0;
-      }
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
-      __pyx_9 = __pyx_PyInt_int(__pyx_1); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1;}
+      __pyx_1 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_n_block_starts); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_6 = __Pyx_GetItemInt(__pyx_1, __pyx_v_i, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_1); __pyx_1 = 0;
+      __pyx_9 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_6); __pyx_6 = 0;
       __pyx_v_s = __pyx_9;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":96
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":96
  *         for i from start_ix <= i < n_block_count:
  *             s = seq.n_block_starts[i];
- *             e = s + seq.n_block_sizes[i];             # <<<<<<<<<<<<<< 
+ *             e = s + seq.n_block_sizes[i];             # <<<<<<<<<<<<<<
  *             if (s >= fragEnd):
  *                 break
  */
-      __pyx_2 = PyInt_FromLong(__pyx_v_s); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      __pyx_4 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_n_block_sizes); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      if (PyList_CheckExact(__pyx_4) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_4)) {
-        __pyx_1 = PyList_GET_ITEM(__pyx_4, __pyx_v_i); Py_INCREF(__pyx_1);
-        } else if (PyTuple_CheckExact(__pyx_4) && 0 <= __pyx_v_i && __pyx_v_i < PyTuple_GET_SIZE(__pyx_4)) {
-        __pyx_1 = PyTuple_GET_ITEM(__pyx_4, __pyx_v_i); Py_INCREF(__pyx_1);
-        } else {
-        __pyx_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        __pyx_1 = PyObject_GetItem(__pyx_4, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        Py_DECREF(__pyx_3); __pyx_3 = 0;
-      }
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
-      __pyx_4 = PyNumber_Add(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1;}
+      __pyx_3 = PyInt_FromLong(__pyx_v_s); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_n_block_sizes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = __Pyx_GetItemInt(__pyx_2, __pyx_v_i, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_2); __pyx_2 = 0;
+      __pyx_t_1 = PyNumber_Add(__pyx_3, __pyx_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
       Py_DECREF(__pyx_1); __pyx_1 = 0;
-      __pyx_9 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      __pyx_9 = __pyx_PyInt_int(__pyx_t_1); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_v_e = __pyx_9;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":97
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":97
  *             s = seq.n_block_starts[i];
  *             e = s + seq.n_block_sizes[i];
- *             if (s >= fragEnd):             # <<<<<<<<<<<<<< 
+ *             if (s >= fragEnd):             # <<<<<<<<<<<<<<
  *                 break
  *             if (s < fragStart):
  */
-      __pyx_5 = (__pyx_v_s >= __pyx_v_fragEnd);
-      if (__pyx_5) {
-        goto __pyx_L18;
-        goto __pyx_L19;
+      __pyx_4 = (__pyx_v_s >= __pyx_v_fragEnd);
+      if (__pyx_4) {
+
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":98
+ *             e = s + seq.n_block_sizes[i];
+ *             if (s >= fragEnd):
+ *                 break             # <<<<<<<<<<<<<<
+ *             if (s < fragStart):
+ *                s = fragStart
+ */
+        goto __pyx_L20;
+        goto __pyx_L21;
       }
-      __pyx_L19:;
+      __pyx_L21:;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":99
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":99
  *             if (s >= fragEnd):
  *                 break
- *             if (s < fragStart):             # <<<<<<<<<<<<<< 
+ *             if (s < fragStart):             # <<<<<<<<<<<<<<
  *                s = fragStart
  *             if (e > fragEnd):
  */
-      __pyx_5 = (__pyx_v_s < __pyx_v_fragStart);
-      if (__pyx_5) {
+      __pyx_4 = (__pyx_v_s < __pyx_v_fragStart);
+      if (__pyx_4) {
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":100
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":100
  *                 break
  *             if (s < fragStart):
- *                s = fragStart             # <<<<<<<<<<<<<< 
+ *                s = fragStart             # <<<<<<<<<<<<<<
  *             if (e > fragEnd):
  *                e = fragEnd
  */
         __pyx_v_s = __pyx_v_fragStart;
-        goto __pyx_L20;
+        goto __pyx_L22;
       }
-      __pyx_L20:;
+      __pyx_L22:;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":101
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":101
  *             if (s < fragStart):
  *                s = fragStart
- *             if (e > fragEnd):             # <<<<<<<<<<<<<< 
+ *             if (e > fragEnd):             # <<<<<<<<<<<<<<
  *                e = fragEnd
  *             if (s < e):
  */
-      __pyx_5 = (__pyx_v_e > __pyx_v_fragEnd);
-      if (__pyx_5) {
+      __pyx_4 = (__pyx_v_e > __pyx_v_fragEnd);
+      if (__pyx_4) {
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":102
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":102
  *                s = fragStart
  *             if (e > fragEnd):
- *                e = fragEnd             # <<<<<<<<<<<<<< 
+ *                e = fragEnd             # <<<<<<<<<<<<<<
  *             if (s < e):
  *                 memset( dna + s - fragStart, 'N'[0], e - s)
  */
         __pyx_v_e = __pyx_v_fragEnd;
-        goto __pyx_L21;
+        goto __pyx_L23;
       }
-      __pyx_L21:;
+      __pyx_L23:;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":103
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":103
  *             if (e > fragEnd):
  *                e = fragEnd
- *             if (s < e):             # <<<<<<<<<<<<<< 
+ *             if (s < e):             # <<<<<<<<<<<<<<
  *                 memset( dna + s - fragStart, 'N'[0], e - s)
  *     # Mask
  */
-      __pyx_5 = (__pyx_v_s < __pyx_v_e);
-      if (__pyx_5) {
+      __pyx_4 = (__pyx_v_s < __pyx_v_e);
+      if (__pyx_4) {
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":104
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":104
  *                e = fragEnd
  *             if (s < e):
- *                 memset( dna + s - fragStart, 'N'[0], e - s)             # <<<<<<<<<<<<<< 
+ *                 memset( dna + s - fragStart, 'N'[0], e - s)             # <<<<<<<<<<<<<<
  *     # Mask
  *     if do_mask:
  */
-        memset(((__pyx_v_dna + __pyx_v_s) - __pyx_v_fragStart), (__pyx_k_6[0]), (__pyx_v_e - __pyx_v_s));
-        goto __pyx_L22;
+        __pyx_6 = __Pyx_GetItemInt(__pyx_kp_15, 0, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_9 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_6); __pyx_6 = 0;
+        memset(((__pyx_v_dna + __pyx_v_s) - __pyx_v_fragStart), __pyx_9, (__pyx_v_e - __pyx_v_s));
+        goto __pyx_L24;
       }
-      __pyx_L22:;
+      __pyx_L24:;
     }
-    __pyx_L18:;
-    goto __pyx_L15;
+    __pyx_L20:;
+    goto __pyx_L17;
   }
-  __pyx_L15:;
+  __pyx_L17:;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":106
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":106
  *                 memset( dna + s - fragStart, 'N'[0], e - s)
  *     # Mask
- *     if do_mask:             # <<<<<<<<<<<<<< 
+ *     if do_mask:             # <<<<<<<<<<<<<<
  *         m_block_count = len( seq.masked_block_starts )
  *         if m_block_count > 0:
  */
-  __pyx_5 = __Pyx_PyObject_IsTrue(__pyx_v_do_mask); if (unlikely(__pyx_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  if (__pyx_5) {
+  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_do_mask); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_4) {
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":107
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":107
  *     # Mask
  *     if do_mask:
- *         m_block_count = len( seq.masked_block_starts )             # <<<<<<<<<<<<<< 
+ *         m_block_count = len( seq.masked_block_starts )             # <<<<<<<<<<<<<<
  *         if m_block_count > 0:
  *             start_ix = bisect( seq.masked_block_starts, fragStart ) - 1
  */
-    __pyx_3 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_masked_block_starts); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    __pyx_6 = PyObject_Length(__pyx_3); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
-    __pyx_2 = PyInt_FromSsize_t(__pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_2 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_masked_block_starts); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_5 = PyObject_Length(__pyx_2); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    __pyx_3 = PyInt_FromSsize_t(__pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_v_m_block_count);
-    __pyx_v_m_block_count = __pyx_2;
-    __pyx_2 = 0;
+    __pyx_v_m_block_count = __pyx_3;
+    __pyx_3 = 0;
 
-    /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":108
+    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":108
  *     if do_mask:
  *         m_block_count = len( seq.masked_block_starts )
- *         if m_block_count > 0:             # <<<<<<<<<<<<<< 
+ *         if m_block_count > 0:             # <<<<<<<<<<<<<<
  *             start_ix = bisect( seq.masked_block_starts, fragStart ) - 1
- *             if start_ix < 0: start_ix = 0    
+ *             if start_ix < 0: start_ix = 0
  */
-    __pyx_1 = PyObject_RichCompare(__pyx_v_m_block_count, __pyx_int_0, Py_GT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
-    __pyx_5 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+    __pyx_1 = PyObject_RichCompare(__pyx_v_m_block_count, __pyx_int_0, Py_GT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_1); __pyx_1 = 0;
-    if (__pyx_5) {
+    if (__pyx_4) {
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":109
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":109
  *         m_block_count = len( seq.masked_block_starts )
  *         if m_block_count > 0:
- *             start_ix = bisect( seq.masked_block_starts, fragStart ) - 1             # <<<<<<<<<<<<<< 
- *             if start_ix < 0: start_ix = 0    
+ *             start_ix = bisect( seq.masked_block_starts, fragStart ) - 1             # <<<<<<<<<<<<<<
+ *             if start_ix < 0: start_ix = 0
  *             for i from start_ix <= i < m_block_count:
  */
-      __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_bisect); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      __pyx_3 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_masked_block_starts); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      __pyx_2 = PyInt_FromLong(__pyx_v_fragStart); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
-      PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2);
+      __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_kp_bisect); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_masked_block_starts); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyInt_FromLong(__pyx_v_fragStart); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
+      PyTuple_SET_ITEM(__pyx_1, 1, __pyx_3);
+      __pyx_2 = 0;
       __pyx_3 = 0;
-      __pyx_2 = 0;
-      __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      __pyx_2 = PyObject_Call(__pyx_6, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_6); __pyx_6 = 0;
       Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-      __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_int_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      __pyx_t_1 = PyNumber_Subtract(__pyx_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_2); __pyx_2 = 0;
       Py_DECREF(__pyx_v_start_ix);
-      __pyx_v_start_ix = __pyx_2;
-      __pyx_2 = 0;
+      __pyx_v_start_ix = __pyx_t_1;
+      __pyx_t_1 = 0;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":110
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":110
  *         if m_block_count > 0:
  *             start_ix = bisect( seq.masked_block_starts, fragStart ) - 1
- *             if start_ix < 0: start_ix = 0             # <<<<<<<<<<<<<< 
+ *             if start_ix < 0: start_ix = 0             # <<<<<<<<<<<<<<
  *             for i from start_ix <= i < m_block_count:
  *                 s = seq.masked_block_starts[i];
  */
-      __pyx_4 = PyObject_RichCompare(__pyx_v_start_ix, __pyx_int_0, Py_LT); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      __pyx_5 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      Py_DECREF(__pyx_4); __pyx_4 = 0;
-      if (__pyx_5) {
+      __pyx_3 = PyObject_RichCompare(__pyx_v_start_ix, __pyx_int_0, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      if (__pyx_4) {
         Py_INCREF(__pyx_int_0);
         Py_DECREF(__pyx_v_start_ix);
         __pyx_v_start_ix = __pyx_int_0;
-        goto __pyx_L25;
+        goto __pyx_L27;
       }
-      __pyx_L25:;
+      __pyx_L27:;
 
-      /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":111
+      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":111
  *             start_ix = bisect( seq.masked_block_starts, fragStart ) - 1
- *             if start_ix < 0: start_ix = 0    
- *             for i from start_ix <= i < m_block_count:             # <<<<<<<<<<<<<< 
+ *             if start_ix < 0: start_ix = 0
+ *             for i from start_ix <= i < m_block_count:             # <<<<<<<<<<<<<<
  *                 s = seq.masked_block_starts[i];
  *                 e = s + seq.masked_block_sizes[i];
  */
-      __pyx_9 = __pyx_PyInt_int(__pyx_v_start_ix); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1;}
-      __pyx_7 = __pyx_PyInt_int(__pyx_v_m_block_count); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1;}
+      __pyx_9 = __pyx_PyInt_int(__pyx_v_start_ix); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = __pyx_PyInt_int(__pyx_v_m_block_count); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       for (__pyx_v_i = __pyx_9; __pyx_v_i < __pyx_7; __pyx_v_i++) {
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":112
- *             if start_ix < 0: start_ix = 0    
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":112
+ *             if start_ix < 0: start_ix = 0
  *             for i from start_ix <= i < m_block_count:
- *                 s = seq.masked_block_starts[i];             # <<<<<<<<<<<<<< 
+ *                 s = seq.masked_block_starts[i];             # <<<<<<<<<<<<<<
  *                 e = s + seq.masked_block_sizes[i];
  *                 if (s >= fragEnd):
  */
-        __pyx_1 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_masked_block_starts); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        if (PyList_CheckExact(__pyx_1) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_1)) {
-          __pyx_2 = PyList_GET_ITEM(__pyx_1, __pyx_v_i); Py_INCREF(__pyx_2);
-          } else if (PyTuple_CheckExact(__pyx_1) && 0 <= __pyx_v_i && __pyx_v_i < PyTuple_GET_SIZE(__pyx_1)) {
-          __pyx_2 = PyTuple_GET_ITEM(__pyx_1, __pyx_v_i); Py_INCREF(__pyx_2);
-          } else {
-          __pyx_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1;}
-          __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1;}
-          Py_DECREF(__pyx_3); __pyx_3 = 0;
-        }
+        __pyx_6 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_masked_block_starts); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_1 = __Pyx_GetItemInt(__pyx_6, __pyx_v_i, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_6); __pyx_6 = 0;
+        __pyx_8 = __pyx_PyInt_int(__pyx_1); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         Py_DECREF(__pyx_1); __pyx_1 = 0;
-        __pyx_8 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        Py_DECREF(__pyx_2); __pyx_2 = 0;
         __pyx_v_s = __pyx_8;
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":113
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":113
  *             for i from start_ix <= i < m_block_count:
  *                 s = seq.masked_block_starts[i];
- *                 e = s + seq.masked_block_sizes[i];             # <<<<<<<<<<<<<< 
+ *                 e = s + seq.masked_block_sizes[i];             # <<<<<<<<<<<<<<
  *                 if (s >= fragEnd):
  *                     break
  */
-        __pyx_4 = PyInt_FromLong(__pyx_v_s); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        __pyx_1 = PyObject_GetAttr(__pyx_v_seq, __pyx_n_masked_block_sizes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        if (PyList_CheckExact(__pyx_1) && 0 <= __pyx_v_i && __pyx_v_i < PyList_GET_SIZE(__pyx_1)) {
-          __pyx_2 = PyList_GET_ITEM(__pyx_1, __pyx_v_i); Py_INCREF(__pyx_2);
-          } else if (PyTuple_CheckExact(__pyx_1) && 0 <= __pyx_v_i && __pyx_v_i < PyTuple_GET_SIZE(__pyx_1)) {
-          __pyx_2 = PyTuple_GET_ITEM(__pyx_1, __pyx_v_i); Py_INCREF(__pyx_2);
-          } else {
-          __pyx_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1;}
-          __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1;}
-          Py_DECREF(__pyx_3); __pyx_3 = 0;
-        }
-        Py_DECREF(__pyx_1); __pyx_1 = 0;
-        __pyx_1 = PyNumber_Add(__pyx_4, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        Py_DECREF(__pyx_4); __pyx_4 = 0;
+        __pyx_2 = PyInt_FromLong(__pyx_v_s); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_3 = PyObject_GetAttr(__pyx_v_seq, __pyx_kp_masked_block_sizes); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_6 = __Pyx_GetItemInt(__pyx_3, __pyx_v_i, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_3); __pyx_3 = 0;
+        __pyx_t_1 = PyNumber_Add(__pyx_2, __pyx_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         Py_DECREF(__pyx_2); __pyx_2 = 0;
-        __pyx_8 = __pyx_PyInt_int(__pyx_1); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1;}
-        Py_DECREF(__pyx_1); __pyx_1 = 0;
+        Py_DECREF(__pyx_6); __pyx_6 = 0;
+        __pyx_8 = __pyx_PyInt_int(__pyx_t_1); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __pyx_v_e = __pyx_8;
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":114
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":114
  *                 s = seq.masked_block_starts[i];
  *                 e = s + seq.masked_block_sizes[i];
- *                 if (s >= fragEnd):             # <<<<<<<<<<<<<< 
+ *                 if (s >= fragEnd):             # <<<<<<<<<<<<<<
  *                     break
  *                 if (s < fragStart):
  */
-        __pyx_5 = (__pyx_v_s >= __pyx_v_fragEnd);
-        if (__pyx_5) {
-          goto __pyx_L27;
-          goto __pyx_L28;
+        __pyx_4 = (__pyx_v_s >= __pyx_v_fragEnd);
+        if (__pyx_4) {
+
+          /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":115
+ *                 e = s + seq.masked_block_sizes[i];
+ *                 if (s >= fragEnd):
+ *                     break             # <<<<<<<<<<<<<<
+ *                 if (s < fragStart):
+ *                    s = fragStart
+ */
+          goto __pyx_L29;
+          goto __pyx_L30;
         }
-        __pyx_L28:;
+        __pyx_L30:;
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":116
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":116
  *                 if (s >= fragEnd):
  *                     break
- *                 if (s < fragStart):             # <<<<<<<<<<<<<< 
+ *                 if (s < fragStart):             # <<<<<<<<<<<<<<
  *                    s = fragStart
  *                 if (e > fragEnd):
  */
-        __pyx_5 = (__pyx_v_s < __pyx_v_fragStart);
-        if (__pyx_5) {
+        __pyx_4 = (__pyx_v_s < __pyx_v_fragStart);
+        if (__pyx_4) {
 
-          /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":117
+          /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":117
  *                     break
  *                 if (s < fragStart):
- *                    s = fragStart             # <<<<<<<<<<<<<< 
+ *                    s = fragStart             # <<<<<<<<<<<<<<
  *                 if (e > fragEnd):
  *                    e = fragEnd
  */
           __pyx_v_s = __pyx_v_fragStart;
-          goto __pyx_L29;
+          goto __pyx_L31;
         }
-        __pyx_L29:;
+        __pyx_L31:;
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":118
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":118
  *                 if (s < fragStart):
  *                    s = fragStart
- *                 if (e > fragEnd):             # <<<<<<<<<<<<<< 
+ *                 if (e > fragEnd):             # <<<<<<<<<<<<<<
  *                    e = fragEnd
  *                 if (s < e):
  */
-        __pyx_5 = (__pyx_v_e > __pyx_v_fragEnd);
-        if (__pyx_5) {
+        __pyx_4 = (__pyx_v_e > __pyx_v_fragEnd);
+        if (__pyx_4) {
 
-          /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":119
+          /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":119
  *                    s = fragStart
  *                 if (e > fragEnd):
- *                    e = fragEnd             # <<<<<<<<<<<<<< 
+ *                    e = fragEnd             # <<<<<<<<<<<<<<
  *                 if (s < e):
  *                     for j from s <= j < e:
  */
           __pyx_v_e = __pyx_v_fragEnd;
-          goto __pyx_L30;
+          goto __pyx_L32;
         }
-        __pyx_L30:;
+        __pyx_L32:;
 
-        /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":120
+        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":120
  *                 if (e > fragEnd):
  *                    e = fragEnd
- *                 if (s < e):             # <<<<<<<<<<<<<< 
+ *                 if (s < e):             # <<<<<<<<<<<<<<
  *                     for j from s <= j < e:
  *                         dna[j-fragStart] = tolower( dna[j-fragStart] )
  */
-        __pyx_5 = (__pyx_v_s < __pyx_v_e);
-        if (__pyx_5) {
+        __pyx_4 = (__pyx_v_s < __pyx_v_e);
+        if (__pyx_4) {
 
-          /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":121
+          /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":121
  *                    e = fragEnd
  *                 if (s < e):
- *                     for j from s <= j < e:             # <<<<<<<<<<<<<< 
+ *                     for j from s <= j < e:             # <<<<<<<<<<<<<<
  *                         dna[j-fragStart] = tolower( dna[j-fragStart] )
  *     return dna_py
  */
           for (__pyx_v_j = __pyx_v_s; __pyx_v_j < __pyx_v_e; __pyx_v_j++) {
 
-            /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":122
+            /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":122
  *                 if (s < e):
  *                     for j from s <= j < e:
- *                         dna[j-fragStart] = tolower( dna[j-fragStart] )             # <<<<<<<<<<<<<< 
+ *                         dna[j-fragStart] = tolower( dna[j-fragStart] )             # <<<<<<<<<<<<<<
  *     return dna_py
  */
             (__pyx_v_dna[(__pyx_v_j - __pyx_v_fragStart)]) = tolower((__pyx_v_dna[(__pyx_v_j - __pyx_v_fragStart)]));
           }
-          goto __pyx_L31;
+          goto __pyx_L33;
         }
-        __pyx_L31:;
+        __pyx_L33:;
       }
-      __pyx_L27:;
-      goto __pyx_L24;
+      __pyx_L29:;
+      goto __pyx_L26;
     }
-    __pyx_L24:;
-    goto __pyx_L23;
+    __pyx_L26:;
+    goto __pyx_L25;
   }
-  __pyx_L23:;
+  __pyx_L25:;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":123
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":123
  *                     for j from s <= j < e:
  *                         dna[j-fragStart] = tolower( dna[j-fragStart] )
- *     return dna_py             # <<<<<<<<<<<<<< 
+ *     return dna_py             # <<<<<<<<<<<<<<
  */
   Py_INCREF(__pyx_v_dna_py);
   __pyx_r = __pyx_v_dna_py;
 
   __pyx_r = Py_None; Py_INCREF(Py_None);
   goto __pyx_L0;
-  __pyx_L1:;
+  __pyx_L1_error:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   Py_XDECREF(__pyx_3);
-  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_6);
   __Pyx_AddTraceback("bx.seq._twobit.read");
   __pyx_r = NULL;
   __pyx_L0:;
   return __pyx_r;
 }
 
-static __Pyx_InternTabEntry __pyx_intern_tab[] = {
-  {&__pyx_n_bisect, "bisect"},
-  {&__pyx_n_masked_block_sizes, "masked_block_sizes"},
-  {&__pyx_n_masked_block_starts, "masked_block_starts"},
-  {&__pyx_n_n_block_sizes, "n_block_sizes"},
-  {&__pyx_n_n_block_starts, "n_block_starts"},
-  {&__pyx_n_read, "read"},
-  {&__pyx_n_seek, "seek"},
-  {&__pyx_n_sequence_offset, "sequence_offset"},
-  {&__pyx_n_struct, "struct"},
-  {&__pyx_n_sys, "sys"},
-  {0, 0}
-};
-
 static struct PyMethodDef __pyx_methods[] = {
   {"read", (PyCFunction)__pyx_pf_2bx_3seq_7_twobit_read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_3seq_7_twobit_read},
   {0, 0, 0, 0}
 
 static void __pyx_init_filenames(void); /*proto*/
 
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+    PyModuleDef_HEAD_INIT,
+    "_twobit",
+    0, /* m_doc */
+    -1, /* m_size */
+    __pyx_methods /* m_methods */,
+    NULL, /* m_reload */
+    NULL, /* m_traverse */
+    NULL, /* m_clear */
+    NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+  {&__pyx_kp_file, __pyx_k_file, sizeof(__pyx_k_file), 1, 1, 1},
+  {&__pyx_kp_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 1, 1, 1},
+  {&__pyx_kp_fragStart, __pyx_k_fragStart, sizeof(__pyx_k_fragStart), 1, 1, 1},
+  {&__pyx_kp_fragEnd, __pyx_k_fragEnd, sizeof(__pyx_k_fragEnd), 1, 1, 1},
+  {&__pyx_kp_do_mask, __pyx_k_do_mask, sizeof(__pyx_k_do_mask), 1, 1, 1},
+  {&__pyx_kp_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 1, 1, 1},
+  {&__pyx_kp_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 1, 1, 1},
+  {&__pyx_kp_bisect, __pyx_k_bisect, sizeof(__pyx_k_bisect), 1, 1, 1},
+  {&__pyx_kp_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 1, 1, 1},
+  {&__pyx_kp_sequence_offset, __pyx_k_sequence_offset, sizeof(__pyx_k_sequence_offset), 1, 1, 1},
+  {&__pyx_kp_read, __pyx_k_read, sizeof(__pyx_k_read), 1, 1, 1},
+  {&__pyx_kp_n_block_starts, __pyx_k_n_block_starts, sizeof(__pyx_k_n_block_starts), 1, 1, 1},
+  {&__pyx_kp_n_block_sizes, __pyx_k_n_block_sizes, sizeof(__pyx_k_n_block_sizes), 1, 1, 1},
+  {&__pyx_kp_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0},
+  {&__pyx_kp_masked_block_starts, __pyx_k_masked_block_starts, sizeof(__pyx_k_masked_block_starts), 1, 1, 1},
+  {&__pyx_kp_masked_block_sizes, __pyx_k_masked_block_sizes, sizeof(__pyx_k_masked_block_sizes), 1, 1, 1},
+  {0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+  return 0;
+  return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  return 0;
+  __pyx_L1_error:;
+  return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
 PyMODINIT_FUNC init_twobit(void); /*proto*/
-PyMODINIT_FUNC init_twobit(void) {
+PyMODINIT_FUNC init_twobit(void)
+#else
+PyMODINIT_FUNC PyInit__twobit(void); /*proto*/
+PyMODINIT_FUNC PyInit__twobit(void)
+#endif
+{
   PyObject *__pyx_1 = 0;
   PyObject *__pyx_2 = 0;
-  /*--- Libary function declarations ---*/
+  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  /*--- Library function declarations ---*/
   __pyx_init_filenames();
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Module creation code ---*/
+  #if PY_MAJOR_VERSION < 3
   __pyx_m = Py_InitModule4("_twobit", __pyx_methods, 0, 0, PYTHON_API_VERSION);
-  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1;};
-  __pyx_b = PyImport_AddModule("__builtin__");
-  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1;};
-  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1;};
-  /*--- Intern code ---*/
-  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1;};
-  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1;};
-  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1;};
-  /*--- String init code ---*/
+  #else
+  __pyx_m = PyModule_Create(&__pyx_moduledef);
+  #endif
+  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  #if PY_MAJOR_VERSION < 3
+  Py_INCREF(__pyx_m);
+  #endif
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
+  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   /*--- Builtin init code ---*/
-  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_skip_dispatch = 0;
   /*--- Global init code ---*/
   /*--- Function export code ---*/
   /*--- Function import code ---*/
   /*--- Execution code ---*/
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":12
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":12
  *     void * memset( void *, int, int )
  * 
- * import struct, sys             # <<<<<<<<<<<<<< 
+ * import struct, sys             # <<<<<<<<<<<<<<
  * 
  * from bisect import bisect
  */
-  __pyx_1 = __Pyx_Import(__pyx_n_struct, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_struct, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = __Pyx_Import(__pyx_kp_struct, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_kp_struct, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = __Pyx_Import(__pyx_kp_sys, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_kp_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":14
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":14
  * import struct, sys
  * 
- * from bisect import bisect             # <<<<<<<<<<<<<< 
+ * from bisect import bisect             # <<<<<<<<<<<<<<
  * 
  * cdef char* valToNt
  */
-  __pyx_1 = PyList_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  Py_INCREF(__pyx_n_bisect);
-  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_bisect);
-  __pyx_2 = __Pyx_Import(__pyx_n_bisect, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyList_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_kp_bisect);
+  PyList_SET_ITEM(__pyx_1, 0, __pyx_kp_bisect);
+  __pyx_2 = __Pyx_Import(__pyx_kp_bisect, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_bisect); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1;}
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_bisect, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1;}
+  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_bisect); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_kp_bisect, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(__pyx_2); __pyx_2 = 0;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":17
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":17
  * 
  * cdef char* valToNt
- * valToNt = "TCAG"             # <<<<<<<<<<<<<< 
+ * valToNt = "TCAG"             # <<<<<<<<<<<<<<
  * 
  * def read( file, seq, int fragStart, int fragEnd, do_mask=False ):
  */
-  __pyx_v_2bx_3seq_7_twobit_valToNt = __pyx_k_5;
+  __pyx_v_2bx_3seq_7_twobit_valToNt = __pyx_k_13;
 
-  /* "/Users/james/projects/bx-python/code/trunk/lib/bx/seq/_twobit.pyx":19
+  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/seq/_twobit.pyx":19
  * valToNt = "TCAG"
  * 
- * def read( file, seq, int fragStart, int fragEnd, do_mask=False ):             # <<<<<<<<<<<<<< 
+ * def read( file, seq, int fragStart, int fragEnd, do_mask=False ):             # <<<<<<<<<<<<<<
  *     """
  *     Stolen directly from Jim Kent's twoBit.c
  */
+  __pyx_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_k_14 = __pyx_2;
+  __pyx_2 = 0;
+  #if PY_MAJOR_VERSION < 3
   return;
-  __pyx_L1:;
+  #else
+  return __pyx_m;
+  #endif
+  __pyx_L1_error:;
   Py_XDECREF(__pyx_1);
   Py_XDECREF(__pyx_2);
   __Pyx_AddTraceback("bx.seq._twobit");
+  #if PY_MAJOR_VERSION >= 3
+  return NULL;
+  #endif
 }
 
-static char *__pyx_filenames[] = {
+static const char *__pyx_filenames[] = {
   "_twobit.pyx",
 };
 
   __pyx_f = __pyx_filenames;
 }
 
-static INLINE void __Pyx_RaiseArgtupleTooLong(
-    Py_ssize_t num_expected,
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name,
+    PyObject* kw_name)
+{
+    PyErr_Format(PyExc_TypeError,
+        #if PY_MAJOR_VERSION >= 3
+        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+        #else
+        "%s() got multiple values for keyword argument '%s'", func_name,
+        PyString_AS_STRING(kw_name));
+        #endif
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+    const char* func_name,
+    int exact,
+    Py_ssize_t num_min,
+    Py_ssize_t num_max,
     Py_ssize_t num_found)
 {
-    const char* error_message =
-    #if PY_VERSION_HEX < 0x02050000
-        "function takes at most %d positional arguments (%d given)";
+    Py_ssize_t num_expected;
+    const char *number, *more_or_less;
+
+    if (num_found < num_min) {
+        num_expected = num_min;
+        more_or_less = "at least";
+    } else {
+        num_expected = num_max;
+        more_or_less = "at most";
+    }
+    if (exact) {
+        more_or_less = "exactly";
+    }
+    number = (num_expected == 1) ? "" : "s";
+    PyErr_Format(PyExc_TypeError,
+        #if PY_VERSION_HEX < 0x02050000
+            "%s() takes %s %d positional argument%s (%d given)",
+        #else
+            "%s() takes %s %zd positional argument%s (%zd given)",
+        #endif
+        func_name, more_or_less, num_expected, number, num_found);
+}
+
+static int __Pyx_ParseOptionalKeywords(
+    PyObject *kwds,
+    PyObject **argnames[],
+    PyObject *kwds2,
+    PyObject *values[],
+    Py_ssize_t num_pos_args,
+    const char* function_name)
+{
+    PyObject *key = 0, *value = 0;
+    Py_ssize_t pos = 0;
+    PyObject*** name;
+    PyObject*** first_kw_arg = argnames + num_pos_args;
+
+    while (PyDict_Next(kwds, &pos, &key, &value)) {
+        #if PY_MAJOR_VERSION < 3
+        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
+        #else
+        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
+        #endif
+            goto invalid_keyword_type;
+        } else {
+            name = argnames;
+            while (*name && (**name != key)) name++;
+            if (*name) {
+                if (name < first_kw_arg) goto arg_passed_twice;
+                values[name-argnames] = value;
+            } else {
+                for (name = first_kw_arg; *name; name++) {
+                    #if PY_MAJOR_VERSION >= 3
+                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+                        PyUnicode_Compare(**name, key) == 0) break;
+                    #else
+                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
+                        strcmp(PyString_AS_STRING(**name),
+                               PyString_AS_STRING(key)) == 0) break;
+                    #endif
+                }
+                if (*name) {
+                    values[name-argnames] = value;
+                } else {
+                    /* unexpected keyword found */
+                    for (name=argnames; name != first_kw_arg; name++) {
+                        if (**name == key) goto arg_passed_twice;
+                        #if PY_MAJOR_VERSION >= 3
+                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;