James Taylor avatar James Taylor committed 7b95ff1

Cythonizing everything with 15.1, fix some deprecations and tests. AlignmentMappingTests currently segmentation faults, but other tests look good

Comments (0)

Files changed (28)

lib/bx/_seqmapping.c

-/* Generated by Cython 0.10.3 on Thu Feb 19 18:09:04 2009 */
+/* Generated by Cython 0.15.1 on Mon Oct 31 12:24:15 2011 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
-#ifndef PY_LONG_LONG
-  #define PY_LONG_LONG LONG_LONG
+#ifndef Py_PYTHON_H
+    #error Python headers needed to compile C extensions, please install development version of Python.
+#else
+
+#include <stddef.h> /* For offsetof */
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+  #ifndef __stdcall
+    #define __stdcall
+  #endif
+  #ifndef __cdecl
+    #define __cdecl
+  #endif
+  #ifndef __fastcall
+    #define __fastcall
+  #endif
+#endif
+
+#ifndef DL_IMPORT
+  #define DL_IMPORT(t) t
 #endif
 #ifndef DL_EXPORT
   #define DL_EXPORT(t) t
 #endif
+
+#ifndef PY_LONG_LONG
+  #define PY_LONG_LONG LONG_LONG
+#endif
+
 #if PY_VERSION_HEX < 0x02040000
   #define METH_COEXIST 0
+  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
   #define PY_SSIZE_T_MIN INT_MIN
+  #define PY_FORMAT_SIZE_T ""
   #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
+  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
   #define PyNumber_Index(o)    PyNumber_Int(o)
   #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
 #endif
+
 #if PY_VERSION_HEX < 0x02060000
   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
   #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;
+     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_INDIRECT (0x0100 | PyBUF_STRIDES)
 
 #endif
+
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 #endif
+
 #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 PyStringObject               PyUnicodeObject
+  #define PyString_Type                PyUnicode_Type
+  #define PyString_Check               PyUnicode_Check
+  #define PyString_CheckExact          PyUnicode_CheckExact
+#endif
+
+#if PY_VERSION_HEX < 0x02060000
+  #define PyBytesObject                PyStringObject
+  #define PyBytes_Type                 PyString_Type
+  #define PyBytes_Check                PyString_Check
+  #define PyBytes_CheckExact           PyString_CheckExact
+  #define PyBytes_FromString           PyString_FromString
+  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
+  #define PyBytes_FromFormat           PyString_FromFormat
+  #define PyBytes_DecodeEscape         PyString_DecodeEscape
+  #define PyBytes_AsString             PyString_AsString
+  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
+  #define PyBytes_Size                 PyString_Size
+  #define PyBytes_AS_STRING            PyString_AS_STRING
+  #define PyBytes_GET_SIZE             PyString_GET_SIZE
+  #define PyBytes_Repr                 PyString_Repr
+  #define PyBytes_Concat               PyString_Concat
+  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
+#endif
+
+#if PY_VERSION_HEX < 0x02060000
+  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
+  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#endif
+#ifndef PySet_CheckExact
+  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
+#endif
+
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+
+#if PY_MAJOR_VERSION >= 3
+  #define PyIntObject                  PyLongObject
   #define PyInt_Type                   PyLong_Type
   #define PyInt_Check(op)              PyLong_Check(op)
   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
   #define PyInt_AsSsize_t              PyLong_AsSsize_t
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+#endif
+
+#if PY_MAJOR_VERSION >= 3
+  #define PyBoolObject                 PyLongObject
+#endif
+
+#if PY_VERSION_HEX < 0x03020000
+  typedef long Py_hash_t;
+  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
+#else
+  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 #else
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define PyBytes_Type                 PyString_Type
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
 #endif
+
+#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
+  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
+  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
+  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#else
+  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
+        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
+        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
+            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
+  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
+        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
+        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
+            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
+        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
+        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
+            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+#endif
+
 #if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
+  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #endif
-#if !defined(WIN32) && !defined(MS_WINDOWS)
-  #ifndef __stdcall
-    #define __stdcall
+
+#if PY_VERSION_HEX < 0x02050000
+  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
+  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
+  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
+#else
+  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
+  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
+  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#endif
+
+#if PY_VERSION_HEX < 0x02050000
+  #define __Pyx_NAMESTR(n) ((char *)(n))
+  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#else
+  #define __Pyx_NAMESTR(n) (n)
+  #define __Pyx_DOCSTR(n)  (n)
+#endif
+
+#ifndef __PYX_EXTERN_C
+  #ifdef __cplusplus
+    #define __PYX_EXTERN_C extern "C"
+  #else
+    #define __PYX_EXTERN_C extern
   #endif
-  #ifndef __cdecl
-    #define __cdecl
-  #endif
-#else
-  #define _USE_MATH_DEFINES
 #endif
-#ifdef __cplusplus
-#define __PYX_EXTERN_C extern "C"
-#else
-#define __PYX_EXTERN_C extern
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
 #endif
 #include <math.h>
+#define __PYX_HAVE__bx___seqmapping
 #define __PYX_HAVE_API__bx___seqmapping
 #include "stdlib.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+
+/* inline attribute */
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    #define CYTHON_INLINE inline
+  #else
+    #define CYTHON_INLINE
+  #endif
+#endif
+
+/* unused attribute */
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define CYTHON_UNUSED __attribute__ ((__unused__))
+#   else
+#     define CYTHON_UNUSED
+#   endif
+# elif defined(__ICC) || defined(__INTEL_COMPILER)
+#   define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+#   define CYTHON_UNUSED
+# endif
+#endif
+
+typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
+
+
+/* Type Conversion Predeclarations */
+
+#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
+#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
 
 #ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE 
-#endif
-
-typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
-
-
-
-static int __pyx_skip_dispatch = 0;
-
-
-/* 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 INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x);
-static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b);
-
-#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x))
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-
-static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x);
-static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x);
-static INLINE char __pyx_PyInt_char(PyObject* x);
-static INLINE short __pyx_PyInt_short(PyObject* x);
-static INLINE int __pyx_PyInt_int(PyObject* x);
-static INLINE long __pyx_PyInt_long(PyObject* x);
-static INLINE signed char __pyx_PyInt_signed_char(PyObject* x);
-static INLINE signed short __pyx_PyInt_signed_short(PyObject* x);
-static INLINE signed int __pyx_PyInt_signed_int(PyObject* x);
-static INLINE signed long __pyx_PyInt_signed_long(PyObject* x);
-static INLINE long double __pyx_PyInt_long_double(PyObject* x);
-#ifdef __GNUC__
-/* Test for GCC > 2.95 */
-#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
-#define likely(x)   __builtin_expect(!!(x), 1)
-#define unlikely(x) __builtin_expect(!!(x), 0)
-#else /* __GNUC__ > 2 ... */
-#define likely(x)   (x)
-#define unlikely(x) (x)
-#endif /* __GNUC__ > 2 ... */
+  /* Test for GCC > 2.95 */
+  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
+    #define likely(x)   __builtin_expect(!!(x), 1)
+    #define unlikely(x) __builtin_expect(!!(x), 0)
+  #else /* __GNUC__ > 2 ... */
+    #define likely(x)   (x)
+    #define unlikely(x) (x)
+  #endif /* __GNUC__ > 2 ... */
 #else /* __GNUC__ */
-#define likely(x)   (x)
-#define unlikely(x) (x)
+  #define likely(x)   (x)
+  #define unlikely(x) (x)
 #endif /* __GNUC__ */
     
 static PyObject *__pyx_m;
 static PyObject *__pyx_b;
 static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
 static int __pyx_lineno;
 static int __pyx_clineno = 0;
 static const char * __pyx_cfilenm= __FILE__;
 static const char *__pyx_filename;
-static const char **__pyx_f;
-
-static char __pyx_mdoc[] = "\nPyrex extension classes used by `seqmapping.py`.\n";
-
-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 INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
-    const char* function_name, int kw_allowed); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(
-    const char* func_name, PyObject* kw_name); /*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 int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v, int is_unsigned) {
-    int r;
-    if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
-        Py_DECREF(PyList_GET_ITEM(o, i));
-        Py_INCREF(v);
-        PyList_SET_ITEM(o, i, v);
-        return 1;
-    }
-    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0) || !is_unsigned))
-        r = PySequence_SetItem(o, i, v);
-    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 -1;
-        r = PyObject_SetItem(o, j, v);
-        Py_DECREF(j);
-    }
-    return r;
-}
-
-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 INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
-    if (likely(PyList_CheckExact(L))) {
-        if (PyList_Append(L, x) < 0) return NULL;
-        Py_INCREF(Py_None);
-        return Py_None; // this is just to have an accurate signature
-    }
-    else {
-        return PyObject_CallMethod(L, "append", "(O)", x);
-    }
-}
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-static void __Pyx_AddTraceback(const char *funcname); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-/* Type declarations */
-
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":19
+
+
+static const char *__pyx_f[] = {
+  "_seqmapping.pyx",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping;
+struct __pyx_obj_2bx_11_seqmapping_IntToIntMapping;
+
+/* "bx/_seqmapping.pyx":19
  * import sys
  * 
  * cdef class CharToIntArrayMapping:             # <<<<<<<<<<<<<<
  *     """Mapping for converting strings to int arrays"""
  * 
  */
-
 struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping {
   PyObject_HEAD
   int table[256];
   PyObject *reverse_table;
 };
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":102
+
+/* "bx/_seqmapping.pyx":102
  *         return self.out_size
  * 
  * cdef class IntToIntMapping:             # <<<<<<<<<<<<<<
  * 
  *     cdef int* table
  */
-
 struct __pyx_obj_2bx_11_seqmapping_IntToIntMapping {
   PyObject_HEAD
   int *table;
   int in_size;
   int out_size;
 };
-/* Module declarations from bx._seqmapping */
-
+
+
+#ifndef CYTHON_REFNANNY
+  #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+  typedef struct {
+    void (*INCREF)(void*, PyObject*, int);
+    void (*DECREF)(void*, PyObject*, int);
+    void (*GOTREF)(void*, PyObject*, int);
+    void (*GIVEREF)(void*, PyObject*, int);
+    void* (*SetupContext)(const char*, int, const char*);
+    void (*FinishContext)(void**);
+  } __Pyx_RefNannyAPIStruct;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+  #define __Pyx_RefNannySetupContext(name)           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+  #define __Pyx_RefNannyDeclarations
+  #define __Pyx_RefNannySetupContext(name)
+  #define __Pyx_RefNannyFinishContext()
+  #define __Pyx_INCREF(r) Py_INCREF(r)
+  #define __Pyx_DECREF(r) Py_DECREF(r)
+  #define __Pyx_GOTREF(r)
+  #define __Pyx_GIVEREF(r)
+  #define __Pyx_XINCREF(r) Py_XINCREF(r)
+  #define __Pyx_XDECREF(r) Py_XDECREF(r)
+  #define __Pyx_XGOTREF(r)
+  #define __Pyx_XGIVEREF(r)
+#endif /* CYTHON_REFNANNY */
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *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 CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
+    const char* function_name, int kw_allowed); /*proto*/
+
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name, PyObject* kw_name); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
+
+#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
+                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
+                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
+
+static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+    int r;
+    if (!j) return -1;
+    r = PyObject_SetItem(o, j, v);
+    Py_DECREF(j);
+    return r;
+}
+
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
+    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
+        Py_INCREF(v);
+        Py_DECREF(PyList_GET_ITEM(o, i));
+        PyList_SET_ITEM(o, i, v);
+        return 1;
+    }
+    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
+        return PySequence_SetItem(o, i, v);
+    else {
+        PyObject *j = PyInt_FromSsize_t(i);
+        return __Pyx_SetItemInt_Generic(o, j, v);
+    }
+}
+
+
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+    PyObject *r;
+    if (!j) return NULL;
+    r = PyObject_GetItem(o, j);
+    Py_DECREF(j);
+    return r;
+}
+
+
+#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
+                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
+                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
+    if (likely(o != Py_None)) {
+        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
+            PyObject *r = PyList_GET_ITEM(o, i);
+            Py_INCREF(r);
+            return r;
+        }
+        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
+            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
+            Py_INCREF(r);
+            return r;
+        }
+    }
+    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
+                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
+                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
+    if (likely(o != Py_None)) {
+        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
+            PyObject *r = PyTuple_GET_ITEM(o, i);
+            Py_INCREF(r);
+            return r;
+        }
+        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
+            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
+            Py_INCREF(r);
+            return r;
+        }
+    }
+    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+
+#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
+                                                    __Pyx_GetItemInt_Fast(o, i) : \
+                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
+    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))) {
+        r = PySequence_GetItem(o, i);
+    }
+    else {
+        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+    }
+    return r;
+}
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+
+static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+
+static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { 
+    return unlikely(b < 0) ? b : !b; 
+}
+static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
+    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
+
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
+
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
+
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
+
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
+
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
+                               int __pyx_lineno, const char *__pyx_filename); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
+/* Module declarations from 'bx._seqmapping' */
 static PyTypeObject *__pyx_ptype_2bx_11_seqmapping_CharToIntArrayMapping = 0;
 static PyTypeObject *__pyx_ptype_2bx_11_seqmapping_IntToIntMapping = 0;
-
-
-/* Implementation of bx._seqmapping */
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_neg_1;
-static char __pyx_k___cinit__[] = "__cinit__";
-static PyObject *__pyx_kp___cinit__;
-static char __pyx_k___init__[] = "__init__";
-static PyObject *__pyx_kp___init__;
-static char __pyx_k_set_mapping[] = "set_mapping";
-static PyObject *__pyx_kp_set_mapping;
-static char __pyx_k_translate[] = "translate";
-static PyObject *__pyx_kp_translate;
-static char __pyx_k_translate_list[] = "translate_list";
-static PyObject *__pyx_kp_translate_list;
-static char __pyx_k_reverse_map[] = "reverse_map";
-static PyObject *__pyx_kp_reverse_map;
-static char __pyx_k_get_out_size[] = "get_out_size";
-static PyObject *__pyx_kp_get_out_size;
-static char __pyx_k___dealloc__[] = "__dealloc__";
-static PyObject *__pyx_kp___dealloc__;
-static char __pyx_k___getitem__[] = "__getitem__";
-static PyObject *__pyx_kp___getitem__;
-static char __pyx_k_collapse[] = "collapse";
-static PyObject *__pyx_kp_collapse;
-static char __pyx_k_expand[] = "expand";
-static PyObject *__pyx_kp_expand;
-static char __pyx_k_expand_out[] = "expand_out";
-static PyObject *__pyx_kp_expand_out;
-static char __pyx_k_expand_random_split[] = "expand_random_split";
-static PyObject *__pyx_kp_expand_random_split;
-static char __pyx_k_get_in_size[] = "get_in_size";
-static PyObject *__pyx_kp_get_in_size;
-static char __pyx_k_get_table[] = "get_table";
-static PyObject *__pyx_kp_get_table;
-static char __pyx_k_c[] = "c";
-static PyObject *__pyx_kp_c;
-static char __pyx_k_symbol[] = "symbol";
-static PyObject *__pyx_kp_symbol;
-static char __pyx_k_string[] = "string";
-static PyObject *__pyx_kp_string;
-static char __pyx_k_strings[] = "strings";
-static PyObject *__pyx_kp_strings;
-static char __pyx_k_val[] = "val";
-static PyObject *__pyx_kp_val;
-static char __pyx_k_nseqs[] = "nseqs";
-static PyObject *__pyx_kp_nseqs;
-static char __pyx_k_in_size[] = "in_size";
-static PyObject *__pyx_kp_in_size;
-static char __pyx_k_index[] = "index";
-static PyObject *__pyx_kp_index;
-static char __pyx_k_src[] = "src";
-static PyObject *__pyx_kp_src;
-static char __pyx_k_x[] = "x";
-static PyObject *__pyx_kp_x;
-static char __pyx_k_a[] = "a";
-static PyObject *__pyx_kp_a;
-static char __pyx_k_b[] = "b";
-static PyObject *__pyx_kp_b;
-static char __pyx_k_numpy[] = "numpy";
-static PyObject *__pyx_kp_numpy;
-static char __pyx_k_zeros[] = "zeros";
-static PyObject *__pyx_kp_zeros;
-static char __pyx_k_math[] = "math";
-static PyObject *__pyx_kp_math;
-static char __pyx_k_floor[] = "floor";
-static PyObject *__pyx_kp_floor;
-static char __pyx_k_random[] = "random";
-static PyObject *__pyx_kp_random;
-static char __pyx_k_sys[] = "sys";
-static PyObject *__pyx_kp_sys;
-static char __pyx_k_ord[] = "ord";
-static PyObject *__pyx_kp_ord;
-static char __pyx_k_chr[] = "chr";
-static PyObject *__pyx_kp_chr;
-static char __pyx_k_1[] = "i";
-static PyObject *__pyx_kp_1;
-static char __pyx_k_2[] = "i";
-static PyObject *__pyx_kp_2;
-static char __pyx_k_append[] = "append";
-static PyObject *__pyx_kp_append;
-static char __pyx_k_reverse[] = "reverse";
-static PyObject *__pyx_kp_reverse;
-static char __pyx_k_6[] = "i";
-static PyObject *__pyx_kp_6;
-static char __pyx_k_randrange[] = "randrange";
-static PyObject *__pyx_kp_randrange;
-static char __pyx_k_sample[] = "sample";
-static PyObject *__pyx_kp_sample;
-static char __pyx_k_range[] = "range";
-static PyObject *__pyx_kp_range;
-static char __pyx_k_7[] = "i";
-static PyObject *__pyx_kp_7;
+#define __Pyx_MODULE_NAME "bx._seqmapping"
+int __pyx_module_is_main_bx___seqmapping = 0;
+
+/* Implementation of 'bx._seqmapping' */
 static PyObject *__pyx_builtin_ord;
 static PyObject *__pyx_builtin_chr;
 static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_kp_3;
-static char __pyx_k_3[] = "Malloc Failed";
-static PyObject *__pyx_kp_4;
-static char __pyx_k_4[] = "%d not between 0 and %s";
-static PyObject *__pyx_kp_5;
-static char __pyx_k_5[] = "`src` argument must be a buffer of 32bit integers";
-
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":26
+static char __pyx_k_1[] = "Malloc Failed";
+static char __pyx_k_2[] = "%d not between 0 and %s";
+static char __pyx_k_3[] = "`src` argument must be a buffer of 32bit integers";
+static char __pyx_k_4[] = "\nPyrex extension classes used by `seqmapping.py`.\n";
+static char __pyx_k__a[] = "a";
+static char __pyx_k__b[] = "b";
+static char __pyx_k__c[] = "c";
+static char __pyx_k__i[] = "i";
+static char __pyx_k__chr[] = "chr";
+static char __pyx_k__ord[] = "ord";
+static char __pyx_k__sys[] = "sys";
+static char __pyx_k__val[] = "val";
+static char __pyx_k__math[] = "math";
+static char __pyx_k__floor[] = "floor";
+static char __pyx_k__index[] = "index";
+static char __pyx_k__nseqs[] = "nseqs";
+static char __pyx_k__numpy[] = "numpy";
+static char __pyx_k__range[] = "range";
+static char __pyx_k__zeros[] = "zeros";
+static char __pyx_k__random[] = "random";
+static char __pyx_k__sample[] = "sample";
+static char __pyx_k__symbol[] = "symbol";
+static char __pyx_k__in_size[] = "in_size";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k____test__[] = "__test__";
+static char __pyx_k__randrange[] = "randrange";
+static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_kp_s_2;
+static PyObject *__pyx_kp_s_3;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s____test__;
+static PyObject *__pyx_n_s__a;
+static PyObject *__pyx_n_s__b;
+static PyObject *__pyx_n_s__c;
+static PyObject *__pyx_n_s__chr;
+static PyObject *__pyx_n_s__floor;
+static PyObject *__pyx_n_s__i;
+static PyObject *__pyx_n_s__in_size;
+static PyObject *__pyx_n_s__index;
+static PyObject *__pyx_n_s__math;
+static PyObject *__pyx_n_s__nseqs;
+static PyObject *__pyx_n_s__numpy;
+static PyObject *__pyx_n_s__ord;
+static PyObject *__pyx_n_s__random;
+static PyObject *__pyx_n_s__randrange;
+static PyObject *__pyx_n_s__range;
+static PyObject *__pyx_n_s__sample;
+static PyObject *__pyx_n_s__symbol;
+static PyObject *__pyx_n_s__sys;
+static PyObject *__pyx_n_s__val;
+static PyObject *__pyx_n_s__zeros;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_neg_1;
+
+/* "bx/_seqmapping.pyx":26
  *     cdef object reverse_table
  * 
- *     def __new__( self ):             # <<<<<<<<<<<<<<
+ *     def __cinit__( self ):             # <<<<<<<<<<<<<<
  *         """Init empty mapping (all characters map to -1)"""
  *         cdef int i
  */
 
-static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_2bx_11_seqmapping_21CharToIntArrayMapping___new__[] = "Init empty mapping (all characters map to -1)";
-static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   int __pyx_v_i;
   int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__");
   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__new__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__new__", 0))) return -1;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":29
+    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
+
+  /* "bx/_seqmapping.pyx":29
  *         """Init empty mapping (all characters map to -1)"""
  *         cdef int i
  *         for i from 0 <= i < 256: self.table[i] = -1             # <<<<<<<<<<<<<<
     (((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->table[__pyx_v_i]) = -1;
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":30
+  /* "bx/_seqmapping.pyx":30
  *         cdef int i
  *         for i from 0 <= i < 256: self.table[i] = -1
  *         self.out_size = 0             # <<<<<<<<<<<<<<
   ((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size = 0;
 
   __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":32
+/* "bx/_seqmapping.pyx":32
  *         self.out_size = 0
  * 
  *     def __init__( self ):             # <<<<<<<<<<<<<<
  * 
  */
 
-static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   int __pyx_r;
-  PyObject *__pyx_1 = 0;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__init__");
   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":33
+  /* "bx/_seqmapping.pyx":33
  * 
  *     def __init__( self ):
  *         self.reverse_table = dict()             # <<<<<<<<<<<<<<
  * 
  *     def set_mapping( self, c, int symbol ):
  */
-  __pyx_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table);
-  ((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table = __pyx_1;
-  __pyx_1 = 0;
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+  __Pyx_GOTREF(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table);
+  __Pyx_DECREF(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table);
+  ((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table = ((PyObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
 
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  Py_XDECREF(__pyx_1);
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.__init__");
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":35
+/* "bx/_seqmapping.pyx":35
  *         self.reverse_table = dict()
  * 
  *     def set_mapping( self, c, int symbol ):             # <<<<<<<<<<<<<<
  *         char = ord( c )
  */
 
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_set_mapping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_2bx_11_seqmapping_21CharToIntArrayMapping_set_mapping[] = "Modify mapping so 'chars' map to 'symbol'";
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_set_mapping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_2set_mapping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_2bx_11_seqmapping_21CharToIntArrayMapping_2set_mapping[] = "Modify mapping so 'chars' map to 'symbol'";
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_2set_mapping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_c = 0;
   int __pyx_v_symbol;
-  PyObject *__pyx_v_char;
-  PyObject *__pyx_r;
-  PyObject *__pyx_1 = 0;
-  PyObject *__pyx_2 = 0;
-  Py_ssize_t __pyx_3 = 0;
-  int __pyx_4;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_c,&__pyx_kp_symbol,0};
-  if (unlikely(__pyx_kwds)) {
+  PyObject *__pyx_v_char = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  Py_ssize_t __pyx_t_3;
+  int __pyx_t_4;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__c,&__pyx_n_s__symbol,0};
+  __Pyx_RefNannySetupContext("set_mapping");
+  {
     PyObject* values[2] = {0,0};
-    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
-    switch (PyTuple_GET_SIZE(__pyx_args)) {
-      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_c);
-      if (likely(values[0])) kw_args--;
-      else goto __pyx_L5_argtuple_error;
-      case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_symbol);
-      if (likely(values[1])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("set_mapping", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        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;
       }
-    }
-    if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_mapping") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  0:
+        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__c);
+        if (likely(values[0])) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__symbol);
+        if (likely(values[1])) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("set_mapping", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __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), "set_mapping") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
     __pyx_v_c = values[0];
-    __pyx_v_symbol = __pyx_PyInt_int(values[1]); if (unlikely((__pyx_v_symbol == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
-    goto __pyx_L5_argtuple_error;
-  } else {
-    __pyx_v_c = PyTuple_GET_ITEM(__pyx_args, 0);
-    __pyx_v_symbol = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_symbol == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_symbol = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_symbol == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
   __Pyx_RaiseArgtupleInvalid("set_mapping", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.set_mapping");
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.set_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  __pyx_v_char = Py_None; Py_INCREF(Py_None);
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":37
+
+  /* "bx/_seqmapping.pyx":37
  *     def set_mapping( self, c, int symbol ):
  *         """Modify mapping so 'chars' map to 'symbol'"""
  *         char = ord( c )             # <<<<<<<<<<<<<<
  *         self.table[ char ] = symbol
  *         if self.out_size <= symbol:
  */
-  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_v_c);
-  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_c);
-  __pyx_2 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  Py_DECREF(__pyx_v_char);
-  __pyx_v_char = __pyx_2;
-  __pyx_2 = 0;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":38
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __Pyx_INCREF(__pyx_v_c);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c);
+  __Pyx_GIVEREF(__pyx_v_c);
+  __pyx_t_2 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __pyx_v_char = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+  /* "bx/_seqmapping.pyx":38
  *         """Modify mapping so 'chars' map to 'symbol'"""
  *         char = ord( c )
  *         self.table[ char ] = symbol             # <<<<<<<<<<<<<<
  *         if self.out_size <= symbol:
  *             self.out_size = symbol + 1
  */
-  __pyx_3 = __pyx_PyIndex_AsSsize_t(__pyx_v_char); if (unlikely((__pyx_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  (((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->table[__pyx_3]) = __pyx_v_symbol;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":39
+  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_char); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  (((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->table[__pyx_t_3]) = __pyx_v_symbol;
+
+  /* "bx/_seqmapping.pyx":39
  *         char = ord( c )
  *         self.table[ char ] = symbol
  *         if self.out_size <= symbol:             # <<<<<<<<<<<<<<
  *             self.out_size = symbol + 1
  *         self.reverse_table[ symbol ] = chr( char )
  */
-  __pyx_4 = (((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size <= __pyx_v_symbol);
-  if (__pyx_4) {
-
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":40
+  __pyx_t_4 = (((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size <= __pyx_v_symbol);
+  if (__pyx_t_4) {
+
+    /* "bx/_seqmapping.pyx":40
  *         self.table[ char ] = symbol
  *         if self.out_size <= symbol:
  *             self.out_size = symbol + 1             # <<<<<<<<<<<<<<
   }
   __pyx_L6:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":41
+  /* "bx/_seqmapping.pyx":41
  *         if self.out_size <= symbol:
  *             self.out_size = symbol + 1
  *         self.reverse_table[ symbol ] = chr( char )             # <<<<<<<<<<<<<<
  * 
  *     def translate( self, string ):
  */
-  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_v_char);
-  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_char);
-  __pyx_2 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  if (__Pyx_SetItemInt(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table, __pyx_v_symbol, __pyx_2, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
-
-  __pyx_r = Py_None; Py_INCREF(Py_None);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __Pyx_INCREF(__pyx_v_char);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_char);
+  __Pyx_GIVEREF(__pyx_v_char);
+  __pyx_t_1 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  if (__Pyx_SetItemInt(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table, __pyx_v_symbol, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  Py_XDECREF(__pyx_1);
-  Py_XDECREF(__pyx_2);
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.set_mapping");
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.set_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_char);
+  __Pyx_XDECREF(__pyx_v_char);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":43
+/* "bx/_seqmapping.pyx":43
  *         self.reverse_table[ symbol ] = chr( char )
  * 
  *     def translate( self, string ):             # <<<<<<<<<<<<<<
  *         cdef int s_len, t_len
  */
 
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_translate(PyObject *__pyx_v_self, PyObject *__pyx_v_string); /*proto*/
-static char __pyx_doc_2bx_11_seqmapping_21CharToIntArrayMapping_translate[] = "Translate 'string' and return as int array";
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_translate(PyObject *__pyx_v_self, PyObject *__pyx_v_string) {
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_3translate(PyObject *__pyx_v_self, PyObject *__pyx_v_string); /*proto*/
+static char __pyx_doc_2bx_11_seqmapping_21CharToIntArrayMapping_3translate[] = "Translate 'string' and return as int array";
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_3translate(PyObject *__pyx_v_self, PyObject *__pyx_v_string) {
   int __pyx_v_s_len;
   int __pyx_v_t_len;
   unsigned char *__pyx_v_s_buf;
   int *__pyx_v_t_buf;
-  PyObject *__pyx_v_rval;
-  PyObject *__pyx_v_i;
-  PyObject *__pyx_r;
-  int __pyx_1;
-  PyObject *__pyx_2 = 0;
-  PyObject *__pyx_3 = 0;
-  PyObject *__pyx_4 = 0;
-  long __pyx_5;
-  Py_ssize_t __pyx_6 = 0;
-  Py_ssize_t __pyx_7 = 0;
-  __pyx_v_rval = Py_None; Py_INCREF(Py_None);
-  __pyx_v_i = Py_None; Py_INCREF(Py_None);
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":49
+  PyObject *__pyx_v_rval = NULL;
+  long __pyx_v_i;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("translate");
+
+  /* "bx/_seqmapping.pyx":49
  *         cdef int * t_buf
  *         # Get direct access to string
  *         PyString_AsStringAndSize( string, <char **> &s_buf, &s_len )             # <<<<<<<<<<<<<<
  *         # Initialize empty array
  *         rval = zeros( s_len, 'i' )
  */
-  __pyx_1 = PyString_AsStringAndSize(__pyx_v_string, ((char **)(&__pyx_v_s_buf)), (&__pyx_v_s_len)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":51
+  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_string, ((char **)(&__pyx_v_s_buf)), (&__pyx_v_s_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "bx/_seqmapping.pyx":51
  *         PyString_AsStringAndSize( string, <char **> &s_buf, &s_len )
  *         # Initialize empty array
  *         rval = zeros( s_len, 'i' )             # <<<<<<<<<<<<<<
  *         PyObject_AsWriteBuffer( rval, <void **> &t_buf, &t_len )
  *         # Translate
  */
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_zeros); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_3 = PyInt_FromLong(__pyx_v_s_len); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
-  Py_INCREF(__pyx_kp_1);
-  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_kp_1);
-  __pyx_3 = 0;
-  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(__pyx_2); __pyx_2 = 0;
-  Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
-  Py_DECREF(__pyx_v_rval);
-  __pyx_v_rval = __pyx_3;
-  __pyx_3 = 0;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":52
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyInt_FromLong(__pyx_v_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__i));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  __pyx_v_rval = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+  /* "bx/_seqmapping.pyx":52
  *         # Initialize empty array
  *         rval = zeros( s_len, 'i' )
  *         PyObject_AsWriteBuffer( rval, <void **> &t_buf, &t_len )             # <<<<<<<<<<<<<<
  *         # Translate
  *         for i from 0 <= i < s_len:
  */
-  __pyx_1 = PyObject_AsWriteBuffer(__pyx_v_rval, ((void **)(&__pyx_v_t_buf)), (&__pyx_v_t_len)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":54
+  __pyx_t_1 = PyObject_AsWriteBuffer(__pyx_v_rval, ((void **)(&__pyx_v_t_buf)), (&__pyx_v_t_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "bx/_seqmapping.pyx":54
  *         PyObject_AsWriteBuffer( rval, <void **> &t_buf, &t_len )
  *         # Translate
  *         for i from 0 <= i < s_len:             # <<<<<<<<<<<<<<
  *             t_buf[i] = self.table[ s_buf[ i ] ]
  *         # Done
  */
-  for (__pyx_5 = 0; __pyx_5 < __pyx_v_s_len; __pyx_5++) {
-    __pyx_2 = PyInt_FromLong(__pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_v_i);
-    __pyx_v_i = __pyx_2;
-    __pyx_2 = 0;
-
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":55
+  __pyx_t_1 = __pyx_v_s_len;
+  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
+
+    /* "bx/_seqmapping.pyx":55
  *         # Translate
  *         for i from 0 <= i < s_len:
  *             t_buf[i] = self.table[ s_buf[ i ] ]             # <<<<<<<<<<<<<<
  *         # Done
  *         return rval
  */
-    __pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_7 = __pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    (__pyx_v_t_buf[__pyx_7]) = (((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->table[(__pyx_v_s_buf[__pyx_6])]);
+    (__pyx_v_t_buf[__pyx_v_i]) = (((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->table[(__pyx_v_s_buf[__pyx_v_i])]);
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":57
+  /* "bx/_seqmapping.pyx":57
  *             t_buf[i] = self.table[ s_buf[ i ] ]
  *         # Done
  *         return rval             # <<<<<<<<<<<<<<
  * 
  *     def translate_list( self, strings ):
  */
-  Py_INCREF(__pyx_v_rval);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_rval);
   __pyx_r = __pyx_v_rval;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(Py_None);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  Py_XDECREF(__pyx_2);
-  Py_XDECREF(__pyx_3);
-  Py_XDECREF(__pyx_4);
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.translate");
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_rval);
-  Py_DECREF(__pyx_v_i);
+  __Pyx_XDECREF(__pyx_v_rval);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":59
+/* "bx/_seqmapping.pyx":59
  *         return rval
  * 
  *     def translate_list( self, strings ):             # <<<<<<<<<<<<<<
  *         cdef int text_len, factor, i
  */
 
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_translate_list(PyObject *__pyx_v_self, PyObject *__pyx_v_strings); /*proto*/
-static char __pyx_doc_2bx_11_seqmapping_21CharToIntArrayMapping_translate_list[] = "Translate a list of strings into an int array";
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_translate_list(PyObject *__pyx_v_self, PyObject *__pyx_v_strings) {
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_4translate_list(PyObject *__pyx_v_self, PyObject *__pyx_v_strings); /*proto*/
+static char __pyx_doc_2bx_11_seqmapping_21CharToIntArrayMapping_4translate_list[] = "Translate a list of strings into an int array";
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_4translate_list(PyObject *__pyx_v_self, PyObject *__pyx_v_strings) {
   int __pyx_v_text_len;
   int __pyx_v_factor;
   int __pyx_v_i;
   int __pyx_v_t_len;
   unsigned char *__pyx_v_s_buf;
   int *__pyx_v_t_buf;
-  PyObject *__pyx_v_rval;
-  PyObject *__pyx_v_string;
-  PyObject *__pyx_r;
-  Py_ssize_t __pyx_1 = 0;
-  int __pyx_2;
-  PyObject *__pyx_3 = 0;
-  PyObject *__pyx_4 = 0;
-  PyObject *__pyx_5 = 0;
-  int __pyx_6;
-  __pyx_v_rval = Py_None; Py_INCREF(Py_None);
-  __pyx_v_string = Py_None; Py_INCREF(Py_None);
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":67
+  PyObject *__pyx_v_rval = NULL;
+  PyObject *__pyx_v_string = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  Py_ssize_t __pyx_t_1;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  int __pyx_t_6;
+  PyObject *(*__pyx_t_7)(PyObject *);
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("translate_list");
+
+  /* "bx/_seqmapping.pyx":67
  * 
  *         # No input, no output
  *         if len( strings ) < 1: return None             # <<<<<<<<<<<<<<
  * 
  *         # Length of result
  */
-  __pyx_1 = PyObject_Length(__pyx_v_strings); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = (__pyx_1 < 1);
-  if (__pyx_2) {
-    Py_INCREF(Py_None);
+  __pyx_t_1 = PyObject_Length(__pyx_v_strings); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = (__pyx_t_1 < 1);
+  if (__pyx_t_2) {
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
     goto __pyx_L5;
   }
   __pyx_L5:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":70
+  /* "bx/_seqmapping.pyx":70
  * 
  *         # Length of result
  *         text_len = len( strings[0] )             # <<<<<<<<<<<<<<
  * 
  *         # Init result array
  */
-  __pyx_3 = __Pyx_GetItemInt(__pyx_v_strings, 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_1 = PyObject_Length(__pyx_3); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_v_text_len = __pyx_1;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":73
+  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_strings, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_v_text_len = __pyx_t_1;
+
+  /* "bx/_seqmapping.pyx":73
  * 
  *         # Init result array
  *         rval = zeros( text_len, 'i' )             # <<<<<<<<<<<<<<
  *         PyObject_AsWriteBuffer( rval, <void **> &t_buf, &t_len )
  * 
  */
-  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_zeros); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_4 = PyInt_FromLong(__pyx_v_text_len); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
-  Py_INCREF(__pyx_kp_2);
-  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_kp_2);
-  __pyx_4 = 0;
-  __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
-  Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
-  Py_DECREF(__pyx_v_rval);
-  __pyx_v_rval = __pyx_4;
-  __pyx_4 = 0;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":74
+  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = PyInt_FromLong(__pyx_v_text_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__i));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
+  __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __pyx_v_rval = __pyx_t_4;
+  __pyx_t_4 = 0;
+
+  /* "bx/_seqmapping.pyx":74
  *         # Init result array
  *         rval = zeros( text_len, 'i' )
  *         PyObject_AsWriteBuffer( rval, <void **> &t_buf, &t_len )             # <<<<<<<<<<<<<<
  * 
  *         # Loop over seqs and accumulate result values
  */
-  __pyx_6 = PyObject_AsWriteBuffer(__pyx_v_rval, ((void **)(&__pyx_v_t_buf)), (&__pyx_v_t_len)); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":77
+  __pyx_t_6 = PyObject_AsWriteBuffer(__pyx_v_rval, ((void **)(&__pyx_v_t_buf)), (&__pyx_v_t_len)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "bx/_seqmapping.pyx":77
  * 
  *         # Loop over seqs and accumulate result values
  *         factor = 1             # <<<<<<<<<<<<<<
  */
   __pyx_v_factor = 1;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":78
+  /* "bx/_seqmapping.pyx":78
  *         # Loop over seqs and accumulate result values
  *         factor = 1
  *         for string in strings:             # <<<<<<<<<<<<<<
  *             for i from 0 <= i < text_len:
  */
   if (PyList_CheckExact(__pyx_v_strings) || PyTuple_CheckExact(__pyx_v_strings)) {
-    __pyx_1 = 0; __pyx_3 = __pyx_v_strings; Py_INCREF(__pyx_3);
+    __pyx_t_4 = __pyx_v_strings; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0;
+    __pyx_t_7 = NULL;
   } else {
-    __pyx_1 = -1; __pyx_3 = PyObject_GetIter(__pyx_v_strings); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_strings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
   }
   for (;;) {
-    if (likely(PyList_CheckExact(__pyx_3))) {
-      if (__pyx_1 >= PyList_GET_SIZE(__pyx_3)) break;
-      __pyx_5 = PyList_GET_ITEM(__pyx_3, __pyx_1); Py_INCREF(__pyx_5); __pyx_1++;
-    } else if (likely(PyTuple_CheckExact(__pyx_3))) {
-      if (__pyx_1 >= PyTuple_GET_SIZE(__pyx_3)) break;
-      __pyx_5 = PyTuple_GET_ITEM(__pyx_3, __pyx_1); Py_INCREF(__pyx_5); __pyx_1++;
+    if (PyList_CheckExact(__pyx_t_4)) {
+      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break;
+      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
+    } else if (PyTuple_CheckExact(__pyx_t_4)) {
+      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
     } else {
-      __pyx_5 = PyIter_Next(__pyx_3);
-      if (!__pyx_5) {
-        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = __pyx_t_7(__pyx_t_4);
+      if (unlikely(!__pyx_t_5)) {
+        if (PyErr_Occurred()) {
+          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
         break;
       }
+      __Pyx_GOTREF(__pyx_t_5);
     }
-    Py_DECREF(__pyx_v_string);
-    __pyx_v_string = __pyx_5;
-    __pyx_5 = 0;
-
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":79
+    __Pyx_XDECREF(__pyx_v_string);
+    __pyx_v_string = __pyx_t_5;
+    __pyx_t_5 = 0;
+
+    /* "bx/_seqmapping.pyx":79
  *         factor = 1
  *         for string in strings:
  *             PyString_AsStringAndSize( string, <char **> &s_buf, &s_len )             # <<<<<<<<<<<<<<
  *             for i from 0 <= i < text_len:
  *                 if t_buf[i] >= 0:
  */
-    __pyx_6 = PyString_AsStringAndSize(__pyx_v_string, ((char **)(&__pyx_v_s_buf)), (&__pyx_v_s_len)); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":80
+    __pyx_t_6 = PyString_AsStringAndSize(__pyx_v_string, ((char **)(&__pyx_v_s_buf)), (&__pyx_v_s_len)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+    /* "bx/_seqmapping.pyx":80
  *         for string in strings:
  *             PyString_AsStringAndSize( string, <char **> &s_buf, &s_len )
  *             for i from 0 <= i < text_len:             # <<<<<<<<<<<<<<
  *                 if t_buf[i] >= 0:
  *                     if self.table[ s_buf[i] ] == -1:
  */
-    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_text_len; __pyx_v_i++) {
-
-      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":81
+    __pyx_t_6 = __pyx_v_text_len;
+    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
+
+      /* "bx/_seqmapping.pyx":81
  *             PyString_AsStringAndSize( string, <char **> &s_buf, &s_len )
  *             for i from 0 <= i < text_len:
  *                 if t_buf[i] >= 0:             # <<<<<<<<<<<<<<
  *                     if self.table[ s_buf[i] ] == -1:
  *                         t_buf[i] = -1
  */
-      __pyx_2 = ((__pyx_v_t_buf[__pyx_v_i]) >= 0);
-      if (__pyx_2) {
-
-        /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":82
+      __pyx_t_2 = ((__pyx_v_t_buf[__pyx_v_i]) >= 0);
+      if (__pyx_t_2) {
+
+        /* "bx/_seqmapping.pyx":82
  *             for i from 0 <= i < text_len:
  *                 if t_buf[i] >= 0:
  *                     if self.table[ s_buf[i] ] == -1:             # <<<<<<<<<<<<<<
  *                         t_buf[i] = -1
  *                     else:
  */
-        __pyx_2 = ((((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->table[(__pyx_v_s_buf[__pyx_v_i])]) == -1);
-        if (__pyx_2) {
-
-          /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":83
+        __pyx_t_2 = ((((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->table[(__pyx_v_s_buf[__pyx_v_i])]) == -1);
+        if (__pyx_t_2) {
+
+          /* "bx/_seqmapping.pyx":83
  *                 if t_buf[i] >= 0:
  *                     if self.table[ s_buf[i] ] == -1:
  *                         t_buf[i] = -1             # <<<<<<<<<<<<<<
         }
         /*else*/ {
 
-          /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":85
+          /* "bx/_seqmapping.pyx":85
  *                         t_buf[i] = -1
  *                     else:
  *                         t_buf[i] = t_buf[i] + ( self.table[ s_buf[i] ] * factor )             # <<<<<<<<<<<<<<
       __pyx_L10:;
     }
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":86
+    /* "bx/_seqmapping.pyx":86
  *                     else:
  *                         t_buf[i] = t_buf[i] + ( self.table[ s_buf[i] ] * factor )
  *             factor = factor * self.out_size             # <<<<<<<<<<<<<<
  */
     __pyx_v_factor = (__pyx_v_factor * ((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size);
   }
-  Py_DECREF(__pyx_3); __pyx_3 = 0;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":87
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+  /* "bx/_seqmapping.pyx":87
  *                         t_buf[i] = t_buf[i] + ( self.table[ s_buf[i] ] * factor )
  *             factor = factor * self.out_size
  *         return rval             # <<<<<<<<<<<<<<
  * 
  *     def reverse_map( self, val, nseqs ):
  */
-  Py_INCREF(__pyx_v_rval);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_rval);
   __pyx_r = __pyx_v_rval;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(Py_None);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  Py_XDECREF(__pyx_3);
-  Py_XDECREF(__pyx_4);
-  Py_XDECREF(__pyx_5);
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.translate_list");
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.translate_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_rval);
-  Py_DECREF(__pyx_v_string);
+  __Pyx_XDECREF(__pyx_v_rval);
+  __Pyx_XDECREF(__pyx_v_string);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":89
+/* "bx/_seqmapping.pyx":89
  *         return rval
  * 
  *     def reverse_map( self, val, nseqs ):             # <<<<<<<<<<<<<<
  *         rval = []
  */
 
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_reverse_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_reverse_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_5reverse_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_5reverse_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_val = 0;
   PyObject *__pyx_v_nseqs = 0;
-  PyObject *__pyx_v_factor;
-  PyObject *__pyx_v_rval;
-  PyObject *__pyx_r;
-  PyObject *__pyx_1 = 0;
-  int __pyx_2;
-  PyObject *__pyx_3 = 0;
-  PyObject *__pyx_4 = 0;
+  PyObject *__pyx_v_factor = NULL;
+  PyObject *__pyx_v_rval = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_val,&__pyx_kp_nseqs,0};
-  if (unlikely(__pyx_kwds)) {
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
+  int __pyx_t_5;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__val,&__pyx_n_s__nseqs,0};
+  __Pyx_RefNannySetupContext("reverse_map");
+  {
     PyObject* values[2] = {0,0};
-    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
-    switch (PyTuple_GET_SIZE(__pyx_args)) {
-      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_val);
-      if (likely(values[0])) kw_args--;
-      else goto __pyx_L5_argtuple_error;
-      case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nseqs);
-      if (likely(values[1])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("reverse_map", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        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;
       }
-    }
-    if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "reverse_map") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  0:
+        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
+        if (likely(values[0])) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nseqs);
+        if (likely(values[1])) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("reverse_map", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __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), "reverse_map") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
     __pyx_v_val = values[0];
     __pyx_v_nseqs = values[1];
-  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
-    goto __pyx_L5_argtuple_error;
-  } else {
-    __pyx_v_val = PyTuple_GET_ITEM(__pyx_args, 0);
-    __pyx_v_nseqs = PyTuple_GET_ITEM(__pyx_args, 1);
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
   __Pyx_RaiseArgtupleInvalid("reverse_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.reverse_map");
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.reverse_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  Py_INCREF(__pyx_v_val);
-  __pyx_v_factor = Py_None; Py_INCREF(Py_None);
-  __pyx_v_rval = Py_None; Py_INCREF(Py_None);
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":90
+  __Pyx_INCREF(__pyx_v_val);
+
+  /* "bx/_seqmapping.pyx":90
  * 
  *     def reverse_map( self, val, nseqs ):
  *         factor = self.out_size ** (nseqs-1)             # <<<<<<<<<<<<<<
  *         rval = []
  *         while factor > 0:
  */
-  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_1 = PyNumber_Subtract(__pyx_v_nseqs, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = PyNumber_Power(__pyx_1, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(__pyx_1); __pyx_1 = 0;
-  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  Py_DECREF(__pyx_v_factor);
-  __pyx_v_factor = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":91
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyNumber_Subtract(__pyx_v_nseqs, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_factor = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+  /* "bx/_seqmapping.pyx":91
  *     def reverse_map( self, val, nseqs ):
  *         factor = self.out_size ** (nseqs-1)
  *         rval = []             # <<<<<<<<<<<<<<
  *         while factor > 0:
  *             rval.append( self.reverse_table[ int( floor( val / factor ) ) ] )
  */
-  __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(__pyx_v_rval);
-  __pyx_v_rval = ((PyObject *)__pyx_1);
-  __pyx_1 = 0;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":92
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+  __pyx_v_rval = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+  /* "bx/_seqmapping.pyx":92
  *         factor = self.out_size ** (nseqs-1)
  *         rval = []
  *         while factor > 0:             # <<<<<<<<<<<<<<
  *             val = val - ( floor(val/factor) * factor )
  */
   while (1) {
-    __pyx_1 = PyObject_RichCompare(__pyx_v_factor, __pyx_int_0, Py_GT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_1); __pyx_1 = 0;
-    if (!__pyx_2) break;
-
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":93
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_factor, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (!__pyx_t_4) break;
+
+    /* "bx/_seqmapping.pyx":93
  *         rval = []
  *         while factor > 0:
  *             rval.append( self.reverse_table[ int( floor( val / factor ) ) ] )             # <<<<<<<<<<<<<<
  *             val = val - ( floor(val/factor) * factor )
  *             factor = floor( factor / self.out_size )
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_floor); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(((PyObject *)__pyx_v_rval) == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+    }
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__floor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_val, __pyx_v_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_2);
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
     __pyx_t_2 = 0;
-    __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_1); __pyx_1 = 0;
-    Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
-    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_4);
-    __pyx_4 = 0;
-    __pyx_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-    __pyx_4 = PyObject_GetItem(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
-    __pyx_1 = __Pyx_PyObject_Append(__pyx_v_rval, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
-    Py_DECREF(__pyx_1); __pyx_1 = 0;
-
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":94
+    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_GetItem(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->reverse_table, __pyx_t_2); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = PyList_Append(__pyx_v_rval, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+    /* "bx/_seqmapping.pyx":94
  *         while factor > 0:
  *             rval.append( self.reverse_table[ int( floor( val / factor ) ) ] )
  *             val = val - ( floor(val/factor) * factor )             # <<<<<<<<<<<<<<
  *             factor = floor( factor / self.out_size )
  *         rval.reverse()
  */
-    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_floor); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__floor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_val, __pyx_v_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_t_2);
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
     __pyx_t_2 = 0;
-    __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
-    Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
-    __pyx_t_2 = PyNumber_Multiply(__pyx_1, __pyx_v_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_1); __pyx_1 = 0;
-    __pyx_t_1 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    Py_DECREF(__pyx_v_val);
-    __pyx_v_val = __pyx_t_1;
-    __pyx_t_1 = 0;
-
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":95
+    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_v_factor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Subtract(__pyx_v_val, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_v_val);
+    __pyx_v_val = __pyx_t_2;
+    __pyx_t_2 = 0;
+
+    /* "bx/_seqmapping.pyx":95
  *             rval.append( self.reverse_table[ int( floor( val / factor ) ) ] )
  *             val = val - ( floor(val/factor) * factor )
  *             factor = floor( factor / self.out_size )             # <<<<<<<<<<<<<<
  *         rval.reverse()
  *         return rval
  */
-    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_floor); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_4 = PyInt_FromLong(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_factor, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_4); __pyx_4 = 0;
-    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_t_1);
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__floor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_factor, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_DECREF(__pyx_3); __pyx_3 = 0;
-    Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-    Py_DECREF(__pyx_v_factor);
-    __pyx_v_factor = __pyx_4;
-    __pyx_4 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_v_factor);
+    __pyx_v_factor = __pyx_t_1;
+    __pyx_t_1 = 0;
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":96
+  /* "bx/_seqmapping.pyx":96
  *             val = val - ( floor(val/factor) * factor )
  *             factor = floor( factor / self.out_size )
  *         rval.reverse()             # <<<<<<<<<<<<<<
  *         return rval
  * 
  */
-  __pyx_3 = PyObject_GetAttr(__pyx_v_rval, __pyx_kp_reverse); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_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;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":97
+  if (unlikely(((PyObject *)__pyx_v_rval) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "reverse"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_5 = PyList_Reverse(__pyx_v_rval); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "bx/_seqmapping.pyx":97
  *             factor = floor( factor / self.out_size )
  *         rval.reverse()
  *         return rval             # <<<<<<<<<<<<<<
  * 
  *     def get_out_size( self ):
  */
-  Py_INCREF(__pyx_v_rval);
-  __pyx_r = __pyx_v_rval;
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_rval));
+  __pyx_r = ((PyObject *)__pyx_v_rval);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(Py_None);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  Py_XDECREF(__pyx_1);
-  Py_XDECREF(__pyx_3);
-  Py_XDECREF(__pyx_4);
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.reverse_map");
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.reverse_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
-  Py_DECREF(__pyx_v_factor);
-  Py_DECREF(__pyx_v_rval);
-  Py_DECREF(__pyx_v_val);
+  __Pyx_XDECREF(__pyx_v_factor);
+  __Pyx_XDECREF(__pyx_v_rval);
+  __Pyx_XDECREF(__pyx_v_val);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":99
+/* "bx/_seqmapping.pyx":99
  *         return rval
  * 
  *     def get_out_size( self ):             # <<<<<<<<<<<<<<
  * 
  */
 
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_get_out_size(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_get_out_size(PyObject *__pyx_v_self, PyObject *unused) {
-  PyObject *__pyx_r;
-  PyObject *__pyx_1 = 0;
-
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":100
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_6get_out_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pf_2bx_11_seqmapping_21CharToIntArrayMapping_6get_out_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("get_out_size");
+
+  /* "bx/_seqmapping.pyx":100
  * 
  *     def get_out_size( self ):
  *         return self.out_size             # <<<<<<<<<<<<<<
  * 
  * cdef class IntToIntMapping:
  */
-  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_1;
-  __pyx_1 = 0;
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_11_seqmapping_CharToIntArrayMapping *)__pyx_v_self)->out_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; Py_INCREF(Py_None);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  Py_XDECREF(__pyx_1);
-  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.get_out_size");
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("bx._seqmapping.CharToIntArrayMapping.get_out_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/_seqmapping.pyx":108
+/* "bx/_seqmapping.pyx":108
  *     cdef int out_size
  * 
- *     def __new__( self, int in_size ):             # <<<<<<<<<<<<<<
+ *     def __cinit__( self, int in_size ):             # <<<<<<<<<<<<<<
  *         self.in_size = in_size
  *         self.table = <int *> malloc( in_size * sizeof( int ) )
  */
 
-static int __pyx_pf_2bx_11_seqmapping_15IntToIntMapping___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_2bx_11_seqmapping_15IntToIntMapping___new__(PyObject *__pyx_v_self, PyOb