/* Generated by Cython 0.16 on Wed Apr 25 13:44:35 2012 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#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

#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif

#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif

#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCFunction_Call PyObject_Call
#else
  #define __Pyx_PyCFunction_Call PyCFunction_Call
#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)   __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)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)

  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif

#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#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_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_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_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#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) || (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) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#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

#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 __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__obitools__fastq___fastq
#define __PYX_HAVE_API__obitools__fastq___fastq
#include "strings.h"
#include "stdlib.h"
#include "arrayarray.h"
#include "math.h"
#include "string.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) && !defined(_MSC_VER))
#   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))
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(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 ... */
#else /* __GNUC__ */
  #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[] = {
  "_fastq.pyx",
  "array.pxd",
  "_obitools.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name; /* for error messages only */
  struct __Pyx_StructField_* fields;
  size_t size;     /* sizeof(type) */
  size_t arraysize[8]; /* length of array in each dimension */
  int ndim;
  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject */
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;


/*--- Type declarations ---*/
struct __pyx_obj_8obitools_9_obitools_BioSequence;
struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence;
struct __pyx_obj_8obitools_9_obitools_SubSequence;
struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator;
struct __pyx_obj_8obitools_9_obitools_AASequence;
struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator;
struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator;
struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator;
struct __pyx_obj_8obitools_9_obitools_NucSequence;
struct __pyx_obj_8obitools_9_obitools_DNAComplementSequence;
struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser;

/* "obitools/fasta/_fasta.pxd":1
 * cpdef object fastaParser(bytes  seq,             # <<<<<<<<<<<<<<
 *                          object bioseqfactory,
 *                          object tagparser,
 */
struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser {
  int __pyx_n;
  PyObject *joinseq;
};
struct __pyx_opt_args_8obitools_9_obitools_18WrappedBioSequence_posInWrapped;

/* "obitools/_obitools.pxd":63
 *     cpdef bint hasKey(self,bytes key)
 *     cpdef getSymbolAt(self, int position)
 *     cpdef int posInWrapped(self, int position, object reference=?   )             # <<<<<<<<<<<<<<
 *     cdef  int _posInWrapped(self, int position)
 *     cpdef bytes getStr(self)
 */
struct __pyx_opt_args_8obitools_9_obitools_18WrappedBioSequence_posInWrapped {
  int __pyx_n;
  PyObject *reference;
};
struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder;
struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq;

/* "obitools/fastq/_fastq.pyx":224
 * 
 * 
 * cdef enum FastqType:             # <<<<<<<<<<<<<<
 *     sanger,solexa
 * 
 */
enum __pyx_t_8obitools_5fastq_6_fastq_FastqType {
  __pyx_e_8obitools_5fastq_6_fastq_sanger,
  __pyx_e_8obitools_5fastq_6_fastq_solexa
};

/* "obitools/fastq/_fastq.pyx":46
 * 
 * 
 * cpdef array.array[double] fastqQualityDecoder(char* qualstring, int base=0):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int mq=255
 */
struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder {
  int __pyx_n;
  int base;
};

/* "obitools/fastq/_fastq.pyx":181
 *     return code
 * 
 * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False):             # <<<<<<<<<<<<<<
 *     cdef list rep=[]
 *     cdef str  seq
 */
struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq {
  int __pyx_n;
  int gbmode;
  int upper;
};

/* "obitools/_obitools.pxd":7
 * 
 * 
 * cdef class BioSequence(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object __quality
 */
struct __pyx_obj_8obitools_9_obitools_BioSequence {
  PyObject_HEAD
  struct __pyx_vtabstruct_8obitools_9_obitools_BioSequence *__pyx_vtab;
  PyObject *__pyx___quality;
  PyObject *__seq;
  int __len;
  PyObject *__rawinfo;
  PyObject *_info;
  PyObject *_rawparser;
  PyObject *_definition;
  PyObject *_id;
  int _hasTaxid;
  PyObject *_wrappers;
};


/* "obitools/_obitools.pxd":48
 *     cpdef bint isNucleotide(self)
 * 
 * cdef class WrappedBioSequence(BioSequence):             # <<<<<<<<<<<<<<
 * 
 *     cdef object _wrapped
 */
struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence {
  struct __pyx_obj_8obitools_9_obitools_BioSequence __pyx_base;
  PyObject *_wrapped;
  PyObject *__weakref__;
};


/* "obitools/_obitools.pxd":72
 * cdef int _sign(int x)
 * 
 * cdef class SubSequence(WrappedBioSequence):             # <<<<<<<<<<<<<<
 * 
 *     cdef public object _location
 */
struct __pyx_obj_8obitools_9_obitools_SubSequence {
  struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence __pyx_base;
  PyObject *_location;
  PyObject *_indices;
  PyObject *_xrange;
};


/* "obitools/fastq/_fastq.pyx":445
 *         return sseq
 * 
 * def fastFastqIterator(file,fastqvariant='sanger'):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator {
  PyObject_HEAD
  PyObject *__pyx_v_entry;
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *__pyx_v_fastqParser;
  PyObject *__pyx_v_fastqvariant;
  PyObject *__pyx_v_file;
  PyObject *__pyx_v_lenseq;
  PyObject *__pyx_v_quality;
  PyObject *__pyx_v_seq;
  PyObject *__pyx_v_title;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "obitools/_obitools.pxd":45
 *     cpdef bint isNucleotide(self)
 * 
 * cdef class AASequence(BioSequence):             # <<<<<<<<<<<<<<
 *     cpdef bint isNucleotide(self)
 * 
 */
struct __pyx_obj_8obitools_9_obitools_AASequence {
  struct __pyx_obj_8obitools_9_obitools_BioSequence __pyx_base;
};


/* "obitools/fastq/_fastq.pyx":227
 *     sanger,solexa
 * 
 * cdef class fastqParserGenetator:             # <<<<<<<<<<<<<<
 * 
 *     cdef object bioseqfactory
 */
struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator {
  PyObject_HEAD
  struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_vtab;
  PyObject *bioseqfactory;
  PyObject *tagparser;
  PyObject *rawparser;
  int _qualityDecoder;
  int _errorDecoder;
};


/* "obitools/fastq/_fastq.pyx":408
 * 
 * 
 * cdef class fastFastqParserGenetator(fastqParserGenetator):             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator {
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator __pyx_base;
};


/* "obitools/fastq/_fastq.pyx":288
 *         return seq
 * 
 * def fastqIterator(file,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator {
  PyObject_HEAD
  PyObject *__pyx_v_bioseqfactory;
  PyObject *__pyx_v_entry;
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_v_fastqParser;
  PyObject *__pyx_v_fastqvariant;
  PyObject *__pyx_v_file;
  PyObject *__pyx_v_lenseq;
  PyObject *__pyx_v_quality;
  PyObject *__pyx_v_seq;
  PyObject *__pyx_v_tagparser;
  PyObject *__pyx_v_title;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "obitools/_obitools.pxd":41
 *     cpdef bytes _getRawInfo(self)
 * 
 * cdef class NucSequence(BioSequence):             # <<<<<<<<<<<<<<
 *     cpdef object complement(self)
 *     cpdef bint isNucleotide(self)
 */
struct __pyx_obj_8obitools_9_obitools_NucSequence {
  struct __pyx_obj_8obitools_9_obitools_BioSequence __pyx_base;
};


/* "obitools/_obitools.pxd":84
 *     cdef int _posInWrapped(self, int position)
 * 
 * cdef class DNAComplementSequence(WrappedBioSequence):             # <<<<<<<<<<<<<<
 * 
 *     cdef dict _comp
 */
struct __pyx_obj_8obitools_9_obitools_DNAComplementSequence {
  struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence __pyx_base;
  PyObject *_comp;
};



/* "obitools/_obitools.pxd":7
 * 
 * 
 * cdef class BioSequence(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object __quality
 */

struct __pyx_vtabstruct_8obitools_9_obitools_BioSequence {
  PyObject *(*get_seq)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*set_seq)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*clone)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*getDefinition)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*setDefinition)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*getId)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*setId)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*getStr)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*getSymbolAt)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int, int __pyx_skip_dispatch);
  PyObject *(*getSubSeq)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*getKey)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*extractTaxon)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  int (*hasKey)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*keys)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*getTags)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*getRoot)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  int (*_getTaxid)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
  PyObject *(*_setTaxid)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int, int __pyx_skip_dispatch);
  PyObject *(*_getRawInfo)(struct __pyx_obj_8obitools_9_obitools_BioSequence *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_8obitools_9_obitools_BioSequence *__pyx_vtabptr_8obitools_9_obitools_BioSequence;


/* "obitools/_obitools.pxd":41
 *     cpdef bytes _getRawInfo(self)
 * 
 * cdef class NucSequence(BioSequence):             # <<<<<<<<<<<<<<
 *     cpdef object complement(self)
 *     cpdef bint isNucleotide(self)
 */

struct __pyx_vtabstruct_8obitools_9_obitools_NucSequence {
  struct __pyx_vtabstruct_8obitools_9_obitools_BioSequence __pyx_base;
  PyObject *(*complement)(struct __pyx_obj_8obitools_9_obitools_NucSequence *, int __pyx_skip_dispatch);
  int (*isNucleotide)(struct __pyx_obj_8obitools_9_obitools_NucSequence *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_8obitools_9_obitools_NucSequence *__pyx_vtabptr_8obitools_9_obitools_NucSequence;


/* "obitools/_obitools.pxd":48
 *     cpdef bint isNucleotide(self)
 * 
 * cdef class WrappedBioSequence(BioSequence):             # <<<<<<<<<<<<<<
 * 
 *     cdef object _wrapped
 */

struct __pyx_vtabstruct_8obitools_9_obitools_WrappedBioSequence {
  struct __pyx_vtabstruct_8obitools_9_obitools_BioSequence __pyx_base;
  PyObject *(*getWrapped)(struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence *, int __pyx_skip_dispatch);
  int (*isNucleotide)(struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence *, int __pyx_skip_dispatch);
  int (*posInWrapped)(struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_9_obitools_18WrappedBioSequence_posInWrapped *__pyx_optional_args);
  int (*_posInWrapped)(struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence *, int);
  PyObject *(*complement)(struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_8obitools_9_obitools_WrappedBioSequence *__pyx_vtabptr_8obitools_9_obitools_WrappedBioSequence;


/* "obitools/_obitools.pxd":84
 *     cdef int _posInWrapped(self, int position)
 * 
 * cdef class DNAComplementSequence(WrappedBioSequence):             # <<<<<<<<<<<<<<
 * 
 *     cdef dict _comp
 */

struct __pyx_vtabstruct_8obitools_9_obitools_DNAComplementSequence {
  struct __pyx_vtabstruct_8obitools_9_obitools_WrappedBioSequence __pyx_base;
};
static struct __pyx_vtabstruct_8obitools_9_obitools_DNAComplementSequence *__pyx_vtabptr_8obitools_9_obitools_DNAComplementSequence;


/* "obitools/_obitools.pxd":45
 *     cpdef bint isNucleotide(self)
 * 
 * cdef class AASequence(BioSequence):             # <<<<<<<<<<<<<<
 *     cpdef bint isNucleotide(self)
 * 
 */

struct __pyx_vtabstruct_8obitools_9_obitools_AASequence {
  struct __pyx_vtabstruct_8obitools_9_obitools_BioSequence __pyx_base;
  int (*isNucleotide)(struct __pyx_obj_8obitools_9_obitools_AASequence *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_8obitools_9_obitools_AASequence *__pyx_vtabptr_8obitools_9_obitools_AASequence;


/* "obitools/_obitools.pxd":72
 * cdef int _sign(int x)
 * 
 * cdef class SubSequence(WrappedBioSequence):             # <<<<<<<<<<<<<<
 * 
 *     cdef public object _location
 */

struct __pyx_vtabstruct_8obitools_9_obitools_SubSequence {
  struct __pyx_vtabstruct_8obitools_9_obitools_WrappedBioSequence __pyx_base;
};
static struct __pyx_vtabstruct_8obitools_9_obitools_SubSequence *__pyx_vtabptr_8obitools_9_obitools_SubSequence;


/* "obitools/fastq/_fastq.pyx":227
 *     sanger,solexa
 * 
 * cdef class fastqParserGenetator:             # <<<<<<<<<<<<<<
 * 
 *     cdef object bioseqfactory
 */

struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator {
  PyObject *(*errorDecoder)(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *, PyObject *);
  PyObject *(*qualityDecoder)(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *, char *);
};
static struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_vtabptr_8obitools_5fastq_6_fastq_fastqParserGenetator;


/* "obitools/fastq/_fastq.pyx":408
 * 
 * 
 * cdef class fastFastqParserGenetator(fastqParserGenetator):             # <<<<<<<<<<<<<<
 * 
 * 
 */

struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastFastqParserGenetator {
  struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator __pyx_base;
};
static struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastFastqParserGenetator *__pyx_vtabptr_8obitools_5fastq_6_fastq_fastFastqParserGenetator;
#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;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #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, acquire_gil)
  #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 */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

#ifndef CYTHON_PROFILE
  #define CYTHON_PROFILE 1
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
  #define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
  #if CYTHON_PROFILE_REUSE_FRAME
    #define CYTHON_FRAME_MODIFIER static
    #define CYTHON_FRAME_DEL
  #else
    #define CYTHON_FRAME_MODIFIER
    #define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame)
  #endif
  #define __Pyx_TraceDeclarations                                  \
  static PyCodeObject *__pyx_frame_code = NULL;                      \
  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;           \
  int __Pyx_use_tracing = 0;
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno)                            \
  if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) {      \
      __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno);  \
  }
  #define __Pyx_TraceException()                                                           \
  if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) {  \
      PyObject *exc_info = __Pyx_GetExceptionTuple();                                      \
      if (exc_info) {                                                                      \
          PyThreadState_GET()->c_profilefunc(                                              \
              PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);  \
          Py_DECREF(exc_info);                                                             \
      }                                                                                    \
  }
  #define __Pyx_TraceReturn(result)                                                  \
  if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) {  \
      PyThreadState_GET()->c_profilefunc(                                            \
          PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);     \
      CYTHON_FRAME_DEL;                                                               \
  }
  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/
  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/
#else
  #define __Pyx_TraceDeclarations
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno)
  #define __Pyx_TraceException()
  #define __Pyx_TraceReturn(result)
#endif /* CYTHON_PROFILE */

static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);

static void __Pyx_RaiseBufferFallbackError(void); /*proto*/

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_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 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 void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*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 CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(d == Py_None)) {
        __Pyx_RaiseNoneIndexingError();
        return NULL;
    }
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

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) {
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (likely(i >= 0)) {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            return m->sq_item(o, i);
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/

typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif

static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

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 void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

#define __Pyx_Generator_USED
#include <structmember.h>
typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_generator_body_t body;
    PyObject *closure;
    int is_running;
    int resume_label;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
} __pyx_GeneratorObject;
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure);
static int __pyx_Generator_init(void);

static int __Pyx_check_binary_version(void);

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static void* __Pyx_GetVtable(PyObject *dict); /*proto*/

static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); /*proto*/

static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/


/* Module declarations from 'obitools.fasta._fasta' */
static PyObject *(*__pyx_f_8obitools_5fasta_6_fasta_fastParseFastaDescription)(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *(*__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription)(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/

/* Module declarations from 'obitools._obitools' */
static PyTypeObject *__pyx_ptype_8obitools_9_obitools_BioSequence = 0;
static PyTypeObject *__pyx_ptype_8obitools_9_obitools_NucSequence = 0;
static PyTypeObject *__pyx_ptype_8obitools_9_obitools_AASequence = 0;
static PyTypeObject *__pyx_ptype_8obitools_9_obitools_WrappedBioSequence = 0;
static PyTypeObject *__pyx_ptype_8obitools_9_obitools_SubSequence = 0;
static PyTypeObject *__pyx_ptype_8obitools_9_obitools_DNAComplementSequence = 0;
static PyObject **__pyx_vp_8obitools_9_obitools___default_raw_parser = 0;
#define __pyx_v_8obitools_9_obitools___default_raw_parser (*__pyx_vp_8obitools_9_obitools___default_raw_parser)

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'stdlib' */

/* Module declarations from 'array' */

/* Module declarations from 'obitools.fastq.array' */
static PyTypeObject *__pyx_ptype_8obitools_5fastq_5array_array = 0;
static CYTHON_INLINE int __pyx_f_8obitools_5fastq_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/

/* Module declarations from 'obitools.fastq._fastq' */
static PyTypeObject *__pyx_ptype_8obitools_5fastq_6_fastq_fastqParserGenetator = 0;
static PyTypeObject *__pyx_ptype_8obitools_5fastq_6_fastq_fastFastqParserGenetator = 0;
static PyTypeObject *__pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator = 0;
static PyTypeObject *__pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator = 0;
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_fastqQualityDecoder(char *, int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder *__pyx_optional_args); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySangerDecoder(char *, int __pyx_skip_dispatch); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySolexaDecoder(char *, int __pyx_skip_dispatch); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_qualityToSolexaError(arrayobject *, int __pyx_skip_dispatch); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_qualityToSangerError(arrayobject *, int __pyx_skip_dispatch); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_errorToSangerQuality(arrayobject *, int __pyx_skip_dispatch); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_solexaToSangerQuality(arrayobject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(arrayobject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq *__pyx_optional_args); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
#define __Pyx_MODULE_NAME "obitools.fastq._fastq"
int __pyx_module_is_main_obitools__fastq___fastq = 0;

/* Implementation of 'obitools.fastq._fastq' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_fastqQualityDecoder(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_qualstring, int __pyx_v_base); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_2fastqQualitySangerDecoder(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_qualstring); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_4fastqQualitySolexaDecoder(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_qualstring); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_6qualityToSolexaError(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_8qualityToSangerError(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_10errorToSangerQuality(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_12solexaToSangerQuality(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_14errorToSangerFastQStr(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_16formatFastq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int __pyx_v_gbmode, int __pyx_v_upper); /* proto */
static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_fastqvariant, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator_2__call__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_18fastqIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_fastqvariant, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_21fastqSangerIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_23fastqSolexaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_25fastqIlluminaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_27fastqAAIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser); /* proto */
static int __pyx_pf_8obitools_5fastq_6_fastq_24fastFastqParserGenetator___init__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_fastqvariant); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_2__call__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_29fastFastqIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_fastqvariant); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_32fastFastqSangerIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_34fastFastqSolexaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file); /* proto */
static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_36fastFastqIlluminaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file); /* proto */
static int __pyx_pf_8obitools_5fastq_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
static void __pyx_pf_8obitools_5fastq_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static char __pyx_k_1[] = "";
static char __pyx_k_2[] = "; ";
static char __pyx_k_3[] = "%s=%s";
static char __pyx_k_4[] = ";";
static char __pyx_k_5[] = " ";
static char __pyx_k_6[] = "gi|%s|%s";
static char __pyx_k_7[] = "lcl|%s|";
static char __pyx_k_8[] = "@%s %s %s";
static char __pyx_k_9[] = "%s\n%s\n+\n%s";
static char __pyx_k_10[] = "\n";
static char __pyx_k_13[] = "[a-zA-Z][a-zA-Z0-9_]*";
static char __pyx_k_14[] = "( *%s)+";
static char __pyx_k_18[] = "+";
static char __pyx_k_24[] = "\nCreated on 16 sept. 2009\n\n@author: coissac\n";
static char __pyx_k_25[] = "obitools.format.genericparser";
static char __pyx_k_26[] = "genericEntryIteratorGenerator";
static char __pyx_k_27[] = "obitools.utils";
static char __pyx_k_28[] = "^@";
static char __pyx_k_29[] = "^\\+";
static char __pyx_k_32[] = "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx";
static char __pyx_k_33[] = "obitools.fastq._fastq";
static char __pyx_k_40[] = "fastqIlluminaIterator";
static char __pyx_k_47[] = "fastFastqSangerIterator";
static char __pyx_k_50[] = "fastFastqSolexaIterator";
static char __pyx_k_53[] = "fastFastqIlluminaIterator";
static char __pyx_k__I[] = "I";
static char __pyx_k__d[] = "d";
static char __pyx_k__gi[] = "gi";
static char __pyx_k__id[] = "id";
static char __pyx_k__op[] = "op";
static char __pyx_k__re[] = "re";
static char __pyx_k__seq[] = "seq";
static char __pyx_k__base[] = "base";
static char __pyx_k__data[] = "data";
static char __pyx_k__file[] = "file";
static char __pyx_k__join[] = "join";
static char __pyx_k__next[] = "next";
static char __pyx_k__array[] = "array";
static char __pyx_k__entry[] = "entry";
static char __pyx_k__range[] = "range";
static char __pyx_k__split[] = "split";
static char __pyx_k__strip[] = "strip";
static char __pyx_k__title[] = "title";
static char __pyx_k__upper[] = "upper";
static char __pyx_k__gbmode[] = "gbmode";
static char __pyx_k__lenseq[] = "lenseq";
static char __pyx_k__sanger[] = "sanger";
static char __pyx_k__solexa[] = "solexa";
static char __pyx_k__compile[] = "compile";
static char __pyx_k__ob_size[] = "ob_size";
static char __pyx_k__quality[] = "quality";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k___rawinfo[] = "_rawinfo";
static char __pyx_k__endEntry[] = "endEntry";
static char __pyx_k__illumina[] = "illumina";
static char __pyx_k__obitools[] = "obitools";
static char __pyx_k__tagparser[] = "tagparser";
static char __pyx_k__definition[] = "definition";
static char __pyx_k__qualstring[] = "qualstring";
static char __pyx_k__startEntry[] = "startEntry";
static char __pyx_k__buffer_info[] = "buffer_info";
static char __pyx_k__fastqParser[] = "fastqParser";
static char __pyx_k__fastqvariant[] = "fastqvariant";
static char __pyx_k__rawiteritems[] = "rawiteritems";
static char __pyx_k__bioseqfactory[] = "bioseqfactory";
static char __pyx_k__fastqIterator[] = "fastqIterator";
static char __pyx_k__universalOpen[] = "universalOpen";
static char __pyx_k__bioSeqGenerator[] = "bioSeqGenerator";
static char __pyx_k__fastqAAIterator[] = "fastqAAIterator";
static char __pyx_k__fastFastqIterator[] = "fastFastqIterator";
static char __pyx_k__fastqEntryIterator[] = "fastqEntryIterator";
static char __pyx_k__fastqSangerIterator[] = "fastqSangerIterator";
static char __pyx_k__fastqSolexaIterator[] = "fastqSolexaIterator";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_n_s_25;
static PyObject *__pyx_n_s_26;
static PyObject *__pyx_n_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_n_s_33;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_n_s_40;
static PyObject *__pyx_n_s_47;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_n_s_50;
static PyObject *__pyx_n_s_53;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_n_s__I;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___rawinfo;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__base;
static PyObject *__pyx_n_s__bioSeqGenerator;
static PyObject *__pyx_n_s__bioseqfactory;
static PyObject *__pyx_n_s__buffer_info;
static PyObject *__pyx_n_s__compile;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__definition;
static PyObject *__pyx_n_s__endEntry;
static PyObject *__pyx_n_s__entry;
static PyObject *__pyx_n_s__fastFastqIterator;
static PyObject *__pyx_n_s__fastqAAIterator;
static PyObject *__pyx_n_s__fastqEntryIterator;
static PyObject *__pyx_n_s__fastqIterator;
static PyObject *__pyx_n_s__fastqParser;
static PyObject *__pyx_n_s__fastqSangerIterator;
static PyObject *__pyx_n_s__fastqSolexaIterator;
static PyObject *__pyx_n_s__fastqvariant;
static PyObject *__pyx_n_s__file;
static PyObject *__pyx_n_s__gbmode;
static PyObject *__pyx_n_s__gi;
static PyObject *__pyx_n_s__id;
static PyObject *__pyx_n_s__illumina;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__lenseq;
static PyObject *__pyx_n_s__next;
static PyObject *__pyx_n_s__ob_size;
static PyObject *__pyx_n_s__obitools;
static PyObject *__pyx_n_s__op;
static PyObject *__pyx_n_s__quality;
static PyObject *__pyx_n_s__qualstring;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__rawiteritems;
static PyObject *__pyx_n_s__re;
static PyObject *__pyx_n_s__sanger;
static PyObject *__pyx_n_s__seq;
static PyObject *__pyx_n_s__solexa;
static PyObject *__pyx_n_s__split;
static PyObject *__pyx_n_s__startEntry;
static PyObject *__pyx_n_s__strip;
static PyObject *__pyx_n_s__tagparser;
static PyObject *__pyx_n_s__title;
static PyObject *__pyx_n_s__universalOpen;
static PyObject *__pyx_n_s__upper;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_k_11;
static PyObject *__pyx_k_12;
static PyObject *__pyx_k_16;
static PyObject *__pyx_k_17;
static PyObject *__pyx_k_19;
static PyObject *__pyx_k_20;
static PyObject *__pyx_k_21;
static PyObject *__pyx_k_22;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_45;
static PyObject *__pyx_k_tuple_48;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_codeobj_31;
static PyObject *__pyx_k_codeobj_35;
static PyObject *__pyx_k_codeobj_37;
static PyObject *__pyx_k_codeobj_39;
static PyObject *__pyx_k_codeobj_42;
static PyObject *__pyx_k_codeobj_44;
static PyObject *__pyx_k_codeobj_46;
static PyObject *__pyx_k_codeobj_49;
static PyObject *__pyx_k_codeobj_52;

/* "obitools/fastq/_fastq.pyx":46
 * 
 * 
 * cpdef array.array[double] fastqQualityDecoder(char* qualstring, int base=0):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int mq=255
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_1fastqQualityDecoder(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_fastqQualityDecoder(char *__pyx_v_qualstring, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder *__pyx_optional_args) {
  int __pyx_v_base = ((int)0);
  int __pyx_v_i;
  int __pyx_v_mq;
  arrayobject *__pyx_v_quality = 0;
  double *__pyx_v_bdouble;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_quality;
  __Pyx_Buffer __pyx_pybuffer_quality;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqQualityDecoder", 0);
  __Pyx_TraceCall("fastqQualityDecoder", __pyx_f[0], 46);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_base = __pyx_optional_args->base;
    }
  }
  __pyx_pybuffer_quality.pybuffer.buf = NULL;
  __pyx_pybuffer_quality.refcount = 0;
  __pyx_pybuffernd_quality.data = NULL;
  __pyx_pybuffernd_quality.rcbuffer = &__pyx_pybuffer_quality;

  /* "obitools/fastq/_fastq.pyx":47
 * 
 * cpdef array.array[double] fastqQualityDecoder(char* qualstring, int base=0):
 *     cdef int i=0             # <<<<<<<<<<<<<<
 *     cdef int mq=255
 *     cdef object oaddresse,olength
 */
  __pyx_v_i = 0;

  /* "obitools/fastq/_fastq.pyx":48
 * cpdef array.array[double] fastqQualityDecoder(char* qualstring, int base=0):
 *     cdef int i=0
 *     cdef int mq=255             # <<<<<<<<<<<<<<
 *     cdef object oaddresse,olength
 *     cdef int length
 */
  __pyx_v_mq = 255;

  /* "obitools/fastq/_fastq.pyx":55
 * 
 * #    quality = array.array('d',[0]*strlen(qualstring))
 *     quality = array.array('d',[0])             # <<<<<<<<<<<<<<
 *     array.resize(quality,strlen(qualstring))
 * #    (oaddress,olength)=quality.buffer_info()
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_5fastq_5array_array)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quality.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quality.rcbuffer->pybuffer, (PyObject*)((arrayobject *)__pyx_t_1), &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_INDIRECT, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quality.rcbuffer->pybuffer, (PyObject*)__pyx_v_quality, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_INDIRECT, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      }
    }
    __pyx_pybuffernd_quality.diminfo[0].strides = __pyx_pybuffernd_quality.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_quality.diminfo[0].shape = __pyx_pybuffernd_quality.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_quality.diminfo[0].suboffsets = __pyx_pybuffernd_quality.rcbuffer->pybuffer.suboffsets[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_quality = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":56
 * #    quality = array.array('d',[0]*strlen(qualstring))
 *     quality = array.array('d',[0])
 *     array.resize(quality,strlen(qualstring))             # <<<<<<<<<<<<<<
 * #    (oaddress,olength)=quality.buffer_info()
 *     bdouble=quality._d
 */
  resize(((arrayobject *)__pyx_v_quality), strlen(__pyx_v_qualstring));

  /* "obitools/fastq/_fastq.pyx":58
 *     array.resize(quality,strlen(qualstring))
 * #    (oaddress,olength)=quality.buffer_info()
 *     bdouble=quality._d             # <<<<<<<<<<<<<<
 * 
 *     if base==0:
 */
  __pyx_v_bdouble = __pyx_v_quality->_d;

  /* "obitools/fastq/_fastq.pyx":60
 *     bdouble=quality._d
 * 
 *     if base==0:             # <<<<<<<<<<<<<<
 *         mq = 255
 *         while (qualstring[i]!=0):
 */
  __pyx_t_7 = (__pyx_v_base == 0);
  if (__pyx_t_7) {

    /* "obitools/fastq/_fastq.pyx":61
 * 
 *     if base==0:
 *         mq = 255             # <<<<<<<<<<<<<<
 *         while (qualstring[i]!=0):
 *             if qualstring[i]<mq:
 */
    __pyx_v_mq = 255;

    /* "obitools/fastq/_fastq.pyx":62
 *     if base==0:
 *         mq = 255
 *         while (qualstring[i]!=0):             # <<<<<<<<<<<<<<
 *             if qualstring[i]<mq:
 *                 mq=qualstring[i]
 */
    while (1) {
      __pyx_t_7 = ((__pyx_v_qualstring[__pyx_v_i]) != 0);
      if (!__pyx_t_7) break;

      /* "obitools/fastq/_fastq.pyx":63
 *         mq = 255
 *         while (qualstring[i]!=0):
 *             if qualstring[i]<mq:             # <<<<<<<<<<<<<<
 *                 mq=qualstring[i]
 *             i+=1
 */
      __pyx_t_7 = ((__pyx_v_qualstring[__pyx_v_i]) < __pyx_v_mq);
      if (__pyx_t_7) {

        /* "obitools/fastq/_fastq.pyx":64
 *         while (qualstring[i]!=0):
 *             if qualstring[i]<mq:
 *                 mq=qualstring[i]             # <<<<<<<<<<<<<<
 *             i+=1
 *         if mq < 59:
 */
        __pyx_v_mq = (__pyx_v_qualstring[__pyx_v_i]);
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "obitools/fastq/_fastq.pyx":65
 *             if qualstring[i]<mq:
 *                 mq=qualstring[i]
 *             i+=1             # <<<<<<<<<<<<<<
 *         if mq < 59:
 *             base=33
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "obitools/fastq/_fastq.pyx":66
 *                 mq=qualstring[i]
 *             i+=1
 *         if mq < 59:             # <<<<<<<<<<<<<<
 *             base=33
 *         else:
 */
    __pyx_t_7 = (__pyx_v_mq < 59);
    if (__pyx_t_7) {

      /* "obitools/fastq/_fastq.pyx":67
 *             i+=1
 *         if mq < 59:
 *             base=33             # <<<<<<<<<<<<<<
 *         else:
 *             base=64
 */
      __pyx_v_base = 33;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "obitools/fastq/_fastq.pyx":69
 *             base=33
 *         else:
 *             base=64             # <<<<<<<<<<<<<<
 * 
 *     i=0
 */
      __pyx_v_base = 64;
    }
    __pyx_L7:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "obitools/fastq/_fastq.pyx":71
 *             base=64
 * 
 *     i=0             # <<<<<<<<<<<<<<
 *     while (qualstring[i]!=0):
 *         bdouble[i]=qualstring[i]-base
 */
  __pyx_v_i = 0;

  /* "obitools/fastq/_fastq.pyx":72
 * 
 *     i=0
 *     while (qualstring[i]!=0):             # <<<<<<<<<<<<<<
 *         bdouble[i]=qualstring[i]-base
 *         i+=1
 */
  while (1) {
    __pyx_t_7 = ((__pyx_v_qualstring[__pyx_v_i]) != 0);
    if (!__pyx_t_7) break;

    /* "obitools/fastq/_fastq.pyx":73
 *     i=0
 *     while (qualstring[i]!=0):
 *         bdouble[i]=qualstring[i]-base             # <<<<<<<<<<<<<<
 *         i+=1
 * 
 */
    (__pyx_v_bdouble[__pyx_v_i]) = ((__pyx_v_qualstring[__pyx_v_i]) - __pyx_v_base);

    /* "obitools/fastq/_fastq.pyx":74
 *     while (qualstring[i]!=0):
 *         bdouble[i]=qualstring[i]-base
 *         i+=1             # <<<<<<<<<<<<<<
 * 
 *     return quality
 */
    __pyx_v_i = (__pyx_v_i + 1);
  }

  /* "obitools/fastq/_fastq.pyx":76
 *         i+=1
 * 
 *     return quality             # <<<<<<<<<<<<<<
 * 
 * cpdef array.array[double] fastqQualitySangerDecoder(char* qualstring):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_quality));
  __pyx_r = ((arrayobject *)__pyx_v_quality);
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quality.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualityDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quality.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_quality);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_1fastqQualityDecoder(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_1fastqQualityDecoder(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  char *__pyx_v_qualstring;
  int __pyx_v_base;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__qualstring,&__pyx_n_s__base,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqQualityDecoder (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__qualstring);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__base);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastqQualityDecoder") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      if (values[1]) {
      } else {
        __pyx_v_base = ((int)0);
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_qualstring = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_qualstring) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_base = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_base = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastqQualityDecoder", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualityDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_fastqQualityDecoder(__pyx_self, __pyx_v_qualstring, __pyx_v_base);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":46
 * 
 * 
 * cpdef array.array[double] fastqQualityDecoder(char* qualstring, int base=0):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int mq=255
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_fastqQualityDecoder(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_qualstring, int __pyx_v_base) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqQualityDecoder", 0);
  __Pyx_TraceCall("fastqQualityDecoder", __pyx_f[0], 46);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.base = __pyx_v_base;
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualityDecoder(__pyx_v_qualstring, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualityDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":78
 *     return quality
 * 
 * cpdef array.array[double] fastqQualitySangerDecoder(char* qualstring):             # <<<<<<<<<<<<<<
 *         return fastqQualityDecoder(qualstring,33)
 * 
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_3fastqQualitySangerDecoder(PyObject *__pyx_self, PyObject *__pyx_arg_qualstring); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySangerDecoder(char *__pyx_v_qualstring, CYTHON_UNUSED int __pyx_skip_dispatch) {
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqQualitySangerDecoder", 0);
  __Pyx_TraceCall("fastqQualitySangerDecoder", __pyx_f[0], 78);

  /* "obitools/fastq/_fastq.pyx":79
 * 
 * cpdef array.array[double] fastqQualitySangerDecoder(char* qualstring):
 *         return fastqQualityDecoder(qualstring,33)             # <<<<<<<<<<<<<<
 * 
 * cpdef array.array[double] fastqQualitySolexaDecoder(char* qualstring):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.base = 33;
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualityDecoder(__pyx_v_qualstring, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualitySangerDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_3fastqQualitySangerDecoder(PyObject *__pyx_self, PyObject *__pyx_arg_qualstring); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_3fastqQualitySangerDecoder(PyObject *__pyx_self, PyObject *__pyx_arg_qualstring) {
  char *__pyx_v_qualstring;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqQualitySangerDecoder (wrapper)", 0);
  __pyx_self = __pyx_self;
  assert(__pyx_arg_qualstring); {
    __pyx_v_qualstring = PyBytes_AsString(__pyx_arg_qualstring); if (unlikely((!__pyx_v_qualstring) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualitySangerDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_2fastqQualitySangerDecoder(__pyx_self, ((char *)__pyx_v_qualstring));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":78
 *     return quality
 * 
 * cpdef array.array[double] fastqQualitySangerDecoder(char* qualstring):             # <<<<<<<<<<<<<<
 *         return fastqQualityDecoder(qualstring,33)
 * 
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_2fastqQualitySangerDecoder(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_qualstring) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqQualitySangerDecoder", 0);
  __Pyx_TraceCall("fastqQualitySangerDecoder", __pyx_f[0], 78);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySangerDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualitySangerDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":81
 *         return fastqQualityDecoder(qualstring,33)
 * 
 * cpdef array.array[double] fastqQualitySolexaDecoder(char* qualstring):             # <<<<<<<<<<<<<<
 *         return fastqQualityDecoder(qualstring,64)
 * 
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_5fastqQualitySolexaDecoder(PyObject *__pyx_self, PyObject *__pyx_arg_qualstring); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySolexaDecoder(char *__pyx_v_qualstring, CYTHON_UNUSED int __pyx_skip_dispatch) {
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqQualitySolexaDecoder", 0);
  __Pyx_TraceCall("fastqQualitySolexaDecoder", __pyx_f[0], 81);

  /* "obitools/fastq/_fastq.pyx":82
 * 
 * cpdef array.array[double] fastqQualitySolexaDecoder(char* qualstring):
 *         return fastqQualityDecoder(qualstring,64)             # <<<<<<<<<<<<<<
 * 
 * cpdef array.array[double] qualityToSolexaError(array.array quality):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.base = 64;
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualityDecoder(__pyx_v_qualstring, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualitySolexaDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_5fastqQualitySolexaDecoder(PyObject *__pyx_self, PyObject *__pyx_arg_qualstring); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_5fastqQualitySolexaDecoder(PyObject *__pyx_self, PyObject *__pyx_arg_qualstring) {
  char *__pyx_v_qualstring;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqQualitySolexaDecoder (wrapper)", 0);
  __pyx_self = __pyx_self;
  assert(__pyx_arg_qualstring); {
    __pyx_v_qualstring = PyBytes_AsString(__pyx_arg_qualstring); if (unlikely((!__pyx_v_qualstring) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualitySolexaDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_4fastqQualitySolexaDecoder(__pyx_self, ((char *)__pyx_v_qualstring));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":81
 *         return fastqQualityDecoder(qualstring,33)
 * 
 * cpdef array.array[double] fastqQualitySolexaDecoder(char* qualstring):             # <<<<<<<<<<<<<<
 *         return fastqQualityDecoder(qualstring,64)
 * 
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_4fastqQualitySolexaDecoder(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_qualstring) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqQualitySolexaDecoder", 0);
  __Pyx_TraceCall("fastqQualitySolexaDecoder", __pyx_f[0], 81);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySolexaDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqQualitySolexaDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":84
 *         return fastqQualityDecoder(qualstring,64)
 * 
 * cpdef array.array[double] qualityToSolexaError(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_7qualityToSolexaError(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_qualityToSolexaError(arrayobject *__pyx_v_quality, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_i;
  int __pyx_v_lq;
  double __pyx_v_proba;
  PyObject *__pyx_v_olength = 0;
  double *__pyx_v_bdouble;
  PyObject *__pyx_v_oaddress = NULL;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  unsigned long __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("qualityToSolexaError", 0);
  __Pyx_TraceCall("qualityToSolexaError", __pyx_f[0], 84);

  /* "obitools/fastq/_fastq.pyx":85
 * 
 * cpdef array.array[double] qualityToSolexaError(array.array quality):
 *     cdef int i=0             # <<<<<<<<<<<<<<
 *     cdef int lq
 *     cdef double proba
 */
  __pyx_v_i = 0;

  /* "obitools/fastq/_fastq.pyx":92
 *     cdef double* bdouble
 * 
 *     (oaddress,olength)=quality.buffer_info()             # <<<<<<<<<<<<<<
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_quality), __pyx_n_s__buffer_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_oaddress = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_olength = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":93
 * 
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress             # <<<<<<<<<<<<<<
 *     lq=olength
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_oaddress); if (unlikely((__pyx_t_6 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_bdouble = ((double *)((unsigned long)__pyx_t_6));

  /* "obitools/fastq/_fastq.pyx":94
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength             # <<<<<<<<<<<<<<
 * 
 *     for i in range(lq):
 */
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_olength); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lq = __pyx_t_7;

  /* "obitools/fastq/_fastq.pyx":96
 *     lq=olength
 * 
 *     for i in range(lq):             # <<<<<<<<<<<<<<
 *         proba=1/(1+10.**(bdouble[i]/10.))
 *         bdouble[i]=proba
 */
  __pyx_t_7 = __pyx_v_lq;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "obitools/fastq/_fastq.pyx":97
 * 
 *     for i in range(lq):
 *         proba=1/(1+10.**(bdouble[i]/10.))             # <<<<<<<<<<<<<<
 *         bdouble[i]=proba
 * 
 */
    __pyx_t_9 = (1.0 + pow(10., ((__pyx_v_bdouble[__pyx_v_i]) / 10.)));
    if (unlikely(__pyx_t_9 == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_proba = (1.0 / __pyx_t_9);

    /* "obitools/fastq/_fastq.pyx":98
 *     for i in range(lq):
 *         proba=1/(1+10.**(bdouble[i]/10.))
 *         bdouble[i]=proba             # <<<<<<<<<<<<<<
 * 
 *     return quality
 */
    (__pyx_v_bdouble[__pyx_v_i]) = __pyx_v_proba;
  }

  /* "obitools/fastq/_fastq.pyx":100
 *         bdouble[i]=proba
 * 
 *     return quality             # <<<<<<<<<<<<<<
 * 
 * cpdef array.array[double] qualityToSangerError(array.array quality):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_quality));
  __pyx_r = ((arrayobject *)__pyx_v_quality);
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fastq._fastq.qualityToSolexaError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_olength);
  __Pyx_XDECREF(__pyx_v_oaddress);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_7qualityToSolexaError(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_7qualityToSolexaError(PyObject *__pyx_self, PyObject *__pyx_v_quality) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("qualityToSolexaError (wrapper)", 0);
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quality), __pyx_ptype_8obitools_5fastq_5array_array, 1, "quality", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_6qualityToSolexaError(__pyx_self, ((arrayobject *)__pyx_v_quality));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":84
 *         return fastqQualityDecoder(qualstring,64)
 * 
 * cpdef array.array[double] qualityToSolexaError(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_6qualityToSolexaError(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("qualityToSolexaError", 0);
  __Pyx_TraceCall("qualityToSolexaError", __pyx_f[0], 84);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSolexaError(__pyx_v_quality, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.qualityToSolexaError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":102
 *     return quality
 * 
 * cpdef array.array[double] qualityToSangerError(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_9qualityToSangerError(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_qualityToSangerError(arrayobject *__pyx_v_quality, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_i;
  int __pyx_v_lq;
  double __pyx_v_proba;
  PyObject *__pyx_v_olength = 0;
  double *__pyx_v_bdouble;
  PyObject *__pyx_v_oaddress = NULL;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  unsigned long __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("qualityToSangerError", 0);
  __Pyx_TraceCall("qualityToSangerError", __pyx_f[0], 102);

  /* "obitools/fastq/_fastq.pyx":103
 * 
 * cpdef array.array[double] qualityToSangerError(array.array quality):
 *     cdef int i=0             # <<<<<<<<<<<<<<
 *     cdef int lq
 *     cdef double proba
 */
  __pyx_v_i = 0;

  /* "obitools/fastq/_fastq.pyx":110
 *     cdef double* bdouble
 * 
 *     (oaddress,olength)=quality.buffer_info()             # <<<<<<<<<<<<<<
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_quality), __pyx_n_s__buffer_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_oaddress = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_olength = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":111
 * 
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress             # <<<<<<<<<<<<<<
 *     lq=olength
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_oaddress); if (unlikely((__pyx_t_6 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_bdouble = ((double *)((unsigned long)__pyx_t_6));

  /* "obitools/fastq/_fastq.pyx":112
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength             # <<<<<<<<<<<<<<
 * 
 *     for i in range(lq):
 */
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_olength); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lq = __pyx_t_7;

  /* "obitools/fastq/_fastq.pyx":114
 *     lq=olength
 * 
 *     for i in range(lq):             # <<<<<<<<<<<<<<
 *         proba=10.**(-bdouble[i]/10.)
 *         bdouble[i]=proba
 */
  __pyx_t_7 = __pyx_v_lq;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "obitools/fastq/_fastq.pyx":115
 * 
 *     for i in range(lq):
 *         proba=10.**(-bdouble[i]/10.)             # <<<<<<<<<<<<<<
 *         bdouble[i]=proba
 * 
 */
    __pyx_v_proba = pow(10., ((-(__pyx_v_bdouble[__pyx_v_i])) / 10.));

    /* "obitools/fastq/_fastq.pyx":116
 *     for i in range(lq):
 *         proba=10.**(-bdouble[i]/10.)
 *         bdouble[i]=proba             # <<<<<<<<<<<<<<
 * 
 *     return quality
 */
    (__pyx_v_bdouble[__pyx_v_i]) = __pyx_v_proba;
  }

  /* "obitools/fastq/_fastq.pyx":118
 *         bdouble[i]=proba
 * 
 *     return quality             # <<<<<<<<<<<<<<
 * 
 * cpdef array.array[double] errorToSangerQuality(array.array quality):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_quality));
  __pyx_r = ((arrayobject *)__pyx_v_quality);
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fastq._fastq.qualityToSangerError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_olength);
  __Pyx_XDECREF(__pyx_v_oaddress);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_9qualityToSangerError(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_9qualityToSangerError(PyObject *__pyx_self, PyObject *__pyx_v_quality) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("qualityToSangerError (wrapper)", 0);
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quality), __pyx_ptype_8obitools_5fastq_5array_array, 1, "quality", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_8qualityToSangerError(__pyx_self, ((arrayobject *)__pyx_v_quality));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":102
 *     return quality
 * 
 * cpdef array.array[double] qualityToSangerError(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_8qualityToSangerError(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("qualityToSangerError", 0);
  __Pyx_TraceCall("qualityToSangerError", __pyx_f[0], 102);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSangerError(__pyx_v_quality, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.qualityToSangerError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":120
 *     return quality
 * 
 * cpdef array.array[double] errorToSangerQuality(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_11errorToSangerQuality(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_errorToSangerQuality(arrayobject *__pyx_v_quality, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_i;
  int __pyx_v_lq;
  double __pyx_v_proba;
  PyObject *__pyx_v_olength = 0;
  double *__pyx_v_bdouble;
  PyObject *__pyx_v_oaddress = NULL;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  unsigned long __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("errorToSangerQuality", 0);
  __Pyx_TraceCall("errorToSangerQuality", __pyx_f[0], 120);

  /* "obitools/fastq/_fastq.pyx":121
 * 
 * cpdef array.array[double] errorToSangerQuality(array.array quality):
 *     cdef int i=0             # <<<<<<<<<<<<<<
 *     cdef int lq
 *     cdef double proba
 */
  __pyx_v_i = 0;

  /* "obitools/fastq/_fastq.pyx":128
 *     cdef double* bdouble
 * 
 *     (oaddress,olength)=quality.buffer_info()             # <<<<<<<<<<<<<<
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_quality), __pyx_n_s__buffer_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_oaddress = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_olength = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":129
 * 
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress             # <<<<<<<<<<<<<<
 *     lq=olength
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_oaddress); if (unlikely((__pyx_t_6 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_bdouble = ((double *)((unsigned long)__pyx_t_6));

  /* "obitools/fastq/_fastq.pyx":130
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength             # <<<<<<<<<<<<<<
 * 
 *     for i in range(lq):
 */
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_olength); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lq = __pyx_t_7;

  /* "obitools/fastq/_fastq.pyx":132
 *     lq=olength
 * 
 *     for i in range(lq):             # <<<<<<<<<<<<<<
 *         proba=-rint(log10(bdouble[i])*10)
 *         bdouble[i]=proba
 */
  __pyx_t_7 = __pyx_v_lq;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "obitools/fastq/_fastq.pyx":133
 * 
 *     for i in range(lq):
 *         proba=-rint(log10(bdouble[i])*10)             # <<<<<<<<<<<<<<
 *         bdouble[i]=proba
 * 
 */
    __pyx_v_proba = (-rint((log10((__pyx_v_bdouble[__pyx_v_i])) * 10.0)));

    /* "obitools/fastq/_fastq.pyx":134
 *     for i in range(lq):
 *         proba=-rint(log10(bdouble[i])*10)
 *         bdouble[i]=proba             # <<<<<<<<<<<<<<
 * 
 *     return quality
 */
    (__pyx_v_bdouble[__pyx_v_i]) = __pyx_v_proba;
  }

  /* "obitools/fastq/_fastq.pyx":136
 *         bdouble[i]=proba
 * 
 *     return quality             # <<<<<<<<<<<<<<
 * 
 * cpdef array.array[double] solexaToSangerQuality(array.array quality):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_quality));
  __pyx_r = ((arrayobject *)__pyx_v_quality);
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fastq._fastq.errorToSangerQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_olength);
  __Pyx_XDECREF(__pyx_v_oaddress);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_11errorToSangerQuality(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_11errorToSangerQuality(PyObject *__pyx_self, PyObject *__pyx_v_quality) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("errorToSangerQuality (wrapper)", 0);
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quality), __pyx_ptype_8obitools_5fastq_5array_array, 1, "quality", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_10errorToSangerQuality(__pyx_self, ((arrayobject *)__pyx_v_quality));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":120
 *     return quality
 * 
 * cpdef array.array[double] errorToSangerQuality(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_10errorToSangerQuality(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("errorToSangerQuality", 0);
  __Pyx_TraceCall("errorToSangerQuality", __pyx_f[0], 120);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_errorToSangerQuality(__pyx_v_quality, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.errorToSangerQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":138
 *     return quality
 * 
 * cpdef array.array[double] solexaToSangerQuality(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_13solexaToSangerQuality(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static arrayobject *__pyx_f_8obitools_5fastq_6_fastq_solexaToSangerQuality(arrayobject *__pyx_v_quality, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_i;
  int __pyx_v_lq;
  double __pyx_v_proba;
  PyObject *__pyx_v_olength = 0;
  double *__pyx_v_bdouble;
  PyObject *__pyx_v_oaddress = NULL;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  unsigned long __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("solexaToSangerQuality", 0);
  __Pyx_TraceCall("solexaToSangerQuality", __pyx_f[0], 138);

  /* "obitools/fastq/_fastq.pyx":139
 * 
 * cpdef array.array[double] solexaToSangerQuality(array.array quality):
 *     cdef int i=0             # <<<<<<<<<<<<<<
 *     cdef int lq
 *     cdef double proba
 */
  __pyx_v_i = 0;

  /* "obitools/fastq/_fastq.pyx":146
 *     cdef double* bdouble
 * 
 *     (oaddress,olength)=quality.buffer_info()             # <<<<<<<<<<<<<<
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_quality), __pyx_n_s__buffer_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_oaddress = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_olength = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":147
 * 
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress             # <<<<<<<<<<<<<<
 *     lq=olength
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_oaddress); if (unlikely((__pyx_t_6 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_bdouble = ((double *)((unsigned long)__pyx_t_6));

  /* "obitools/fastq/_fastq.pyx":148
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength             # <<<<<<<<<<<<<<
 * 
 *     for i in range(lq):
 */
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_olength); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lq = __pyx_t_7;

  /* "obitools/fastq/_fastq.pyx":150
 *     lq=olength
 * 
 *     for i in range(lq):             # <<<<<<<<<<<<<<
 *         proba=-rint(log10(1/(1+10.**(bdouble[i]/10.)))*10)
 *         bdouble[i]=proba
 */
  __pyx_t_7 = __pyx_v_lq;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "obitools/fastq/_fastq.pyx":151
 * 
 *     for i in range(lq):
 *         proba=-rint(log10(1/(1+10.**(bdouble[i]/10.)))*10)             # <<<<<<<<<<<<<<
 *         bdouble[i]=proba
 * 
 */
    __pyx_t_9 = (1.0 + pow(10., ((__pyx_v_bdouble[__pyx_v_i]) / 10.)));
    if (unlikely(__pyx_t_9 == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_proba = (-rint((log10((1.0 / __pyx_t_9)) * 10.0)));

    /* "obitools/fastq/_fastq.pyx":152
 *     for i in range(lq):
 *         proba=-rint(log10(1/(1+10.**(bdouble[i]/10.)))*10)
 *         bdouble[i]=proba             # <<<<<<<<<<<<<<
 * 
 *     return quality
 */
    (__pyx_v_bdouble[__pyx_v_i]) = __pyx_v_proba;
  }

  /* "obitools/fastq/_fastq.pyx":154
 *         bdouble[i]=proba
 * 
 *     return quality             # <<<<<<<<<<<<<<
 * 
 * cpdef str errorToSangerFastQStr(array.array quality):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_quality));
  __pyx_r = ((arrayobject *)__pyx_v_quality);
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fastq._fastq.solexaToSangerQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_olength);
  __Pyx_XDECREF(__pyx_v_oaddress);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_13solexaToSangerQuality(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_13solexaToSangerQuality(PyObject *__pyx_self, PyObject *__pyx_v_quality) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solexaToSangerQuality (wrapper)", 0);
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quality), __pyx_ptype_8obitools_5fastq_5array_array, 1, "quality", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_12solexaToSangerQuality(__pyx_self, ((arrayobject *)__pyx_v_quality));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":138
 *     return quality
 * 
 * cpdef array.array[double] solexaToSangerQuality(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_12solexaToSangerQuality(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("solexaToSangerQuality", 0);
  __Pyx_TraceCall("solexaToSangerQuality", __pyx_f[0], 138);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_solexaToSangerQuality(__pyx_v_quality, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.solexaToSangerQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":156
 *     return quality
 * 
 * cpdef str errorToSangerFastQStr(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_15errorToSangerFastQStr(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static PyObject *__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(arrayobject *__pyx_v_quality, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_i;
  int __pyx_v_lq;
  double __pyx_v_proba;
  PyObject *__pyx_v_olength = 0;
  double *__pyx_v_bdouble;
  char *__pyx_v_result;
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_oaddress = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  unsigned long __pyx_t_6;
  int __pyx_t_7;
  void *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("errorToSangerFastQStr", 0);
  __Pyx_TraceCall("errorToSangerFastQStr", __pyx_f[0], 156);

  /* "obitools/fastq/_fastq.pyx":157
 * 
 * cpdef str errorToSangerFastQStr(array.array quality):
 *     cdef int i=0             # <<<<<<<<<<<<<<
 *     cdef int lq
 *     cdef double proba
 */
  __pyx_v_i = 0;

  /* "obitools/fastq/_fastq.pyx":166
 *     cdef str code
 * 
 *     (oaddress,olength)=quality.buffer_info()             # <<<<<<<<<<<<<<
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_quality), __pyx_n_s__buffer_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_oaddress = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_olength = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":167
 * 
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress             # <<<<<<<<<<<<<<
 *     lq=olength
 *     result=<char *>malloc(olength+1)
 */
  __pyx_t_6 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_oaddress); if (unlikely((__pyx_t_6 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_bdouble = ((double *)((unsigned long)__pyx_t_6));

  /* "obitools/fastq/_fastq.pyx":168
 *     (oaddress,olength)=quality.buffer_info()
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength             # <<<<<<<<<<<<<<
 *     result=<char *>malloc(olength+1)
 *     result[olength]=0
 */
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_olength); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lq = __pyx_t_7;

  /* "obitools/fastq/_fastq.pyx":169
 *     bdouble=<double*><unsigned long int>oaddress
 *     lq=olength
 *     result=<char *>malloc(olength+1)             # <<<<<<<<<<<<<<
 *     result[olength]=0
 * 
 */
  __pyx_t_2 = PyNumber_Add(__pyx_v_olength, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = malloc(__pyx_t_7); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = ((char *)__pyx_t_8);

  /* "obitools/fastq/_fastq.pyx":170
 *     lq=olength
 *     result=<char *>malloc(olength+1)
 *     result[olength]=0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(lq):
 */
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_olength); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_result[__pyx_t_9]) = 0;

  /* "obitools/fastq/_fastq.pyx":172
 *     result[olength]=0
 * 
 *     for i in range(lq):             # <<<<<<<<<<<<<<
 *         proba=-rint(log10(bdouble[i])*10)
 *         if proba > 93.:
 */
  __pyx_t_7 = __pyx_v_lq;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "obitools/fastq/_fastq.pyx":173
 * 
 *     for i in range(lq):
 *         proba=-rint(log10(bdouble[i])*10)             # <<<<<<<<<<<<<<
 *         if proba > 93.:
 *             proba=93.
 */
    __pyx_v_proba = (-rint((log10((__pyx_v_bdouble[__pyx_v_i])) * 10.0)));

    /* "obitools/fastq/_fastq.pyx":174
 *     for i in range(lq):
 *         proba=-rint(log10(bdouble[i])*10)
 *         if proba > 93.:             # <<<<<<<<<<<<<<
 *             proba=93.
 *         result[i]=33 + <int>proba
 */
    __pyx_t_11 = (__pyx_v_proba > 93.);
    if (__pyx_t_11) {

      /* "obitools/fastq/_fastq.pyx":175
 *         proba=-rint(log10(bdouble[i])*10)
 *         if proba > 93.:
 *             proba=93.             # <<<<<<<<<<<<<<
 *         result[i]=33 + <int>proba
 *     code=result
 */
      __pyx_v_proba = 93.;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "obitools/fastq/_fastq.pyx":176
 *         if proba > 93.:
 *             proba=93.
 *         result[i]=33 + <int>proba             # <<<<<<<<<<<<<<
 *     code=result
 *     free(<void *>result)
 */
    (__pyx_v_result[__pyx_v_i]) = (33 + ((int)__pyx_v_proba));
  }

  /* "obitools/fastq/_fastq.pyx":177
 *             proba=93.
 *         result[i]=33 + <int>proba
 *     code=result             # <<<<<<<<<<<<<<
 *     free(<void *>result)
 *     return code
 */
  __pyx_t_2 = PyBytes_FromString(__pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (!(likely(PyString_CheckExact(((PyObject *)__pyx_t_2)))||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(((PyObject *)__pyx_t_2))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_code = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fastq/_fastq.pyx":178
 *         result[i]=33 + <int>proba
 *     code=result
 *     free(<void *>result)             # <<<<<<<<<<<<<<
 *     return code
 * 
 */
  free(((void *)__pyx_v_result));

  /* "obitools/fastq/_fastq.pyx":179
 *     code=result
 *     free(<void *>result)
 *     return code             # <<<<<<<<<<<<<<
 * 
 * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_code));
  __pyx_r = __pyx_v_code;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fastq._fastq.errorToSangerFastQStr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_olength);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_oaddress);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_15errorToSangerFastQStr(PyObject *__pyx_self, PyObject *__pyx_v_quality); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_15errorToSangerFastQStr(PyObject *__pyx_self, PyObject *__pyx_v_quality) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("errorToSangerFastQStr (wrapper)", 0);
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quality), __pyx_ptype_8obitools_5fastq_5array_array, 1, "quality", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_14errorToSangerFastQStr(__pyx_self, ((arrayobject *)__pyx_v_quality));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":156
 *     return quality
 * 
 * cpdef str errorToSangerFastQStr(array.array quality):             # <<<<<<<<<<<<<<
 *     cdef int i=0
 *     cdef int lq
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_14errorToSangerFastQStr(CYTHON_UNUSED PyObject *__pyx_self, arrayobject *__pyx_v_quality) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("errorToSangerFastQStr", 0);
  __Pyx_TraceCall("errorToSangerFastQStr", __pyx_f[0], 156);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(__pyx_v_quality, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.errorToSangerFastQStr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":181
 *     return code
 * 
 * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False):             # <<<<<<<<<<<<<<
 *     cdef list rep=[]
 *     cdef str  seq
 */

static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_17formatFastq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq *__pyx_optional_args) {
  int __pyx_v_gbmode = ((int)0);
  int __pyx_v_upper = ((int)0);
  PyObject *__pyx_v_rep = 0;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_definition = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_quality = 0;
  PyObject *__pyx_v_id = 0;
  PyObject *__pyx_v_sequence = NULL;
  PyObject *__pyx_v_title = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("formatFastq", 0);
  __Pyx_TraceCall("formatFastq", __pyx_f[0], 181);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_gbmode = __pyx_optional_args->gbmode;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_upper = __pyx_optional_args->upper;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_data);

  /* "obitools/fastq/_fastq.pyx":182
 * 
 * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False):
 *     cdef list rep=[]             # <<<<<<<<<<<<<<
 *     cdef str  seq
 *     cdef str  definition
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rep = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":190
 * 
 * 
 *     if isinstance(data, BioSequence):             # <<<<<<<<<<<<<<
 *         data = [data]
 * 
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_BioSequence));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_data, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "obitools/fastq/_fastq.pyx":191
 * 
 *     if isinstance(data, BioSequence):
 *         data = [data]             # <<<<<<<<<<<<<<
 * 
 *     for sequence in data:
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_data);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __Pyx_DECREF(__pyx_v_data);
    __pyx_v_data = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "obitools/fastq/_fastq.pyx":193
 *         data = [data]
 * 
 *     for sequence in data:             # <<<<<<<<<<<<<<
 *         seq = str(sequence)
 *         if upper:
 */
  if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
    __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_sequence);
    __pyx_v_sequence = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "obitools/fastq/_fastq.pyx":194
 * 
 *     for sequence in data:
 *         seq = str(sequence)             # <<<<<<<<<<<<<<
 *         if upper:
 *             seq=seq.upper()
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_sequence);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_sequence);
    __Pyx_GIVEREF(__pyx_v_sequence);
    __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_seq));
    __pyx_v_seq = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "obitools/fastq/_fastq.pyx":195
 *     for sequence in data:
 *         seq = str(sequence)
 *         if upper:             # <<<<<<<<<<<<<<
 *             seq=seq.upper()
 *         if sequence.definition is None:
 */
    if (__pyx_v_upper) {

      /* "obitools/fastq/_fastq.pyx":196
 *         seq = str(sequence)
 *         if upper:
 *             seq=seq.upper()             # <<<<<<<<<<<<<<
 *         if sequence.definition is None:
 *             definition=''
 */
      __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_seq), __pyx_n_s__upper); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_seq));
      __pyx_v_seq = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "obitools/fastq/_fastq.pyx":197
 *         if upper:
 *             seq=seq.upper()
 *         if sequence.definition is None:             # <<<<<<<<<<<<<<
 *             definition=''
 *         else:
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = (__pyx_t_5 == Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "obitools/fastq/_fastq.pyx":198
 *             seq=seq.upper()
 *         if sequence.definition is None:
 *             definition=''             # <<<<<<<<<<<<<<
 *         else:
 *             definition=sequence.definition
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
      __Pyx_XDECREF(((PyObject *)__pyx_v_definition));
      __pyx_v_definition = __pyx_kp_s_1;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "obitools/fastq/_fastq.pyx":200
 *             definition=''
 *         else:
 *             definition=sequence.definition             # <<<<<<<<<<<<<<
 *         info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()])
 *         if info:
 */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_definition));
      __pyx_v_definition = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L7:;

    /* "obitools/fastq/_fastq.pyx":201
 *         else:
 *             definition=sequence.definition
 *         info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()])             # <<<<<<<<<<<<<<
 *         if info:
 *             info=info+';'
 */
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__rawiteritems); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_7)) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_7)) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
      } else {
        __pyx_t_8 = __pyx_t_10(__pyx_t_7);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      if (unlikely(PyList_Append(__pyx_t_6, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_info));
    __pyx_v_info = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "obitools/fastq/_fastq.pyx":202
 *             definition=sequence.definition
 *         info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()])
 *         if info:             # <<<<<<<<<<<<<<
 *             info=info+';'
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_info)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "obitools/fastq/_fastq.pyx":203
 *         info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()])
 *         if info:
 *             info=info+';'             # <<<<<<<<<<<<<<
 * 
 *         if sequence._rawinfo is not None and sequence._rawinfo:
 */
      __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_v_info), ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __Pyx_DECREF(((PyObject *)__pyx_v_info));
      __pyx_v_info = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "obitools/fastq/_fastq.pyx":205
 *             info=info+';'
 * 
 *         if sequence._rawinfo is not None and sequence._rawinfo:             # <<<<<<<<<<<<<<
 *             info+=" " + sequence._rawinfo.strip()
 * 
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s___rawinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = (__pyx_t_6 != Py_None);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_2) {
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s___rawinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_12 = __pyx_t_11;
    } else {
      __pyx_t_12 = __pyx_t_2;
    }
    if (__pyx_t_12) {

      /* "obitools/fastq/_fastq.pyx":206
 * 
 *         if sequence._rawinfo is not None and sequence._rawinfo:
 *             info+=" " + sequence._rawinfo.strip()             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s___rawinfo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__strip); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_5), __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_info), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_info));
      __pyx_v_info = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "obitools/fastq/_fastq.pyx":209
 * 
 * 
 *         id = sequence.id             # <<<<<<<<<<<<<<
 *         if gbmode:
 *             if 'gi' in sequence:
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__id); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_id));
    __pyx_v_id = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "obitools/fastq/_fastq.pyx":210
 * 
 *         id = sequence.id
 *         if gbmode:             # <<<<<<<<<<<<<<
 *             if 'gi' in sequence:
 *                 id = "gi|%s|%s" % (sequence['gi'],id)
 */
    if (__pyx_v_gbmode) {

      /* "obitools/fastq/_fastq.pyx":211
 *         id = sequence.id
 *         if gbmode:
 *             if 'gi' in sequence:             # <<<<<<<<<<<<<<
 *                 id = "gi|%s|%s" % (sequence['gi'],id)
 *             else:
 */
      __pyx_t_12 = ((PySequence_Contains(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)))); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_12) {

        /* "obitools/fastq/_fastq.pyx":212
 *         if gbmode:
 *             if 'gi' in sequence:
 *                 id = "gi|%s|%s" % (sequence['gi'],id)             # <<<<<<<<<<<<<<
 *             else:
 *                 id = "lcl|%s|" % (id)
 */
        __pyx_t_6 = PyObject_GetItem(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_INCREF(((PyObject *)__pyx_v_id));
        PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_id));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_id));
        __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_v_id));
        __pyx_v_id = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "obitools/fastq/_fastq.pyx":214
 *                 id = "gi|%s|%s" % (sequence['gi'],id)
 *             else:
 *                 id = "lcl|%s|" % (id)             # <<<<<<<<<<<<<<
 *         if hasattr(sequence, "quality"):
 *             quality=errorToSangerFastQStr(sequence.quality)
 */
        __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_v_id)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_DECREF(((PyObject *)__pyx_v_id));
        __pyx_v_id = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      __pyx_L13:;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "obitools/fastq/_fastq.pyx":215
 *             else:
 *                 id = "lcl|%s|" % (id)
 *         if hasattr(sequence, "quality"):             # <<<<<<<<<<<<<<
 *             quality=errorToSangerFastQStr(sequence.quality)
 *         else:
 */
    __pyx_t_6 = ((PyObject *)__pyx_n_s__quality);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_12 = PyObject_HasAttr(__pyx_v_sequence, __pyx_t_6); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_12) {

      /* "obitools/fastq/_fastq.pyx":216
 *                 id = "lcl|%s|" % (id)
 *         if hasattr(sequence, "quality"):
 *             quality=errorToSangerFastQStr(sequence.quality)             # <<<<<<<<<<<<<<
 *         else:
 *             quality="I"*len(sequence)
 */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__quality); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(((arrayobject *)__pyx_t_6), 0)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_quality));
      __pyx_v_quality = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "obitools/fastq/_fastq.pyx":218
 *             quality=errorToSangerFastQStr(sequence.quality)
 *         else:
 *             quality="I"*len(sequence)             # <<<<<<<<<<<<<<
 *         title='@%s %s %s' %(id,info,definition)
 *         rep.append("%s\n%s\n+\n%s" % (title,seq,quality))
 */
      __pyx_t_9 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyNumber_Multiply(((PyObject *)__pyx_n_s__I), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_quality));
      __pyx_v_quality = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    __pyx_L14:;

    /* "obitools/fastq/_fastq.pyx":219
 *         else:
 *             quality="I"*len(sequence)
 *         title='@%s %s %s' %(id,info,definition)             # <<<<<<<<<<<<<<
 *         rep.append("%s\n%s\n+\n%s" % (title,seq,quality))
 *     return '\n'.join(rep)
 */
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_id));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_id));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_id));
    __Pyx_INCREF(((PyObject *)__pyx_v_info));
    PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_info));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_info));
    __Pyx_INCREF(((PyObject *)__pyx_v_definition));
    PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_definition));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_definition));
    __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_title);
    __pyx_v_title = ((PyObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "obitools/fastq/_fastq.pyx":220
 *             quality="I"*len(sequence)
 *         title='@%s %s %s' %(id,info,definition)
 *         rep.append("%s\n%s\n+\n%s" % (title,seq,quality))             # <<<<<<<<<<<<<<
 *     return '\n'.join(rep)
 * 
 */
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_title);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_title);
    __Pyx_GIVEREF(__pyx_v_title);
    __Pyx_INCREF(((PyObject *)__pyx_v_seq));
    PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_seq));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_seq));
    __Pyx_INCREF(((PyObject *)__pyx_v_quality));
    PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_quality));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_quality));
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_13 = PyList_Append(__pyx_v_rep, ((PyObject *)__pyx_t_6)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":221
 *         title='@%s %s %s' %(id,info,definition)
 *         rep.append("%s\n%s\n+\n%s" % (title,seq,quality))
 *     return '\n'.join(rep)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_10), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_rep));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_rep));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rep));
  __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("obitools.fastq._fastq.formatFastq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rep);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_quality);
  __Pyx_XDECREF(__pyx_v_id);
  __Pyx_XDECREF(__pyx_v_sequence);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_17formatFastq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_17formatFastq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  int __pyx_v_gbmode;
  int __pyx_v_upper;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__gbmode,&__pyx_n_s__upper,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formatFastq (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gbmode);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__upper);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "formatFastq") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      if (values[1]) {
      } else {

        /* "obitools/fastq/_fastq.pyx":181
 *     return code
 * 
 * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False):             # <<<<<<<<<<<<<<
 *     cdef list rep=[]
 *     cdef str  seq
 */
        __pyx_v_gbmode = ((int)0);
      }
      if (values[2]) {
      } else {
        __pyx_v_upper = ((int)0);
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    if (values[1]) {
      __pyx_v_gbmode = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_gbmode == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_gbmode = ((int)0);
    }
    if (values[2]) {
      __pyx_v_upper = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_upper == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_upper = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("formatFastq", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.formatFastq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_16formatFastq(__pyx_self, __pyx_v_data, __pyx_v_gbmode, __pyx_v_upper);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_16formatFastq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int __pyx_v_gbmode, int __pyx_v_upper) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("formatFastq", 0);
  __Pyx_TraceCall("formatFastq", __pyx_f[0], 181);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.gbmode = __pyx_v_gbmode;
  __pyx_t_2.upper = __pyx_v_upper;
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_formatFastq(__pyx_v_data, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __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; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.formatFastq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_8obitools_5fastq_6_fastq_20fastqParserGenetator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8obitools_5fastq_6_fastq_20fastqParserGenetator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fastqvariant = 0;
  PyObject *__pyx_v_bioseqfactory = 0;
  PyObject *__pyx_v_tagparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fastqvariant,&__pyx_n_s__bioseqfactory,&__pyx_n_s__tagparser,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)__pyx_n_s__sanger);
    values[1] = __pyx_k_11;
    values[2] = __pyx_k_12;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fastqvariant);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bioseqfactory);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fastqvariant = values[0];
    __pyx_v_bioseqfactory = values[1];
    __pyx_v_tagparser = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_v_fastqvariant, __pyx_v_bioseqfactory, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":235
 *     cdef bint _errorDecoder
 * 
 *     def __init__(self,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *         self.bioseqfactory = bioseqfactory
 * 
 */

static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_fastqvariant, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser) {
  PyObject *__pyx_v_allparser = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceCall("__init__", __pyx_f[0], 235);
  __Pyx_INCREF(__pyx_v_tagparser);

  /* "obitools/fastq/_fastq.pyx":236
 * 
 *     def __init__(self,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):
 *         self.bioseqfactory = bioseqfactory             # <<<<<<<<<<<<<<
 * 
 *         self.rawparser=tagparser
 */
  __Pyx_INCREF(__pyx_v_bioseqfactory);
  __Pyx_GIVEREF(__pyx_v_bioseqfactory);
  __Pyx_GOTREF(__pyx_v_self->bioseqfactory);
  __Pyx_DECREF(__pyx_v_self->bioseqfactory);
  __pyx_v_self->bioseqfactory = __pyx_v_bioseqfactory;

  /* "obitools/fastq/_fastq.pyx":238
 *         self.bioseqfactory = bioseqfactory
 * 
 *         self.rawparser=tagparser             # <<<<<<<<<<<<<<
 *         allparser = tagparser % '[a-zA-Z][a-zA-Z0-9_]*'
 *         tagparser = re.compile('( *%s)+' % allparser)
 */
  __Pyx_INCREF(__pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_v_tagparser);
  __Pyx_GOTREF(__pyx_v_self->rawparser);
  __Pyx_DECREF(__pyx_v_self->rawparser);
  __pyx_v_self->rawparser = __pyx_v_tagparser;

  /* "obitools/fastq/_fastq.pyx":239
 * 
 *         self.rawparser=tagparser
 *         allparser = tagparser % '[a-zA-Z][a-zA-Z0-9_]*'             # <<<<<<<<<<<<<<
 *         tagparser = re.compile('( *%s)+' % allparser)
 * 
 */
  __pyx_t_1 = PyNumber_Remainder(__pyx_v_tagparser, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_allparser = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":240
 *         self.rawparser=tagparser
 *         allparser = tagparser % '[a-zA-Z][a-zA-Z0-9_]*'
 *         tagparser = re.compile('( *%s)+' % allparser)             # <<<<<<<<<<<<<<
 * 
 *         self.tagparser = tagparser
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_v_allparser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 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 = 240; __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_tagparser);
  __pyx_v_tagparser = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":242
 *         tagparser = re.compile('( *%s)+' % allparser)
 * 
 *         self.tagparser = tagparser             # <<<<<<<<<<<<<<
 *         # Sanger = True
 *         # Solexa = False
 */
  __Pyx_INCREF(__pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_v_tagparser);
  __Pyx_GOTREF(__pyx_v_self->tagparser);
  __Pyx_DECREF(__pyx_v_self->tagparser);
  __pyx_v_self->tagparser = __pyx_v_tagparser;

  /* "obitools/fastq/_fastq.pyx":245
 *         # Sanger = True
 *         # Solexa = False
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),             # <<<<<<<<<<<<<<
 *                                                     'solexa'   : (False,False),
 *                                                     'illumina' : (False,True)}[fastqvariant]
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__sanger), ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "obitools/fastq/_fastq.pyx":246
 *         # Solexa = False
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),
 *                                                     'solexa'   : (False,False),             # <<<<<<<<<<<<<<
 *                                                     'illumina' : (False,True)}[fastqvariant]
 * 
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__solexa), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":247
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),
 *                                                     'solexa'   : (False,False),
 *                                                     'illumina' : (False,True)}[fastqvariant]             # <<<<<<<<<<<<<<
 * 
 *     cdef errorDecoder(self,object qualstring):
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__illumina), ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_1), __pyx_v_fastqvariant); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }

  /* "obitools/fastq/_fastq.pyx":245
 *         # Sanger = True
 *         # Solexa = False
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),             # <<<<<<<<<<<<<<
 *                                                     'solexa'   : (False,False),
 *                                                     'illumina' : (False,True)}[fastqvariant]
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->_qualityDecoder = __pyx_t_6;
  __pyx_v_self->_errorDecoder = __pyx_t_7;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_allparser);
  __Pyx_XDECREF(__pyx_v_tagparser);
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":249
 *                                                     'illumina' : (False,True)}[fastqvariant]
 * 
 *     cdef errorDecoder(self,object qualstring):             # <<<<<<<<<<<<<<
 *         if self._errorDecoder:
 *             return qualityToSangerError(qualstring)
 */

static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorDecoder(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_qualstring) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("errorDecoder", 0);
  __Pyx_TraceCall("errorDecoder", __pyx_f[0], 249);

  /* "obitools/fastq/_fastq.pyx":250
 * 
 *     cdef errorDecoder(self,object qualstring):
 *         if self._errorDecoder:             # <<<<<<<<<<<<<<
 *             return qualityToSangerError(qualstring)
 *         else:
 */
  if (__pyx_v_self->_errorDecoder) {

    /* "obitools/fastq/_fastq.pyx":251
 *     cdef errorDecoder(self,object qualstring):
 *         if self._errorDecoder:
 *             return qualityToSangerError(qualstring)             # <<<<<<<<<<<<<<
 *         else:
 *             return qualityToSolexaError(qualstring)
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_qualstring) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_qualstring, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_v_qualstring;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSangerError(((arrayobject *)__pyx_t_1), 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "obitools/fastq/_fastq.pyx":253
 *             return qualityToSangerError(qualstring)
 *         else:
 *             return qualityToSolexaError(qualstring)             # <<<<<<<<<<<<<<
 * 
 *     cdef qualityDecoder(self,char* qualstring):
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_qualstring) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_qualstring, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_v_qualstring;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSolexaError(((arrayobject *)__pyx_t_2), 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.errorDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":255
 *             return qualityToSolexaError(qualstring)
 * 
 *     cdef qualityDecoder(self,char* qualstring):             # <<<<<<<<<<<<<<
 *         if self._qualityDecoder:
 *             return fastqQualitySangerDecoder(qualstring)
 */

static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualityDecoder(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_v_self, char *__pyx_v_qualstring) {
  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_TraceDeclarations
  __Pyx_RefNannySetupContext("qualityDecoder", 0);
  __Pyx_TraceCall("qualityDecoder", __pyx_f[0], 255);

  /* "obitools/fastq/_fastq.pyx":256
 * 
 *     cdef qualityDecoder(self,char* qualstring):
 *         if self._qualityDecoder:             # <<<<<<<<<<<<<<
 *             return fastqQualitySangerDecoder(qualstring)
 *         else:
 */
  if (__pyx_v_self->_qualityDecoder) {

    /* "obitools/fastq/_fastq.pyx":257
 *     cdef qualityDecoder(self,char* qualstring):
 *         if self._qualityDecoder:
 *             return fastqQualitySangerDecoder(qualstring)             # <<<<<<<<<<<<<<
 *         else:
 *             return fastqQualitySolexaDecoder(qualstring)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySangerDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "obitools/fastq/_fastq.pyx":259
 *             return fastqQualitySangerDecoder(qualstring)
 *         else:
 *             return fastqQualitySolexaDecoder(qualstring)             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self,seq):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySolexaDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __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_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.qualityDecoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_20fastqParserGenetator_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_20fastqParserGenetator_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seq,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seq);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_seq = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator_2__call__(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_v_seq);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":261
 *             return fastqQualitySolexaDecoder(qualstring)
 * 
 *     def __call__(self,seq):             # <<<<<<<<<<<<<<
 *         cdef str  definition
 *         cdef str info
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator_2__call__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_v_definition = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_id = 0;
  PyObject *__pyx_v_s0 = 0;
  PyObject *__pyx_v_tseq = 0;
  PyObject *__pyx_v_tqual = 0;
  PyObject *__pyx_v_title = NULL;
  PyObject *__pyx_v_quality = 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;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__call__", 0);
  __Pyx_TraceCall("__call__", __pyx_f[0], 261);
  __Pyx_INCREF(__pyx_v_seq);

  /* "obitools/fastq/_fastq.pyx":269
 *         cdef bytes tqual
 * 
 *         s0=seq[0]             # <<<<<<<<<<<<<<
 *         title = s0[1:].split(None,1)
 *         id=title[0]
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_s0 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":270
 * 
 *         s0=seq[0]
 *         title = s0[1:].split(None,1)             # <<<<<<<<<<<<<<
 *         id=title[0]
 *         if len(title) == 2:
 */
  __pyx_t_1 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_s0), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_t_1), __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __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_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_title = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":271
 *         s0=seq[0]
 *         title = s0[1:].split(None,1)
 *         id=title[0]             # <<<<<<<<<<<<<<
 *         if len(title) == 2:
 *             definition,info=parseFastaDescription(title[1], self.tagparser)
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_title, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":272
 *         title = s0[1:].split(None,1)
 *         id=title[0]
 *         if len(title) == 2:             # <<<<<<<<<<<<<<
 *             definition,info=parseFastaDescription(title[1], self.tagparser)
 *         else:
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_title); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (__pyx_t_3 == 2);
  if (__pyx_t_4) {

    /* "obitools/fastq/_fastq.pyx":273
 *         id=title[0]
 *         if len(title) == 2:
 *             definition,info=parseFastaDescription(title[1], self.tagparser)             # <<<<<<<<<<<<<<
 *         else:
 *             info= None
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_title, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_v_self->tagparser;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = ((PyObject *)__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription(((PyObject*)__pyx_t_1), __pyx_t_2, 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyTuple_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __Pyx_UnpackTupleError(__pyx_t_5, 2);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_definition = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_v_info = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "obitools/fastq/_fastq.pyx":275
 *             definition,info=parseFastaDescription(title[1], self.tagparser)
 *         else:
 *             info= None             # <<<<<<<<<<<<<<
 *             definition=None
 * 
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_info = ((PyObject*)Py_None);

    /* "obitools/fastq/_fastq.pyx":276
 *         else:
 *             info= None
 *             definition=None             # <<<<<<<<<<<<<<
 * 
 *         tqual = seq[3]
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_definition = ((PyObject*)Py_None);
  }
  __pyx_L3:;

  /* "obitools/fastq/_fastq.pyx":278
 *             definition=None
 * 
 *         tqual = seq[3]             # <<<<<<<<<<<<<<
 *         quality=self.errorDecoder(self.qualityDecoder(tqual))
 * 
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_seq, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_tqual = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":279
 * 
 *         tqual = seq[3]
 *         quality=self.errorDecoder(self.qualityDecoder(tqual))             # <<<<<<<<<<<<<<
 * 
 *         tseq=seq[1]
 */
  __pyx_t_6 = PyBytes_AsString(((PyObject *)__pyx_v_tqual)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self->__pyx_vtab)->qualityDecoder(__pyx_v_self, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self->__pyx_vtab)->errorDecoder(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_quality = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":281
 *         quality=self.errorDecoder(self.qualityDecoder(tqual))
 * 
 *         tseq=seq[1]             # <<<<<<<<<<<<<<
 * 
 *         seq = self.bioseqfactory(id, tseq, definition,info,self.rawparser)
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_tseq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":283
 *         tseq=seq[1]
 * 
 *         seq = self.bioseqfactory(id, tseq, definition,info,self.rawparser)             # <<<<<<<<<<<<<<
 *         seq.quality = quality
 * 
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_id));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_id));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_id));
  __Pyx_INCREF(((PyObject *)__pyx_v_tseq));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_tseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_tseq));
  __Pyx_INCREF(((PyObject *)__pyx_v_definition));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_definition));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_definition));
  __Pyx_INCREF(((PyObject *)__pyx_v_info));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_info));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_info));
  __Pyx_INCREF(__pyx_v_self->rawparser);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->rawparser);
  __Pyx_GIVEREF(__pyx_v_self->rawparser);
  __pyx_t_5 = PyObject_Call(__pyx_v_self->bioseqfactory, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_seq);
  __pyx_v_seq = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":284
 * 
 *         seq = self.bioseqfactory(id, tseq, definition,info,self.rawparser)
 *         seq.quality = quality             # <<<<<<<<<<<<<<
 * 
 *         return seq
 */
  if (PyObject_SetAttr(__pyx_v_seq, __pyx_n_s__quality, __pyx_v_quality) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":286
 *         seq.quality = quality
 * 
 *         return seq             # <<<<<<<<<<<<<<
 * 
 * def fastqIterator(file,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_seq);
  __pyx_r = __pyx_v_seq;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_id);
  __Pyx_XDECREF(__pyx_v_s0);
  __Pyx_XDECREF(__pyx_v_tseq);
  __Pyx_XDECREF(__pyx_v_tqual);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_XDECREF(__pyx_v_quality);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8obitools_5fastq_6_fastq_20generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_19fastqIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_18fastqIterator[] = "\n    iterate through a fasta file sequence by sequence.\n    Returned sequences by this iterator will be BioSequence\n    instances\n\n    @param file: a line iterator containing fasta data or a filename\n    @type file:  an iterable object or str\n    @param bioseqfactory: a callable object return a BioSequence\n                          instance.\n    @type bioseqfactory: a callable object\n\n    @param tagparser: a compiled regular expression usable\n                      to identify key, value couples from \n                      title line.\n    @type tagparser: regex instance\n    \n    @return: an iterator on C{BioSequence} instance\n \n    @see: L{fastaNucIterator}\n    @see: L{fastaAAIterator}\n\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_19fastqIterator = {__Pyx_NAMESTR("fastqIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_19fastqIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_18fastqIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_19fastqIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_fastqvariant = 0;
  PyObject *__pyx_v_bioseqfactory = 0;
  PyObject *__pyx_v_tagparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__fastqvariant,&__pyx_n_s__bioseqfactory,&__pyx_n_s__tagparser,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_s__sanger);
    values[2] = __pyx_k_16;
    values[3] = __pyx_k_17;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fastqvariant);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bioseqfactory);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastqIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_fastqvariant = values[1];
    __pyx_v_bioseqfactory = values[2];
    __pyx_v_tagparser = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastqIterator", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_18fastqIterator(__pyx_self, __pyx_v_file, __pyx_v_fastqvariant, __pyx_v_bioseqfactory, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":288
 *         return seq
 * 
 * def fastqIterator(file,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_18fastqIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_fastqvariant, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqIterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *)__pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator->tp_new(__pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_TraceCall("fastqIterator", __pyx_f[0], 288);
  __pyx_cur_scope->__pyx_v_file = __pyx_v_file;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __pyx_cur_scope->__pyx_v_fastqvariant = __pyx_v_fastqvariant;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  __pyx_cur_scope->__pyx_v_bioseqfactory = __pyx_v_bioseqfactory;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bioseqfactory);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bioseqfactory);
  __pyx_cur_scope->__pyx_v_tagparser = __pyx_v_tagparser;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tagparser);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8obitools_5fastq_6_fastq_20generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8obitools_5fastq_6_fastq_20generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *__pyx_cur_scope = ((struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":311
 * 
 *     '''
 *     fastqParser=fastqParserGenetator(fastqvariant, bioseqfactory, tagparser)             # <<<<<<<<<<<<<<
 *     file = universalOpen(file)
 *     for entry in fastqEntryIterator(file):
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_fastqvariant);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bioseqfactory);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_bioseqfactory);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bioseqfactory);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tagparser);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tagparser);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_5fastq_6_fastq_fastqParserGenetator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_fastqParser = ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fastq/_fastq.pyx":312
 *     '''
 *     fastqParser=fastqParserGenetator(fastqvariant, bioseqfactory, tagparser)
 *     file = universalOpen(file)             # <<<<<<<<<<<<<<
 *     for entry in fastqEntryIterator(file):
 *         title=entry[0]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__universalOpen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_file);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_file = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":313
 *     fastqParser=fastqParserGenetator(fastqvariant, bioseqfactory, tagparser)
 *     file = universalOpen(file)
 *     for entry in fastqEntryIterator(file):             # <<<<<<<<<<<<<<
 *         title=entry[0]
 *         seq="".join(entry[1:-1])
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastqEntryIterator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __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 = 313; __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;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_entry);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_entry);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_entry = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "obitools/fastq/_fastq.pyx":314
 *     file = universalOpen(file)
 *     for entry in fastqEntryIterator(file):
 *         title=entry[0]             # <<<<<<<<<<<<<<
 *         seq="".join(entry[1:-1])
 *         quality=''
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_title);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_title);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_title = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "obitools/fastq/_fastq.pyx":315
 *     for entry in fastqEntryIterator(file):
 *         title=entry[0]
 *         seq="".join(entry[1:-1])             # <<<<<<<<<<<<<<
 *         quality=''
 *         lenseq=len(seq)
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_entry, 1, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __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_6)); __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_seq);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_seq);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_seq = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "obitools/fastq/_fastq.pyx":316
 *         title=entry[0]
 *         seq="".join(entry[1:-1])
 *         quality=''             # <<<<<<<<<<<<<<
 *         lenseq=len(seq)
 *         while (len(quality) < lenseq):
 */
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_quality);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_quality);
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
    __pyx_cur_scope->__pyx_v_quality = ((PyObject *)__pyx_kp_s_1);

    /* "obitools/fastq/_fastq.pyx":317
 *         seq="".join(entry[1:-1])
 *         quality=''
 *         lenseq=len(seq)             # <<<<<<<<<<<<<<
 *         while (len(quality) < lenseq):
 *             quality+=file.next().strip()
 */
    __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_seq); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lenseq);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lenseq);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_lenseq = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "obitools/fastq/_fastq.pyx":318
 *         quality=''
 *         lenseq=len(seq)
 *         while (len(quality) < lenseq):             # <<<<<<<<<<<<<<
 *             quality+=file.next().strip()
 * 
 */
    while (1) {
      __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_quality); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_cur_scope->__pyx_v_lenseq, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!__pyx_t_8) break;

      /* "obitools/fastq/_fastq.pyx":319
 *         lenseq=len(seq)
 *         while (len(quality) < lenseq):
 *             quality+=file.next().strip()             # <<<<<<<<<<<<<<
 * 
 *         yield fastqParser([title,seq,'+',quality])
 */
      __pyx_t_6 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_file, __pyx_n_s__next); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__strip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_quality, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_quality);
      __Pyx_DECREF(__pyx_cur_scope->__pyx_v_quality);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_cur_scope->__pyx_v_quality = __pyx_t_6;
      __pyx_t_6 = 0;
    }

    /* "obitools/fastq/_fastq.pyx":321
 *             quality+=file.next().strip()
 * 
 *         yield fastqParser([title,seq,'+',quality])             # <<<<<<<<<<<<<<
 * 
 * def fastqSangerIterator(file,tagparser=__default_raw_parser):
 */
    __pyx_t_6 = PyList_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_title);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_title);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_title);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_seq);
    PyList_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_seq);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_seq);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
    PyList_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_kp_s_18));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_quality);
    PyList_SET_ITEM(__pyx_t_6, 3, __pyx_cur_scope->__pyx_v_quality);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_quality);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(((PyObject *)__pyx_cur_scope->__pyx_v_fastqParser), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fastqIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_22fastqSangerIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_21fastqSangerIterator[] = "\n    iterate through a fastq file sequence by sequence.\n    Returned sequences by this iterator will be NucSequence\n    instances\n    \n    @param file: a line iterator containint fasta data\n    @type file: an iterable object\n\n    @param tagparser: a compiled regular expression usable\n                      to identify key, value couples from \n                      title line.\n    @type tagparser: regex instance\n    \n    @return: an iterator on C{NucBioSequence} instance\n    \n    @see: L{fastqIterator}\n    @see: L{fastqAAIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_22fastqSangerIterator = {__Pyx_NAMESTR("fastqSangerIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_22fastqSangerIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_21fastqSangerIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_22fastqSangerIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_tagparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__tagparser,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqSangerIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_19;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastqSangerIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_tagparser = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastqSangerIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqSangerIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_21fastqSangerIterator(__pyx_self, __pyx_v_file, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":323
 *         yield fastqParser([title,seq,'+',quality])
 * 
 * def fastqSangerIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_21fastqSangerIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqSangerIterator", 0);
  __Pyx_TraceCall("fastqSangerIterator", __pyx_f[0], 323);

  /* "obitools/fastq/_fastq.pyx":342
 *     @see: L{fastqAAIterator}
 *     '''
 *     return fastqIterator(file,'sanger',NucSequence,tagparser)             # <<<<<<<<<<<<<<
 * 
 * def fastqSolexaIterator(file,tagparser=__default_raw_parser):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastqIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sanger));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__sanger));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sanger));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __Pyx_INCREF(__pyx_v_tagparser);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_v_tagparser);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqSangerIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_24fastqSolexaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_23fastqSolexaIterator[] = "\n    iterate through a fastq file sequence by sequence.\n    Returned sequences by this iterator will be NucSequence\n    instances\n    \n    @param file: a line iterator containint fasta data\n    @type file: an iterable object\n\n    @param tagparser: a compiled regular expression usable\n                      to identify key, value couples from \n                      title line.\n    @type tagparser: regex instance\n    \n    @return: an iterator on C{NucBioSequence} instance\n    \n    @see: L{fastqIterator}\n    @see: L{fastqAAIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_24fastqSolexaIterator = {__Pyx_NAMESTR("fastqSolexaIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_24fastqSolexaIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_23fastqSolexaIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_24fastqSolexaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_tagparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__tagparser,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqSolexaIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_20;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastqSolexaIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_tagparser = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastqSolexaIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqSolexaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_23fastqSolexaIterator(__pyx_self, __pyx_v_file, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":344
 *     return fastqIterator(file,'sanger',NucSequence,tagparser)
 * 
 * def fastqSolexaIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_23fastqSolexaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqSolexaIterator", 0);
  __Pyx_TraceCall("fastqSolexaIterator", __pyx_f[0], 344);

  /* "obitools/fastq/_fastq.pyx":363
 *     @see: L{fastqAAIterator}
 *     '''
 *     return fastqIterator(file,'solexa',NucSequence,tagparser)             # <<<<<<<<<<<<<<
 * 
 * def fastqIlluminaIterator(file,tagparser=__default_raw_parser):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastqIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__solexa));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__solexa));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__solexa));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __Pyx_INCREF(__pyx_v_tagparser);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_v_tagparser);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqSolexaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_26fastqIlluminaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_25fastqIlluminaIterator[] = "\n    iterate through a fastq file sequence by sequence.\n    Returned sequences by this iterator will be NucSequence\n    instances\n    \n    @param file: a line iterator containint fasta data\n    @type file: an iterable object\n\n    @param tagparser: a compiled regular expression usable\n                      to identify key, value couples from \n                      title line.\n    @type tagparser: regex instance\n    \n    @return: an iterator on C{NucBioSequence} instance\n    \n    @see: L{fastqIterator}\n    @see: L{fastqAAIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_26fastqIlluminaIterator = {__Pyx_NAMESTR("fastqIlluminaIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_26fastqIlluminaIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_25fastqIlluminaIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_26fastqIlluminaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_tagparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__tagparser,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqIlluminaIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_21;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastqIlluminaIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_tagparser = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastqIlluminaIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqIlluminaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_25fastqIlluminaIterator(__pyx_self, __pyx_v_file, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":365
 *     return fastqIterator(file,'solexa',NucSequence,tagparser)
 * 
 * def fastqIlluminaIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_25fastqIlluminaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqIlluminaIterator", 0);
  __Pyx_TraceCall("fastqIlluminaIterator", __pyx_f[0], 365);

  /* "obitools/fastq/_fastq.pyx":384
 *     @see: L{fastqAAIterator}
 *     '''
 *     return fastqIterator(file,'illumina',NucSequence,tagparser)             # <<<<<<<<<<<<<<
 * 
 * def fastqAAIterator(file,tagparser=__default_raw_parser):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastqIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__illumina));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__illumina));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__illumina));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __Pyx_INCREF(__pyx_v_tagparser);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_v_tagparser);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqIlluminaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_28fastqAAIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_27fastqAAIterator[] = "\n    iterate through a fastq file sequence by sequence.\n    Returned sequences by this iterator will be AASequence\n    instances\n    \n    @param file: a line iterator containing fasta data\n    @type file: an iterable object\n    \n    @param tagparser: a compiled regular expression usable\n                      to identify key, value couples from \n                      title line.\n    @type tagparser: regex instance\n    \n    @return: an iterator on C{AABioSequence} instance\n\n    @see: L{fastqIterator}\n    @see: L{fastqNucIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_28fastqAAIterator = {__Pyx_NAMESTR("fastqAAIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_28fastqAAIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_27fastqAAIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_28fastqAAIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_tagparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__tagparser,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastqAAIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_22;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastqAAIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_tagparser = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastqAAIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqAAIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_27fastqAAIterator(__pyx_self, __pyx_v_file, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":386
 *     return fastqIterator(file,'illumina',NucSequence,tagparser)
 * 
 * def fastqAAIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_27fastqAAIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastqAAIterator", 0);
  __Pyx_TraceCall("fastqAAIterator", __pyx_f[0], 386);

  /* "obitools/fastq/_fastq.pyx":405
 *     @see: L{fastqNucIterator}
 *     '''
 *     return fastqIterator(file,'sanger',AASequence,tagparser)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastqIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sanger));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__sanger));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sanger));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_AASequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_AASequence)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_AASequence)));
  __Pyx_INCREF(__pyx_v_tagparser);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_v_tagparser);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastqAAIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fastqvariant = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fastqvariant,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__sanger);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fastqvariant);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fastqvariant = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqParserGenetator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_24fastFastqParserGenetator___init__(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *)__pyx_v_self), __pyx_v_fastqvariant);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":411
 * 
 * 
 *     def __init__(self,fastqvariant='sanger'):             # <<<<<<<<<<<<<<
 * 
 *         self.rawparser=__default_raw_parser
 */

static int __pyx_pf_8obitools_5fastq_6_fastq_24fastFastqParserGenetator___init__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_fastqvariant) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceCall("__init__", __pyx_f[0], 411);

  /* "obitools/fastq/_fastq.pyx":413
 *     def __init__(self,fastqvariant='sanger'):
 * 
 *         self.rawparser=__default_raw_parser             # <<<<<<<<<<<<<<
 * 
 *         # Sanger = True
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.rawparser);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.rawparser);
  __pyx_v_self->__pyx_base.rawparser = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);

  /* "obitools/fastq/_fastq.pyx":417
 *         # Sanger = True
 *         # Solexa = False
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),             # <<<<<<<<<<<<<<
 *                                                     'solexa'   : (False,False),
 *                                                     'illumina' : (False,True)}[fastqvariant]
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __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 = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__sanger), ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "obitools/fastq/_fastq.pyx":418
 *         # Solexa = False
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),
 *                                                     'solexa'   : (False,False),             # <<<<<<<<<<<<<<
 *                                                     'illumina' : (False,True)}[fastqvariant]
 * 
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__solexa), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "obitools/fastq/_fastq.pyx":419
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),
 *                                                     'solexa'   : (False,False),
 *                                                     'illumina' : (False,True)}[fastqvariant]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __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 = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__illumina), ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_1), __pyx_v_fastqvariant); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }

  /* "obitools/fastq/_fastq.pyx":417
 *         # Sanger = True
 *         # Solexa = False
 *         self._qualityDecoder, self._errorDecoder = {'sanger'   : (True,True),             # <<<<<<<<<<<<<<
 *                                                     'solexa'   : (False,False),
 *                                                     'illumina' : (False,True)}[fastqvariant]
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base._qualityDecoder = __pyx_t_6;
  __pyx_v_self->__pyx_base._errorDecoder = __pyx_t_7;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqParserGenetator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seq,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seq);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_seq = ((PyObject*)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqParserGenetator.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyList_Type), 1, "seq", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_2__call__(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *)__pyx_v_self), __pyx_v_seq);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":422
 * 
 * 
 *     def __call__(self, list seq):             # <<<<<<<<<<<<<<
 * 
 *         cdef bytes s0    = seq[0]
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_2__call__(struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *__pyx_v_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_v_s0 = 0;
  PyObject *__pyx_v_title = 0;
  PyObject *__pyx_v_id = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_tqual = 0;
  PyObject *__pyx_v_tseq = 0;
  PyObject *__pyx_v_sseq = 0;
  PyObject *__pyx_v_definition = NULL;
  PyObject *__pyx_v_quality = 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;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__call__", 0);
  __Pyx_TraceCall("__call__", __pyx_f[0], 422);

  /* "obitools/fastq/_fastq.pyx":424
 *     def __call__(self, list seq):
 * 
 *         cdef bytes s0    = seq[0]             # <<<<<<<<<<<<<<
 *         cdef list  title = s0.split(None,1)
 *         cdef bytes id    = title[0][1:]
 */
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_seq), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_s0 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":425
 * 
 *         cdef bytes s0    = seq[0]
 *         cdef list  title = s0.split(None,1)             # <<<<<<<<<<<<<<
 *         cdef bytes id    = title[0][1:]
 *         cdef bytes defintion,info
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_s0), __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_title = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fastq/_fastq.pyx":426
 *         cdef bytes s0    = seq[0]
 *         cdef list  title = s0.split(None,1)
 *         cdef bytes id    = title[0][1:]             # <<<<<<<<<<<<<<
 *         cdef bytes defintion,info
 *         cdef bytes tqual = seq[3]
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_title), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_t_2, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":428
 *         cdef bytes id    = title[0][1:]
 *         cdef bytes defintion,info
 *         cdef bytes tqual = seq[3]             # <<<<<<<<<<<<<<
 *         cdef bytes tseq  = seq[1]
 *         cdef object sseq
 */
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_seq), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_tqual = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":429
 *         cdef bytes defintion,info
 *         cdef bytes tqual = seq[3]
 *         cdef bytes tseq  = seq[1]             # <<<<<<<<<<<<<<
 *         cdef object sseq
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_seq), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_tseq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fastq/_fastq.pyx":432
 *         cdef object sseq
 * 
 *         if len(title) == 2:             # <<<<<<<<<<<<<<
 *             definition,info=fastParseFastaDescription(title[1])
 *         else:
 */
  if (unlikely(((PyObject *)__pyx_v_title) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_title)); 
  __pyx_t_4 = (__pyx_t_3 == 2);
  if (__pyx_t_4) {

    /* "obitools/fastq/_fastq.pyx":433
 * 
 *         if len(title) == 2:
 *             definition,info=fastParseFastaDescription(title[1])             # <<<<<<<<<<<<<<
 *         else:
 *             info= None
 */
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_title), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fasta_6_fasta_fastParseFastaDescription(((PyObject*)__pyx_t_1), 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __Pyx_UnpackTupleError(__pyx_t_2, 2);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_definition = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_info = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "obitools/fastq/_fastq.pyx":435
 *             definition,info=fastParseFastaDescription(title[1])
 *         else:
 *             info= None             # <<<<<<<<<<<<<<
 *             definition=None
 * 
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_info = ((PyObject*)Py_None);

    /* "obitools/fastq/_fastq.pyx":436
 *         else:
 *             info= None
 *             definition=None             # <<<<<<<<<<<<<<
 * 
 *         quality=self.errorDecoder(self.qualityDecoder(tqual))
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_definition = Py_None;
  }
  __pyx_L3:;

  /* "obitools/fastq/_fastq.pyx":438
 *             definition=None
 * 
 *         quality=self.errorDecoder(self.qualityDecoder(tqual))             # <<<<<<<<<<<<<<
 * 
 *         sseq = NucSequence(id, tseq, definition,info,__default_raw_parser)
 */
  __pyx_t_6 = PyBytes_AsString(((PyObject *)__pyx_v_tqual)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastFastqParserGenetator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.qualityDecoder(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastFastqParserGenetator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.errorDecoder(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_quality = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":440
 *         quality=self.errorDecoder(self.qualityDecoder(tqual))
 * 
 *         sseq = NucSequence(id, tseq, definition,info,__default_raw_parser)             # <<<<<<<<<<<<<<
 *         sseq.quality = quality
 * 
 */
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_id));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_id));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_id));
  __Pyx_INCREF(((PyObject *)__pyx_v_tseq));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_tseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_tseq));
  __Pyx_INCREF(__pyx_v_definition);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_definition);
  __Pyx_GIVEREF(__pyx_v_definition);
  __Pyx_INCREF(((PyObject *)__pyx_v_info));
  PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_info));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_info));
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_v_sseq = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "obitools/fastq/_fastq.pyx":441
 * 
 *         sseq = NucSequence(id, tseq, definition,info,__default_raw_parser)
 *         sseq.quality = quality             # <<<<<<<<<<<<<<
 * 
 *         return sseq
 */
  if (PyObject_SetAttr(__pyx_v_sseq, __pyx_n_s__quality, __pyx_v_quality) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":443
 *         sseq.quality = quality
 * 
 *         return sseq             # <<<<<<<<<<<<<<
 * 
 * def fastFastqIterator(file,fastqvariant='sanger'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_sseq);
  __pyx_r = __pyx_v_sseq;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqParserGenetator.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s0);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_XDECREF(__pyx_v_id);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_tqual);
  __Pyx_XDECREF(__pyx_v_tseq);
  __Pyx_XDECREF(__pyx_v_sseq);
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_quality);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8obitools_5fastq_6_fastq_31generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_30fastFastqIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_29fastFastqIterator[] = "\n    iterate through a fasta file sequence by sequence.\n    Returned sequences by this iterator will be BioSequence\n    instances\n\n    @param file: a line iterator containing fasta data or a filename\n    @type file:  an iterable object or str\n    @param bioseqfactory: a callable object return a BioSequence\n                          instance.\n    @type bioseqfactory: a callable object\n\n    @param tagparser: a compiled regular expression usable\n                      to identify key, value couples from \n                      title line.\n    @type tagparser: regex instance\n    \n    @return: an iterator on C{BioSequence} instance\n \n    @see: L{fastaNucIterator}\n    @see: L{fastaAAIterator}\n\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_30fastFastqIterator = {__Pyx_NAMESTR("fastFastqIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_30fastFastqIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_29fastFastqIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_30fastFastqIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_fastqvariant = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__fastqvariant,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastFastqIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_s__sanger);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fastqvariant);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastFastqIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_fastqvariant = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastFastqIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_29fastFastqIterator(__pyx_self, __pyx_v_file, __pyx_v_fastqvariant);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":445
 *         return sseq
 * 
 * def fastFastqIterator(file,fastqvariant='sanger'):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_29fastFastqIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_fastqvariant) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastFastqIterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *)__pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator->tp_new(__pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_TraceCall("fastFastqIterator", __pyx_f[0], 445);
  __pyx_cur_scope->__pyx_v_file = __pyx_v_file;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __pyx_cur_scope->__pyx_v_fastqvariant = __pyx_v_fastqvariant;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8obitools_5fastq_6_fastq_31generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8obitools_5fastq_6_fastq_31generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *__pyx_cur_scope = ((struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":468
 * 
 *     '''
 *     fastqParser=fastFastqParserGenetator(fastqvariant)             # <<<<<<<<<<<<<<
 *     file = universalOpen(file)
 *     for entry in fastqEntryIterator(file):
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_fastqvariant);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fastqvariant);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_5fastq_6_fastq_fastFastqParserGenetator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_fastqParser = ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fastq/_fastq.pyx":469
 *     '''
 *     fastqParser=fastFastqParserGenetator(fastqvariant)
 *     file = universalOpen(file)             # <<<<<<<<<<<<<<
 *     for entry in fastqEntryIterator(file):
 *         title=entry[0]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__universalOpen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_file);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_file = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":470
 *     fastqParser=fastFastqParserGenetator(fastqvariant)
 *     file = universalOpen(file)
 *     for entry in fastqEntryIterator(file):             # <<<<<<<<<<<<<<
 *         title=entry[0]
 *         seq="".join(entry[1:-1])
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastqEntryIterator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __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 = 470; __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;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_entry);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_entry);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_entry = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "obitools/fastq/_fastq.pyx":471
 *     file = universalOpen(file)
 *     for entry in fastqEntryIterator(file):
 *         title=entry[0]             # <<<<<<<<<<<<<<
 *         seq="".join(entry[1:-1])
 *         quality=''
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_title);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_title);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_title = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "obitools/fastq/_fastq.pyx":472
 *     for entry in fastqEntryIterator(file):
 *         title=entry[0]
 *         seq="".join(entry[1:-1])             # <<<<<<<<<<<<<<
 *         quality=''
 *         lenseq=len(seq)
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_entry, 1, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __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_6)); __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_seq);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_seq);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_seq = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "obitools/fastq/_fastq.pyx":473
 *         title=entry[0]
 *         seq="".join(entry[1:-1])
 *         quality=''             # <<<<<<<<<<<<<<
 *         lenseq=len(seq)
 *         while (len(quality) < lenseq):
 */
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_quality);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_quality);
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
    __pyx_cur_scope->__pyx_v_quality = ((PyObject *)__pyx_kp_s_1);

    /* "obitools/fastq/_fastq.pyx":474
 *         seq="".join(entry[1:-1])
 *         quality=''
 *         lenseq=len(seq)             # <<<<<<<<<<<<<<
 *         while (len(quality) < lenseq):
 *             quality+=file.next().strip()
 */
    __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_seq); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lenseq);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lenseq);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_lenseq = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "obitools/fastq/_fastq.pyx":475
 *         quality=''
 *         lenseq=len(seq)
 *         while (len(quality) < lenseq):             # <<<<<<<<<<<<<<
 *             quality+=file.next().strip()
 * 
 */
    while (1) {
      __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_quality); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_cur_scope->__pyx_v_lenseq, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!__pyx_t_8) break;

      /* "obitools/fastq/_fastq.pyx":476
 *         lenseq=len(seq)
 *         while (len(quality) < lenseq):
 *             quality+=file.next().strip()             # <<<<<<<<<<<<<<
 * 
 *         yield fastqParser([title,seq,'+',quality])
 */
      __pyx_t_6 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_file, __pyx_n_s__next); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__strip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_quality, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_quality);
      __Pyx_DECREF(__pyx_cur_scope->__pyx_v_quality);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_cur_scope->__pyx_v_quality = __pyx_t_6;
      __pyx_t_6 = 0;
    }

    /* "obitools/fastq/_fastq.pyx":478
 *             quality+=file.next().strip()
 * 
 *         yield fastqParser([title,seq,'+',quality])             # <<<<<<<<<<<<<<
 * 
 * def fastFastqSangerIterator(file):
 */
    __pyx_t_6 = PyList_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_title);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_title);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_title);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_seq);
    PyList_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_seq);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_seq);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
    PyList_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_kp_s_18));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_quality);
    PyList_SET_ITEM(__pyx_t_6, 3, __pyx_cur_scope->__pyx_v_quality);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_quality);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(((PyObject *)__pyx_cur_scope->__pyx_v_fastqParser), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("fastFastqIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_33fastFastqSangerIterator(PyObject *__pyx_self, PyObject *__pyx_v_file); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_32fastFastqSangerIterator[] = "\n    iterate through a fastq file sequence by sequence.\n    Returned sequences by this iterator will be NucSequence\n    instances\n    \n    @param file: a line iterator containint fasta data\n    @type file: an iterable object\n    \n    @return: an iterator on C{NucBioSequence} instance\n    \n    @see: L{fastqIterator}\n    @see: L{fastqAAIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_33fastFastqSangerIterator = {__Pyx_NAMESTR("fastFastqSangerIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_33fastFastqSangerIterator, METH_O, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_32fastFastqSangerIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_33fastFastqSangerIterator(PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastFastqSangerIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_32fastFastqSangerIterator(__pyx_self, ((PyObject *)__pyx_v_file));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":480
 *         yield fastqParser([title,seq,'+',quality])
 * 
 * def fastFastqSangerIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_32fastFastqSangerIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastFastqSangerIterator", 0);
  __Pyx_TraceCall("fastFastqSangerIterator", __pyx_f[0], 480);

  /* "obitools/fastq/_fastq.pyx":494
 *     @see: L{fastqAAIterator}
 *     '''
 *     return fastFastqIterator(file,'sanger')             # <<<<<<<<<<<<<<
 * 
 * def fastFastqSolexaIterator(file):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastFastqIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sanger));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__sanger));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sanger));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqSangerIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_35fastFastqSolexaIterator(PyObject *__pyx_self, PyObject *__pyx_v_file); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_34fastFastqSolexaIterator[] = "\n    iterate through a fastq file sequence by sequence.\n    Returned sequences by this iterator will be NucSequence\n    instances\n    \n    @param file: a line iterator containint fasta data\n    @type file: an iterable object\n    \n    @return: an iterator on C{NucBioSequence} instance\n    \n    @see: L{fastqIterator}\n    @see: L{fastqAAIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_35fastFastqSolexaIterator = {__Pyx_NAMESTR("fastFastqSolexaIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_35fastFastqSolexaIterator, METH_O, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_34fastFastqSolexaIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_35fastFastqSolexaIterator(PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastFastqSolexaIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_34fastFastqSolexaIterator(__pyx_self, ((PyObject *)__pyx_v_file));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":496
 *     return fastFastqIterator(file,'sanger')
 * 
 * def fastFastqSolexaIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_34fastFastqSolexaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastFastqSolexaIterator", 0);
  __Pyx_TraceCall("fastFastqSolexaIterator", __pyx_f[0], 496);

  /* "obitools/fastq/_fastq.pyx":510
 *     @see: L{fastqAAIterator}
 *     '''
 *     return fastFastqIterator(file,'solexa')             # <<<<<<<<<<<<<<
 * 
 * def fastFastqIlluminaIterator(file):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastFastqIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__solexa));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__solexa));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__solexa));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqSolexaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_37fastFastqIlluminaIterator(PyObject *__pyx_self, PyObject *__pyx_v_file); /*proto*/
static char __pyx_doc_8obitools_5fastq_6_fastq_36fastFastqIlluminaIterator[] = "\n    iterate through a fastq file sequence by sequence.\n    Returned sequences by this iterator will be NucSequence\n    instances\n    \n    @param file: a line iterator containint fasta data\n    @type file: an iterable object\n    \n    @return: an iterator on C{NucBioSequence} instance\n    \n    @see: L{fastqIterator}\n    @see: L{fastqAAIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fastq_6_fastq_37fastFastqIlluminaIterator = {__Pyx_NAMESTR("fastFastqIlluminaIterator"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_37fastFastqIlluminaIterator, METH_O, __Pyx_DOCSTR(__pyx_doc_8obitools_5fastq_6_fastq_36fastFastqIlluminaIterator)};
static PyObject *__pyx_pw_8obitools_5fastq_6_fastq_37fastFastqIlluminaIterator(PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastFastqIlluminaIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  __pyx_r = __pyx_pf_8obitools_5fastq_6_fastq_36fastFastqIlluminaIterator(__pyx_self, ((PyObject *)__pyx_v_file));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fastq/_fastq.pyx":512
 *     return fastFastqIterator(file,'solexa')
 * 
 * def fastFastqIlluminaIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_36fastFastqIlluminaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastFastqIlluminaIterator", 0);
  __Pyx_TraceCall("fastFastqIlluminaIterator", __pyx_f[0], 512);

  /* "obitools/fastq/_fastq.pyx":526
 *     @see: L{fastqAAIterator}
 *     '''
 *     return fastFastqIterator(file,'illumina')             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastFastqIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__illumina));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__illumina));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__illumina));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fastq._fastq.fastFastqIlluminaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_8obitools_5fastq_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static int __pyx_pw_8obitools_5fastq_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8obitools_5fastq_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":107
 *             void* _v
 * 
 *         def __getbuffer__(array self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

static int __pyx_pf_8obitools_5fastq_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
  CYTHON_UNUSED unsigned int __pyx_v_itemsize;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }
  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 107);

  /* "array.pxd":114
 *             cdef unsigned rows, columns, itemsize
 * 
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.buf = self.ob_item
 *             info.readonly = 0
 */
  __pyx_v_info->suboffsets = NULL;

  /* "array.pxd":115
 * 
 *             info.suboffsets = NULL
 *             info.buf = self.ob_item             # <<<<<<<<<<<<<<
 *             info.readonly = 0
 *             info.ndim = 1
 */
  __pyx_v_info->buf = __pyx_v_self->ob_item;

  /* "array.pxd":116
 *             info.suboffsets = NULL
 *             info.buf = self.ob_item
 *             info.readonly = 0             # <<<<<<<<<<<<<<
 *             info.ndim = 1
 *             info.itemsize = itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)
 */
  __pyx_v_info->readonly = 0;

  /* "array.pxd":117
 *             info.buf = self.ob_item
 *             info.readonly = 0
 *             info.ndim = 1             # <<<<<<<<<<<<<<
 *             info.itemsize = itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)
 * 
 */
  __pyx_v_info->ndim = 1;

  /* "array.pxd":118
 *             info.readonly = 0
 *             info.ndim = 1
 *             info.itemsize = itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)             # <<<<<<<<<<<<<<
 * 
 *             info.strides = <Py_ssize_t*> \
 */
  __pyx_v_info->itemsize = __pyx_v_self->ob_descr->itemsize;
  __pyx_v_itemsize = __pyx_v_self->ob_descr->itemsize;

  /* "array.pxd":120
 *             info.itemsize = itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)
 * 
 *             info.strides = <Py_ssize_t*> \             # <<<<<<<<<<<<<<
 *                            stdlib.malloc(sizeof(Py_ssize_t) * info.ndim * 2 + 2)
 *             info.shape = info.strides + 1
 */
  __pyx_v_info->strides = ((Py_ssize_t *)malloc(((((sizeof(Py_ssize_t)) * __pyx_v_info->ndim) * 2) + 2)));

  /* "array.pxd":122
 *             info.strides = <Py_ssize_t*> \
 *                            stdlib.malloc(sizeof(Py_ssize_t) * info.ndim * 2 + 2)
 *             info.shape = info.strides + 1             # <<<<<<<<<<<<<<
 *             info.shape[0] = self.ob_size            # number of items
 *             info.strides[0] = info.itemsize
 */
  __pyx_v_info->shape = (__pyx_v_info->strides + 1);

  /* "array.pxd":123
 *                            stdlib.malloc(sizeof(Py_ssize_t) * info.ndim * 2 + 2)
 *             info.shape = info.strides + 1
 *             info.shape[0] = self.ob_size            # number of items             # <<<<<<<<<<<<<<
 *             info.strides[0] = info.itemsize
 * 
 */
  (__pyx_v_info->shape[0]) = __pyx_v_self->ob_size;

  /* "array.pxd":124
 *             info.shape = info.strides + 1
 *             info.shape[0] = self.ob_size            # number of items
 *             info.strides[0] = info.itemsize             # <<<<<<<<<<<<<<
 * 
 *             info.format = <char*>(info.strides + 2 * info.ndim)
 */
  (__pyx_v_info->strides[0]) = __pyx_v_info->itemsize;

  /* "array.pxd":126
 *             info.strides[0] = info.itemsize
 * 
 *             info.format = <char*>(info.strides + 2 * info.ndim)             # <<<<<<<<<<<<<<
 *             info.format[0] = self.ob_descr.typecode
 *             info.format[1] = 0
 */
  __pyx_v_info->format = ((char *)(__pyx_v_info->strides + (2 * __pyx_v_info->ndim)));

  /* "array.pxd":127
 * 
 *             info.format = <char*>(info.strides + 2 * info.ndim)
 *             info.format[0] = self.ob_descr.typecode             # <<<<<<<<<<<<<<
 *             info.format[1] = 0
 *             info.obj = self
 */
  (__pyx_v_info->format[0]) = __pyx_v_self->ob_descr->typecode;

  /* "array.pxd":128
 *             info.format = <char*>(info.strides + 2 * info.ndim)
 *             info.format[0] = self.ob_descr.typecode
 *             info.format[1] = 0             # <<<<<<<<<<<<<<
 *             info.obj = self
 * 
 */
  (__pyx_v_info->format[1]) = 0;

  /* "array.pxd":129
 *             info.format[0] = self.ob_descr.typecode
 *             info.format[1] = 0
 *             info.obj = self             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(array self, Py_buffer* info):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  __pyx_r = 0;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_8obitools_5fastq_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static void __pyx_pw_8obitools_5fastq_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_8obitools_5fastq_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  __Pyx_RefNannyFinishContext();
}

/* "array.pxd":131
 *             info.obj = self
 * 
 *         def __releasebuffer__(array self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             #if PyArray_HASFIELDS(self):
 *             #    stdlib.free(info.format)
 */

static void __pyx_pf_8obitools_5fastq_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  __Pyx_TraceCall("__releasebuffer__", __pyx_f[1], 131);

  /* "array.pxd":135
 *             #    stdlib.free(info.format)
 *             #if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *             stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 * 
 *     array newarrayobject(PyTypeObject* type, Py_ssize_t size,
 */
  free(__pyx_v_info->strides);

  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
}

/* "array.pxd":149
 * #  fast creation of a new array - init with zeros
 * #  yet you need a (any) template array of the same item type (but not same size)
 * cdef inline array zeros_like(array sametype):             # <<<<<<<<<<<<<<
 *     cdef array op = newarrayobject(<PyTypeObject*>sametype.ob_type, sametype.ob_size, sametype.ob_descr)
 *     if op:
 */

static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_zeros_like(arrayobject *__pyx_v_sametype) {
  arrayobject *__pyx_v_op = 0;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("zeros_like", 0);
  __Pyx_TraceCall("zeros_like", __pyx_f[1], 149);

  /* "array.pxd":150
 * #  yet you need a (any) template array of the same item type (but not same size)
 * cdef inline array zeros_like(array sametype):
 *     cdef array op = newarrayobject(<PyTypeObject*>sametype.ob_type, sametype.ob_size, sametype.ob_descr)             # <<<<<<<<<<<<<<
 *     if op:
 *         memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize)
 */
  __pyx_t_1 = ((PyObject *)newarrayobject(((PyTypeObject *)__pyx_v_sametype->ob_type), __pyx_v_sametype->ob_size, __pyx_v_sametype->ob_descr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_op = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "array.pxd":151
 * cdef inline array zeros_like(array sametype):
 *     cdef array op = newarrayobject(<PyTypeObject*>sametype.ob_type, sametype.ob_size, sametype.ob_descr)
 *     if op:             # <<<<<<<<<<<<<<
 *         memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize)
 *         return op
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_op)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "array.pxd":152
 *     cdef array op = newarrayobject(<PyTypeObject*>sametype.ob_type, sametype.ob_size, sametype.ob_descr)
 *     if op:
 *         memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize)             # <<<<<<<<<<<<<<
 *         return op
 * 
 */
    memset(__pyx_v_op->ob_item, 0, (__pyx_v_op->ob_size * __pyx_v_op->ob_descr->itemsize));

    /* "array.pxd":153
 *     if op:
 *         memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize)
 *         return op             # <<<<<<<<<<<<<<
 * 
 * #  fast creation of a new array - no init with zeros
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_op));
    __pyx_r = __pyx_v_op;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq.array.zeros_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_op);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":156
 * 
 * #  fast creation of a new array - no init with zeros
 * cdef inline array empty_like(array sametype):             # <<<<<<<<<<<<<<
 *     return newarrayobject(<PyTypeObject*>sametype.ob_type, sametype.op.ob_size,
 *                            sametype.ob_descr)
 */

static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_empty_like(arrayobject *__pyx_v_sametype) {
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("empty_like", 0);
  __Pyx_TraceCall("empty_like", __pyx_f[1], 156);

  /* "array.pxd":157
 * #  fast creation of a new array - no init with zeros
 * cdef inline array empty_like(array sametype):
 *     return newarrayobject(<PyTypeObject*>sametype.ob_type, sametype.op.ob_size,             # <<<<<<<<<<<<<<
 *                            sametype.ob_descr)
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_sametype), __pyx_n_s__op); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ob_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "array.pxd":158
 * cdef inline array empty_like(array sametype):
 *     return newarrayobject(<PyTypeObject*>sametype.ob_type, sametype.op.ob_size,
 *                            sametype.ob_descr)             # <<<<<<<<<<<<<<
 * 
 * cdef inline array copy(array self):
 */
  __pyx_t_2 = ((PyObject *)newarrayobject(((PyTypeObject *)__pyx_v_sametype->ob_type), __pyx_t_3, __pyx_v_sametype->ob_descr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((arrayobject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("obitools.fastq.array.empty_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":160
 *                            sametype.ob_descr)
 * 
 * cdef inline array copy(array self):             # <<<<<<<<<<<<<<
 *     cdef array op = newarrayobject(<PyTypeObject*>self.ob_type, self.ob_size,
 *                                    self.ob_descr)
 */

static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_copy(arrayobject *__pyx_v_self) {
  arrayobject *__pyx_v_op = 0;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_TraceCall("copy", __pyx_f[1], 160);

  /* "array.pxd":162
 * cdef inline array copy(array self):
 *     cdef array op = newarrayobject(<PyTypeObject*>self.ob_type, self.ob_size,
 *                                    self.ob_descr)             # <<<<<<<<<<<<<<
 *     memcpy(op.ob_item, self.ob_item, op.ob_size * op.ob_descr.itemsize)
 *     return op
 */
  __pyx_t_1 = ((PyObject *)newarrayobject(((PyTypeObject *)__pyx_v_self->ob_type), __pyx_v_self->ob_size, __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_op = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "array.pxd":163
 *     cdef array op = newarrayobject(<PyTypeObject*>self.ob_type, self.ob_size,
 *                                    self.ob_descr)
 *     memcpy(op.ob_item, self.ob_item, op.ob_size * op.ob_descr.itemsize)             # <<<<<<<<<<<<<<
 *     return op
 * 
 */
  memcpy(__pyx_v_op->ob_item, __pyx_v_self->ob_item, (__pyx_v_op->ob_size * __pyx_v_op->ob_descr->itemsize));

  /* "array.pxd":164
 *                                    self.ob_descr)
 *     memcpy(op.ob_item, self.ob_item, op.ob_size * op.ob_descr.itemsize)
 *     return op             # <<<<<<<<<<<<<<
 * 
 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_op));
  __pyx_r = __pyx_v_op;
  goto __pyx_L0;

  __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("obitools.fastq.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_op);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":166
 *     return op
 * 
 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n):             # <<<<<<<<<<<<<<
 *     """ efficent appending of new stuff of same type (e.g. of same array type)
 *         n: number of elements (not number of bytes!)
 */

static CYTHON_INLINE int __pyx_f_8obitools_5fastq_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
  Py_ssize_t __pyx_v_itemsize;
  Py_ssize_t __pyx_v_orgsize;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("extend_buffer", 0);
  __Pyx_TraceCall("extend_buffer", __pyx_f[1], 166);

  /* "array.pxd":170
 *         n: number of elements (not number of bytes!)
 *     """
 *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize, orgsize = self.ob_size             # <<<<<<<<<<<<<<
 *     if -1 == resize_smart(self, orgsize + n):
 *         return -1
 */
  __pyx_v_itemsize = __pyx_v_self->ob_descr->itemsize;
  __pyx_v_orgsize = __pyx_v_self->ob_size;

  /* "array.pxd":171
 *     """
 *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize, orgsize = self.ob_size
 *     if -1 == resize_smart(self, orgsize + n):             # <<<<<<<<<<<<<<
 *         return -1
 *     memcpy( self.ob_item + orgsize * itemsize, stuff, n * itemsize )
 */
  __pyx_t_1 = (-1 == resize_smart(__pyx_v_self, (__pyx_v_orgsize + __pyx_v_n)));
  if (__pyx_t_1) {

    /* "array.pxd":172
 *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize, orgsize = self.ob_size
 *     if -1 == resize_smart(self, orgsize + n):
 *         return -1             # <<<<<<<<<<<<<<
 *     memcpy( self.ob_item + orgsize * itemsize, stuff, n * itemsize )
 * 
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "array.pxd":173
 *     if -1 == resize_smart(self, orgsize + n):
 *         return -1
 *     memcpy( self.ob_item + orgsize * itemsize, stuff, n * itemsize )             # <<<<<<<<<<<<<<
 * 
 * cdef inline int extend(array self, array other):
 */
  memcpy((__pyx_v_self->ob_item + (__pyx_v_orgsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize));

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":175
 *     memcpy( self.ob_item + orgsize * itemsize, stuff, n * itemsize )
 * 
 * cdef inline int extend(array self, array other):             # <<<<<<<<<<<<<<
 *     if self.ob_descr.typecode != self.ob_descr.typecode:
 *         PyErr_BadArgument()
 */

static CYTHON_INLINE int __pyx_f_8obitools_5fastq_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("extend", 0);
  __Pyx_TraceCall("extend", __pyx_f[1], 175);

  /* "array.pxd":176
 * 
 * cdef inline int extend(array self, array other):
 *     if self.ob_descr.typecode != self.ob_descr.typecode:             # <<<<<<<<<<<<<<
 *         PyErr_BadArgument()
 *         return -1
 */
  __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_self->ob_descr->typecode);
  if (__pyx_t_1) {

    /* "array.pxd":177
 * cdef inline int extend(array self, array other):
 *     if self.ob_descr.typecode != self.ob_descr.typecode:
 *         PyErr_BadArgument()             # <<<<<<<<<<<<<<
 *         return -1
 *     return extend_buffer(self, other.ob_item, other.ob_size)
 */
    PyErr_BadArgument();

    /* "array.pxd":178
 *     if self.ob_descr.typecode != self.ob_descr.typecode:
 *         PyErr_BadArgument()
 *         return -1             # <<<<<<<<<<<<<<
 *     return extend_buffer(self, other.ob_item, other.ob_size)
 * 
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "array.pxd":179
 *         PyErr_BadArgument()
 *         return -1
 *     return extend_buffer(self, other.ob_item, other.ob_size)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_8obitools_5fastq_5array_extend_buffer(__pyx_v_self, __pyx_v_other->ob_item, __pyx_v_other->ob_size);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":182
 * 
 * 
 * cdef inline void zero(array op):             # <<<<<<<<<<<<<<
 *     memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize)
 */

static CYTHON_INLINE void __pyx_f_8obitools_5fastq_5array_zero(arrayobject *__pyx_v_op) {
  __Pyx_RefNannyDeclarations
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("zero", 0);
  __Pyx_TraceCall("zero", __pyx_f[1], 182);

  /* "array.pxd":183
 * 
 * cdef inline void zero(array op):
 *     memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize)             # <<<<<<<<<<<<<<
 */
  memset(__pyx_v_op->ob_item, 0, (__pyx_v_op->ob_size * __pyx_v_op->ob_descr->itemsize));

  __Pyx_TraceReturn(Py_None);
  __Pyx_RefNannyFinishContext();
}
static struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator __pyx_vtable_8obitools_5fastq_6_fastq_fastqParserGenetator;

static PyObject *__pyx_tp_new_8obitools_5fastq_6_fastq_fastqParserGenetator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)o);
  p->__pyx_vtab = __pyx_vtabptr_8obitools_5fastq_6_fastq_fastqParserGenetator;
  p->bioseqfactory = Py_None; Py_INCREF(Py_None);
  p->tagparser = Py_None; Py_INCREF(Py_None);
  p->rawparser = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8obitools_5fastq_6_fastq_fastqParserGenetator(PyObject *o) {
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)o;
  Py_XDECREF(p->bioseqfactory);
  Py_XDECREF(p->tagparser);
  Py_XDECREF(p->rawparser);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8obitools_5fastq_6_fastq_fastqParserGenetator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)o;
  if (p->bioseqfactory) {
    e = (*v)(p->bioseqfactory, a); if (e) return e;
  }
  if (p->tagparser) {
    e = (*v)(p->tagparser, a); if (e) return e;
  }
  if (p->rawparser) {
    e = (*v)(p->rawparser, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8obitools_5fastq_6_fastq_fastqParserGenetator(PyObject *o) {
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->bioseqfactory);
  p->bioseqfactory = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tagparser);
  p->tagparser = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rawparser);
  p->rawparser = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8obitools_5fastq_6_fastq_fastqParserGenetator[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_fastqParserGenetator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_fastqParserGenetator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_fastqParserGenetator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_fastqParserGenetator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fastq._fastq.fastqParserGenetator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_fastqParserGenetator, /*tp_as_number*/
  &__pyx_tp_as_sequence_fastqParserGenetator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_fastqParserGenetator, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_8obitools_5fastq_6_fastq_20fastqParserGenetator_3__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_fastqParserGenetator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8obitools_5fastq_6_fastq_20fastqParserGenetator_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastFastqParserGenetator __pyx_vtable_8obitools_5fastq_6_fastq_fastFastqParserGenetator;

static PyObject *__pyx_tp_new_8obitools_5fastq_6_fastq_fastFastqParserGenetator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *p;
  PyObject *o = __pyx_tp_new_8obitools_5fastq_6_fastq_fastqParserGenetator(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator*)__pyx_vtabptr_8obitools_5fastq_6_fastq_fastFastqParserGenetator;
  return o;
}

static PyMethodDef __pyx_methods_8obitools_5fastq_6_fastq_fastFastqParserGenetator[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_fastFastqParserGenetator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_fastFastqParserGenetator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_fastFastqParserGenetator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_fastFastqParserGenetator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_8obitools_5fastq_6_fastq_fastFastqParserGenetator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fastq._fastq.fastFastqParserGenetator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_fastFastqParserGenetator, /*tp_as_number*/
  &__pyx_tp_as_sequence_fastFastqParserGenetator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_fastFastqParserGenetator, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_3__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_fastFastqParserGenetator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fastq_6_fastq_fastqParserGenetator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fastq_6_fastq_fastFastqParserGenetator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8obitools_5fastq_6_fastq_24fastFastqParserGenetator_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8obitools_5fastq_6_fastq_fastFastqParserGenetator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *)o);
  p->__pyx_v_bioseqfactory = 0;
  p->__pyx_v_entry = 0;
  p->__pyx_v_fastqParser = 0;
  p->__pyx_v_fastqvariant = 0;
  p->__pyx_v_file = 0;
  p->__pyx_v_lenseq = 0;
  p->__pyx_v_quality = 0;
  p->__pyx_v_seq = 0;
  p->__pyx_v_tagparser = 0;
  p->__pyx_v_title = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *)o;
  Py_XDECREF(p->__pyx_v_bioseqfactory);
  Py_XDECREF(p->__pyx_v_entry);
  Py_XDECREF(((PyObject *)p->__pyx_v_fastqParser));
  Py_XDECREF(p->__pyx_v_fastqvariant);
  Py_XDECREF(p->__pyx_v_file);
  Py_XDECREF(p->__pyx_v_lenseq);
  Py_XDECREF(p->__pyx_v_quality);
  Py_XDECREF(p->__pyx_v_seq);
  Py_XDECREF(p->__pyx_v_tagparser);
  Py_XDECREF(p->__pyx_v_title);
  Py_XDECREF(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *)o;
  if (p->__pyx_v_bioseqfactory) {
    e = (*v)(p->__pyx_v_bioseqfactory, a); if (e) return e;
  }
  if (p->__pyx_v_entry) {
    e = (*v)(p->__pyx_v_entry, a); if (e) return e;
  }
  if (p->__pyx_v_fastqParser) {
    e = (*v)(((PyObject*)p->__pyx_v_fastqParser), a); if (e) return e;
  }
  if (p->__pyx_v_fastqvariant) {
    e = (*v)(p->__pyx_v_fastqvariant, a); if (e) return e;
  }
  if (p->__pyx_v_file) {
    e = (*v)(p->__pyx_v_file, a); if (e) return e;
  }
  if (p->__pyx_v_lenseq) {
    e = (*v)(p->__pyx_v_lenseq, a); if (e) return e;
  }
  if (p->__pyx_v_quality) {
    e = (*v)(p->__pyx_v_quality, a); if (e) return e;
  }
  if (p->__pyx_v_seq) {
    e = (*v)(p->__pyx_v_seq, a); if (e) return e;
  }
  if (p->__pyx_v_tagparser) {
    e = (*v)(p->__pyx_v_tagparser, a); if (e) return e;
  }
  if (p->__pyx_v_title) {
    e = (*v)(p->__pyx_v_title, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_bioseqfactory);
  p->__pyx_v_bioseqfactory = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_entry);
  p->__pyx_v_entry = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_fastqParser);
  p->__pyx_v_fastqParser = ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_fastqvariant);
  p->__pyx_v_fastqvariant = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_file);
  p->__pyx_v_file = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_lenseq);
  p->__pyx_v_lenseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_quality);
  p->__pyx_v_quality = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_seq);
  p->__pyx_v_seq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_tagparser);
  p->__pyx_v_tagparser = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_title);
  p->__pyx_v_title = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct__fastqIterator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct__fastqIterator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct__fastqIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct__fastqIterator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fastq._fastq.__pyx_scope_struct__fastqIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct__fastqIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct__fastqIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct__fastqIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct__fastqIterator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *)o);
  p->__pyx_v_entry = 0;
  p->__pyx_v_fastqParser = 0;
  p->__pyx_v_fastqvariant = 0;
  p->__pyx_v_file = 0;
  p->__pyx_v_lenseq = 0;
  p->__pyx_v_quality = 0;
  p->__pyx_v_seq = 0;
  p->__pyx_v_title = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *)o;
  Py_XDECREF(p->__pyx_v_entry);
  Py_XDECREF(((PyObject *)p->__pyx_v_fastqParser));
  Py_XDECREF(p->__pyx_v_fastqvariant);
  Py_XDECREF(p->__pyx_v_file);
  Py_XDECREF(p->__pyx_v_lenseq);
  Py_XDECREF(p->__pyx_v_quality);
  Py_XDECREF(p->__pyx_v_seq);
  Py_XDECREF(p->__pyx_v_title);
  Py_XDECREF(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *)o;
  if (p->__pyx_v_entry) {
    e = (*v)(p->__pyx_v_entry, a); if (e) return e;
  }
  if (p->__pyx_v_fastqParser) {
    e = (*v)(((PyObject*)p->__pyx_v_fastqParser), a); if (e) return e;
  }
  if (p->__pyx_v_fastqvariant) {
    e = (*v)(p->__pyx_v_fastqvariant, a); if (e) return e;
  }
  if (p->__pyx_v_file) {
    e = (*v)(p->__pyx_v_file, a); if (e) return e;
  }
  if (p->__pyx_v_lenseq) {
    e = (*v)(p->__pyx_v_lenseq, a); if (e) return e;
  }
  if (p->__pyx_v_quality) {
    e = (*v)(p->__pyx_v_quality, a); if (e) return e;
  }
  if (p->__pyx_v_seq) {
    e = (*v)(p->__pyx_v_seq, a); if (e) return e;
  }
  if (p->__pyx_v_title) {
    e = (*v)(p->__pyx_v_title, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *p = (struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_entry);
  p->__pyx_v_entry = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_fastqParser);
  p->__pyx_v_fastqParser = ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastFastqParserGenetator *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_fastqvariant);
  p->__pyx_v_fastqvariant = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_file);
  p->__pyx_v_file = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_lenseq);
  p->__pyx_v_lenseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_quality);
  p->__pyx_v_quality = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_seq);
  p->__pyx_v_seq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_title);
  p->__pyx_v_title = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_fastFastqIterator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_1_fastFastqIterator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_1_fastFastqIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_fastFastqIterator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fastq._fastq.__pyx_scope_struct_1_fastFastqIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_1_fastFastqIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_1_fastFastqIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_1_fastFastqIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_1_fastFastqIterator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("fastqQualityDecoder"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_1fastqQualityDecoder, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fastqQualitySangerDecoder"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_3fastqQualitySangerDecoder, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fastqQualitySolexaDecoder"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_5fastqQualitySolexaDecoder, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("qualityToSolexaError"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_7qualityToSolexaError, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("qualityToSangerError"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_9qualityToSangerError, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("errorToSangerQuality"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_11errorToSangerQuality, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("solexaToSangerQuality"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_13solexaToSangerQuality, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("errorToSangerFastQStr"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_15errorToSangerFastQStr, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("formatFastq"), (PyCFunction)__pyx_pw_8obitools_5fastq_6_fastq_17formatFastq, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("_fastq"),
    __Pyx_DOCSTR(__pyx_k_24), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_n_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 1},
  {&__pyx_n_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 1},
  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_n_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 1},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_n_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 1},
  {&__pyx_n_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 1},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_n_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 1},
  {&__pyx_n_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 1},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_n_s__I, __pyx_k__I, sizeof(__pyx_k__I), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___rawinfo, __pyx_k___rawinfo, sizeof(__pyx_k___rawinfo), 0, 0, 1, 1},
  {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
  {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1},
  {&__pyx_n_s__bioSeqGenerator, __pyx_k__bioSeqGenerator, sizeof(__pyx_k__bioSeqGenerator), 0, 0, 1, 1},
  {&__pyx_n_s__bioseqfactory, __pyx_k__bioseqfactory, sizeof(__pyx_k__bioseqfactory), 0, 0, 1, 1},
  {&__pyx_n_s__buffer_info, __pyx_k__buffer_info, sizeof(__pyx_k__buffer_info), 0, 0, 1, 1},
  {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 0, 0, 1, 1},
  {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__definition, __pyx_k__definition, sizeof(__pyx_k__definition), 0, 0, 1, 1},
  {&__pyx_n_s__endEntry, __pyx_k__endEntry, sizeof(__pyx_k__endEntry), 0, 0, 1, 1},
  {&__pyx_n_s__entry, __pyx_k__entry, sizeof(__pyx_k__entry), 0, 0, 1, 1},
  {&__pyx_n_s__fastFastqIterator, __pyx_k__fastFastqIterator, sizeof(__pyx_k__fastFastqIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastqAAIterator, __pyx_k__fastqAAIterator, sizeof(__pyx_k__fastqAAIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastqEntryIterator, __pyx_k__fastqEntryIterator, sizeof(__pyx_k__fastqEntryIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastqIterator, __pyx_k__fastqIterator, sizeof(__pyx_k__fastqIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastqParser, __pyx_k__fastqParser, sizeof(__pyx_k__fastqParser), 0, 0, 1, 1},
  {&__pyx_n_s__fastqSangerIterator, __pyx_k__fastqSangerIterator, sizeof(__pyx_k__fastqSangerIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastqSolexaIterator, __pyx_k__fastqSolexaIterator, sizeof(__pyx_k__fastqSolexaIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastqvariant, __pyx_k__fastqvariant, sizeof(__pyx_k__fastqvariant), 0, 0, 1, 1},
  {&__pyx_n_s__file, __pyx_k__file, sizeof(__pyx_k__file), 0, 0, 1, 1},
  {&__pyx_n_s__gbmode, __pyx_k__gbmode, sizeof(__pyx_k__gbmode), 0, 0, 1, 1},
  {&__pyx_n_s__gi, __pyx_k__gi, sizeof(__pyx_k__gi), 0, 0, 1, 1},
  {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
  {&__pyx_n_s__illumina, __pyx_k__illumina, sizeof(__pyx_k__illumina), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__lenseq, __pyx_k__lenseq, sizeof(__pyx_k__lenseq), 0, 0, 1, 1},
  {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1},
  {&__pyx_n_s__ob_size, __pyx_k__ob_size, sizeof(__pyx_k__ob_size), 0, 0, 1, 1},
  {&__pyx_n_s__obitools, __pyx_k__obitools, sizeof(__pyx_k__obitools), 0, 0, 1, 1},
  {&__pyx_n_s__op, __pyx_k__op, sizeof(__pyx_k__op), 0, 0, 1, 1},
  {&__pyx_n_s__quality, __pyx_k__quality, sizeof(__pyx_k__quality), 0, 0, 1, 1},
  {&__pyx_n_s__qualstring, __pyx_k__qualstring, sizeof(__pyx_k__qualstring), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__rawiteritems, __pyx_k__rawiteritems, sizeof(__pyx_k__rawiteritems), 0, 0, 1, 1},
  {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
  {&__pyx_n_s__sanger, __pyx_k__sanger, sizeof(__pyx_k__sanger), 0, 0, 1, 1},
  {&__pyx_n_s__seq, __pyx_k__seq, sizeof(__pyx_k__seq), 0, 0, 1, 1},
  {&__pyx_n_s__solexa, __pyx_k__solexa, sizeof(__pyx_k__solexa), 0, 0, 1, 1},
  {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
  {&__pyx_n_s__startEntry, __pyx_k__startEntry, sizeof(__pyx_k__startEntry), 0, 0, 1, 1},
  {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
  {&__pyx_n_s__tagparser, __pyx_k__tagparser, sizeof(__pyx_k__tagparser), 0, 0, 1, 1},
  {&__pyx_n_s__title, __pyx_k__title, sizeof(__pyx_k__title), 0, 0, 1, 1},
  {&__pyx_n_s__universalOpen, __pyx_k__universalOpen, sizeof(__pyx_k__universalOpen), 0, 0, 1, 1},
  {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "obitools/fastq/_fastq.pyx":270
 * 
 *         s0=seq[0]
 *         title = s0[1:].split(None,1)             # <<<<<<<<<<<<<<
 *         id=title[0]
 *         if len(title) == 2:
 */
  __pyx_k_tuple_15 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_15);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_15, 1, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));

  /* "obitools/fastq/_fastq.pyx":425
 * 
 *         cdef bytes s0    = seq[0]
 *         cdef list  title = s0.split(None,1)             # <<<<<<<<<<<<<<
 *         cdef bytes id    = title[0][1:]
 *         cdef bytes defintion,info
 */
  __pyx_k_tuple_23 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_23);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 1, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

  /* "obitools/fastq/_fastq.pyx":288
 *         return seq
 * 
 * def fastqIterator(file,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __pyx_k_tuple_30 = PyTuple_New(10); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_30);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fastqvariant));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 1, ((PyObject *)__pyx_n_s__fastqvariant));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fastqvariant));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bioseqfactory));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 2, ((PyObject *)__pyx_n_s__bioseqfactory));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bioseqfactory));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 3, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fastqParser));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 4, ((PyObject *)__pyx_n_s__fastqParser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fastqParser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__entry));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 5, ((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__entry));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__title));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 6, ((PyObject *)__pyx_n_s__title));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__title));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seq));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 7, ((PyObject *)__pyx_n_s__seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__quality));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 8, ((PyObject *)__pyx_n_s__quality));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__quality));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lenseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 9, ((PyObject *)__pyx_n_s__lenseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lenseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));
  __pyx_k_codeobj_31 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s__fastqIterator, 288, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":323
 *         yield fastqParser([title,seq,'+',quality])
 * 
 * def fastqSangerIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_k_tuple_34 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_34);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_34, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_34, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));
  __pyx_k_codeobj_35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s__fastqSangerIterator, 323, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":344
 *     return fastqIterator(file,'sanger',NucSequence,tagparser)
 * 
 * def fastqSolexaIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_k_tuple_36 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_36);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_36, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));
  __pyx_k_codeobj_37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s__fastqSolexaIterator, 344, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":365
 *     return fastqIterator(file,'solexa',NucSequence,tagparser)
 * 
 * def fastqIlluminaIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_k_tuple_38 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_38, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));
  __pyx_k_codeobj_39 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s_40, 365, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":386
 *     return fastqIterator(file,'illumina',NucSequence,tagparser)
 * 
 * def fastqAAIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_k_tuple_41 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_41);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
  __pyx_k_codeobj_42 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s__fastqAAIterator, 386, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":445
 *         return sseq
 * 
 * def fastFastqIterator(file,fastqvariant='sanger'):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __pyx_k_tuple_43 = PyTuple_New(8); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_43);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fastqvariant));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 1, ((PyObject *)__pyx_n_s__fastqvariant));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fastqvariant));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fastqParser));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 2, ((PyObject *)__pyx_n_s__fastqParser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fastqParser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__entry));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 3, ((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__entry));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__title));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 4, ((PyObject *)__pyx_n_s__title));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__title));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seq));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 5, ((PyObject *)__pyx_n_s__seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__quality));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 6, ((PyObject *)__pyx_n_s__quality));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__quality));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__lenseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 7, ((PyObject *)__pyx_n_s__lenseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lenseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
  __pyx_k_codeobj_44 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s__fastFastqIterator, 445, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":480
 *         yield fastqParser([title,seq,'+',quality])
 * 
 * def fastFastqSangerIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_45);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));
  __pyx_k_codeobj_46 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s_47, 480, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":496
 *     return fastFastqIterator(file,'sanger')
 * 
 * def fastFastqSolexaIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_k_tuple_48 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_48);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));
  __pyx_k_codeobj_49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s_50, 496, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fastq/_fastq.pyx":512
 *     return fastFastqIterator(file,'solexa')
 * 
 * def fastFastqIlluminaIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_51);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
  __pyx_k_codeobj_52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_32, __pyx_n_s_53, 512, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_fastq(void); /*proto*/
PyMODINIT_FUNC init_fastq(void)
#else
PyMODINIT_FUNC PyInit__fastq(void); /*proto*/
PyMODINIT_FUNC PyInit__fastq(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__fastq(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_fastq"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_24), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_obitools__fastq___fastq) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_8obitools_5fastq_6_fastq_fastqParserGenetator = &__pyx_vtable_8obitools_5fastq_6_fastq_fastqParserGenetator;
  __pyx_vtable_8obitools_5fastq_6_fastq_fastqParserGenetator.errorDecoder = (PyObject *(*)(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *, PyObject *))__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorDecoder;
  __pyx_vtable_8obitools_5fastq_6_fastq_fastqParserGenetator.qualityDecoder = (PyObject *(*)(struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *, char *))__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualityDecoder;
  if (PyType_Ready(&__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator.tp_dict, __pyx_vtabptr_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "fastqParserGenetator", (PyObject *)&__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fastq_6_fastq_fastqParserGenetator = &__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator;
  __pyx_vtabptr_8obitools_5fastq_6_fastq_fastFastqParserGenetator = &__pyx_vtable_8obitools_5fastq_6_fastq_fastFastqParserGenetator;
  __pyx_vtable_8obitools_5fastq_6_fastq_fastFastqParserGenetator.__pyx_base = *__pyx_vtabptr_8obitools_5fastq_6_fastq_fastqParserGenetator;
  __pyx_type_8obitools_5fastq_6_fastq_fastFastqParserGenetator.tp_base = __pyx_ptype_8obitools_5fastq_6_fastq_fastqParserGenetator;
  if (PyType_Ready(&__pyx_type_8obitools_5fastq_6_fastq_fastFastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_8obitools_5fastq_6_fastq_fastFastqParserGenetator.tp_dict, __pyx_vtabptr_8obitools_5fastq_6_fastq_fastFastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "fastFastqParserGenetator", (PyObject *)&__pyx_type_8obitools_5fastq_6_fastq_fastFastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fastq_6_fastq_fastFastqParserGenetator = &__pyx_type_8obitools_5fastq_6_fastq_fastFastqParserGenetator;
  if (PyType_Ready(&__pyx_type_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator = &__pyx_type_8obitools_5fastq_6_fastq___pyx_scope_struct__fastqIterator;
  if (PyType_Ready(&__pyx_type_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator = &__pyx_type_8obitools_5fastq_6_fastq___pyx_scope_struct_1_fastFastqIterator;
  /*--- Type import code ---*/
  __pyx_ptype_8obitools_9_obitools_BioSequence = __Pyx_ImportType("obitools._obitools", "BioSequence", sizeof(struct __pyx_obj_8obitools_9_obitools_BioSequence), 1); if (unlikely(!__pyx_ptype_8obitools_9_obitools_BioSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_8obitools_9_obitools_BioSequence = (struct __pyx_vtabstruct_8obitools_9_obitools_BioSequence*)__Pyx_GetVtable(__pyx_ptype_8obitools_9_obitools_BioSequence->tp_dict); if (unlikely(!__pyx_vtabptr_8obitools_9_obitools_BioSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_9_obitools_NucSequence = __Pyx_ImportType("obitools._obitools", "NucSequence", sizeof(struct __pyx_obj_8obitools_9_obitools_NucSequence), 1); if (unlikely(!__pyx_ptype_8obitools_9_obitools_NucSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_8obitools_9_obitools_NucSequence = (struct __pyx_vtabstruct_8obitools_9_obitools_NucSequence*)__Pyx_GetVtable(__pyx_ptype_8obitools_9_obitools_NucSequence->tp_dict); if (unlikely(!__pyx_vtabptr_8obitools_9_obitools_NucSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_9_obitools_AASequence = __Pyx_ImportType("obitools._obitools", "AASequence", sizeof(struct __pyx_obj_8obitools_9_obitools_AASequence), 1); if (unlikely(!__pyx_ptype_8obitools_9_obitools_AASequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_8obitools_9_obitools_AASequence = (struct __pyx_vtabstruct_8obitools_9_obitools_AASequence*)__Pyx_GetVtable(__pyx_ptype_8obitools_9_obitools_AASequence->tp_dict); if (unlikely(!__pyx_vtabptr_8obitools_9_obitools_AASequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_9_obitools_WrappedBioSequence = __Pyx_ImportType("obitools._obitools", "WrappedBioSequence", sizeof(struct __pyx_obj_8obitools_9_obitools_WrappedBioSequence), 1); if (unlikely(!__pyx_ptype_8obitools_9_obitools_WrappedBioSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_8obitools_9_obitools_WrappedBioSequence = (struct __pyx_vtabstruct_8obitools_9_obitools_WrappedBioSequence*)__Pyx_GetVtable(__pyx_ptype_8obitools_9_obitools_WrappedBioSequence->tp_dict); if (unlikely(!__pyx_vtabptr_8obitools_9_obitools_WrappedBioSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_9_obitools_SubSequence = __Pyx_ImportType("obitools._obitools", "SubSequence", sizeof(struct __pyx_obj_8obitools_9_obitools_SubSequence), 1); if (unlikely(!__pyx_ptype_8obitools_9_obitools_SubSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_8obitools_9_obitools_SubSequence = (struct __pyx_vtabstruct_8obitools_9_obitools_SubSequence*)__Pyx_GetVtable(__pyx_ptype_8obitools_9_obitools_SubSequence->tp_dict); if (unlikely(!__pyx_vtabptr_8obitools_9_obitools_SubSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_9_obitools_DNAComplementSequence = __Pyx_ImportType("obitools._obitools", "DNAComplementSequence", sizeof(struct __pyx_obj_8obitools_9_obitools_DNAComplementSequence), 1); if (unlikely(!__pyx_ptype_8obitools_9_obitools_DNAComplementSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_8obitools_9_obitools_DNAComplementSequence = (struct __pyx_vtabstruct_8obitools_9_obitools_DNAComplementSequence*)__Pyx_GetVtable(__pyx_ptype_8obitools_9_obitools_DNAComplementSequence->tp_dict); if (unlikely(!__pyx_vtabptr_8obitools_9_obitools_DNAComplementSequence)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fastq_5array_array = __Pyx_ImportType("array", "array", sizeof(arrayobject), 0); if (unlikely(!__pyx_ptype_8obitools_5fastq_5array_array)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("obitools._obitools"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "__default_raw_parser", (void **)&__pyx_vp_8obitools_9_obitools___default_raw_parser, "PyObject *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Function import code ---*/
  __pyx_t_2 = __Pyx_ImportModule("obitools.fasta._fasta"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "fastParseFastaDescription", (void (**)(void))&__pyx_f_8obitools_5fasta_6_fasta_fastParseFastaDescription, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "parseFastaDescription", (void (**)(void))&__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /*--- Execution code ---*/

  /* "obitools/fastq/_fastq.pyx":17
 * from obitools._obitools cimport AASequence,NucSequence
 * 
 * from array import array             # <<<<<<<<<<<<<<
 * from obitools import bioSeqGenerator
 * from obitools.format.genericparser import genericEntryIteratorGenerator
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__array));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__array));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__array));
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__array), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__array);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "obitools/fastq/_fastq.pyx":18
 * 
 * from array import array
 * from obitools import bioSeqGenerator             # <<<<<<<<<<<<<<
 * from obitools.format.genericparser import genericEntryIteratorGenerator
 * from obitools.utils import universalOpen
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bioSeqGenerator));
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__bioSeqGenerator));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bioSeqGenerator));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__obitools), ((PyObject *)__pyx_t_4), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__bioSeqGenerator);
  if (__pyx_t_4 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__bioSeqGenerator);
    if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bioSeqGenerator, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":19
 * from array import array
 * from obitools import bioSeqGenerator
 * from obitools.format.genericparser import genericEntryIteratorGenerator             # <<<<<<<<<<<<<<
 * from obitools.utils import universalOpen
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_26));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s_26));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_26));
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s_25), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s_26);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s_26);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_26, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "obitools/fastq/_fastq.pyx":20
 * from obitools import bioSeqGenerator
 * from obitools.format.genericparser import genericEntryIteratorGenerator
 * from obitools.utils import universalOpen             # <<<<<<<<<<<<<<
 * 
 * import re
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__universalOpen));
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__universalOpen));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__universalOpen));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_27), ((PyObject *)__pyx_t_4), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__universalOpen);
  if (__pyx_t_4 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__universalOpen);
    if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__universalOpen, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":22
 * from obitools.utils import universalOpen
 * 
 * import re             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__re, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "obitools/fastq/_fastq.pyx":42
 * 
 * 
 * fastqEntryIterator=genericEntryIteratorGenerator(startEntry='^@',endEntry="^\+",strip=True,join=False)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_26); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__startEntry), ((PyObject *)__pyx_kp_s_28)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__endEntry), ((PyObject *)__pyx_kp_s_29)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__strip), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__join), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastqEntryIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":235
 *     cdef bint _errorDecoder
 * 
 *     def __init__(self,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *         self.bioseqfactory = bioseqfactory
 * 
 */
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __pyx_k_11 = ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence));
  __Pyx_GIVEREF(((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence));
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_12 = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);

  /* "obitools/fastq/_fastq.pyx":288
 *         return seq
 * 
 * def fastqIterator(file,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __pyx_k_16 = ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence));
  __Pyx_GIVEREF(((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence));
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_17 = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_19fastqIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastqIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":323
 *         yield fastqParser([title,seq,'+',quality])
 * 
 * def fastqSangerIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_19 = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_22fastqSangerIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastqSangerIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":344
 *     return fastqIterator(file,'sanger',NucSequence,tagparser)
 * 
 * def fastqSolexaIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_20 = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_24fastqSolexaIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastqSolexaIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":365
 *     return fastqIterator(file,'solexa',NucSequence,tagparser)
 * 
 * def fastqIlluminaIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_21 = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_26fastqIlluminaIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_40, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":386
 *     return fastqIterator(file,'illumina',NucSequence,tagparser)
 * 
 * def fastqAAIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_22 = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_28fastqAAIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastqAAIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":445
 *         return sseq
 * 
 * def fastFastqIterator(file,fastqvariant='sanger'):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_30fastFastqIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastFastqIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":480
 *         yield fastqParser([title,seq,'+',quality])
 * 
 * def fastFastqSangerIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_33fastFastqSangerIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_47, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":496
 *     return fastFastqIterator(file,'sanger')
 * 
 * def fastFastqSolexaIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_35fastFastqSolexaIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_50, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":512
 *     return fastFastqIterator(file,'solexa')
 * 
 * def fastFastqIlluminaIterator(file):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fastq file sequence by sequence.
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fastq_6_fastq_37fastFastqIlluminaIterator, NULL, __pyx_n_s_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_53, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fastq/_fastq.pyx":1
 * # cython: profile=True             # <<<<<<<<<<<<<<
 * 
 * '''
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "array.pxd":182
 * 
 * 
 * cdef inline void zero(array op):             # <<<<<<<<<<<<<<
 *     memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize)
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    __Pyx_AddTraceback("init obitools.fastq._fastq", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init obitools.fastq._fastq");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

#if CYTHON_PROFILE
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno) {
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        if (*code == NULL) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            PyThreadState_GET(),            /*PyThreadState *tstate*/
            *code,                          /*PyCodeObject *code*/
            PyModule_GetDict(__pyx_m),      /*PyObject *globals*/
            0                               /*PyObject *locals*/
        );
        if (*frame == NULL) return 0;
    }
    else {
        (*frame)->f_tstate = PyThreadState_GET();
    }
    return PyThreadState_GET()->c_profilefunc(PyThreadState_GET()->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyCodeObject *py_code = 0;
    #if PY_MAJOR_VERSION < 3
    py_funcname = PyString_FromString(funcname);
    py_srcfile = PyString_FromString(srcfile);
    #else
    py_funcname = PyUnicode_FromString(funcname);
    py_srcfile = PyUnicode_FromString(srcfile);
    #endif
    if (!py_funcname | !py_srcfile) goto bad;
    py_code = PyCode_New(
        0,                /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,                /*int kwonlyargcount,*/
        #endif
        0,                /*int nlocals,*/
        0,                /*int stacksize,*/
        0,                /*int flags,*/
        __pyx_empty_bytes,  /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,       /*PyObject *filename,*/
        py_funcname,      /*PyObject *name,*/
        firstlineno,      /*int firstlineno,*/
        __pyx_empty_bytes   /*PyObject *lnotab*/
    );
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return py_code;
}
#endif /* CYTHON_PROFILE */

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1) /* First char was not a digit */
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'b': return "'char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      __Pyx_BufFmt_RaiseExpected(ctx);
      return -1;
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d but %"PY_FORMAT_SIZE_T"d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count; /* Consume from buffer string */
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break; /* breaks both loops as ctx->enc_count == 0 */
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue; /* empty struct */
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        if (isspace(*ts))
            continue;
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
                return ts;
      case ' ':
      case 10:
      case 13:
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T': /* substruct */
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}': /* end of substruct; either repeat or move on */
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }        /* fall through */
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 's': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
        } else {
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_count = ctx->new_count;
          ctx->enc_packmode = ctx->new_packmode;
          ctx->enc_type = *ts;
          ctx->is_complex = got_Z;
        }
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%"PY_FORMAT_SIZE_T"d byte%s) does not match size of '%s' (%"PY_FORMAT_SIZE_T"d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_Format(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

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)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else if (PyErr_Occurred()) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
}



static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    PyObject *getbuffer_cobj;

  #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  #endif

        if (PyObject_TypeCheck(obj, __pyx_ptype_8obitools_5fastq_5array_array)) return __pyx_pw_8obitools_5fastq_5array_5array_1__getbuffer__(obj, view, flags);

  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict &&
        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
                                             "__pyx_getbuffer"))) {
        getbufferproc func;

      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
      #else
        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
      #endif
        Py_DECREF(getbuffer_cobj);
        if (!func)
            goto fail;

        return func(obj, view, flags);
    } else {
        PyErr_Clear();
    }
  #endif

    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);

#if PY_VERSION_HEX < 0x02060000
fail:
#endif

    return -1;
}

static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    PyObject *releasebuffer_cobj;

    if (!obj) return;

  #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
  #endif

        if (PyObject_TypeCheck(obj, __pyx_ptype_8obitools_5fastq_5array_array)) { __pyx_pw_8obitools_5fastq_5array_5array_3__releasebuffer__(obj, view); return; }

  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict &&
        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
                                                      "__pyx_releasebuffer"))) {
        releasebufferproc func;

      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
      #else
        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
      #endif

        Py_DECREF(releasebuffer_cobj);

        if (!func)
            goto fail;

        func(obj, view);
        return;
    } else {
        PyErr_Clear();
    }
  #endif

    goto nofail;

#if PY_VERSION_HEX < 0x02060000
fail:
#endif
    PyErr_WriteUnraisable(obj);

nofail:
    Py_DECREF(obj);
    view->obj = NULL;
}

#endif /*  PY_MAJOR_VERSION < 3 */

    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        if (!value) {
            value = PyObject_CallObject(type, NULL);
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    return;
}
#endif

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static CYTHON_INLINE
void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self)
{
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value)
{
    PyObject *retval;
    if (unlikely(self->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return NULL;
    }
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    if (value)
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback);
    else
        __Pyx_Generator_ExceptionClear(self);
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval)
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback);
    else
        __Pyx_Generator_ExceptionClear(self);
    return retval;
}
static PyObject *__Pyx_Generator_Next(PyObject *self)
{
    return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, Py_None);
}
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value)
{
    return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, value);
}
static PyObject *__Pyx_Generator_Close(PyObject *self)
{
    __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self;
    PyObject *retval;
#if PY_VERSION_HEX < 0x02050000
    PyErr_SetNone(PyExc_StopIteration);
#else
    PyErr_SetNone(PyExc_GeneratorExit);
#endif
    retval = __Pyx_Generator_SendEx(generator, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
#if PY_VERSION_HEX < 0x02050000
    if (PyErr_ExceptionMatches(PyExc_StopIteration))
#else
    if (PyErr_ExceptionMatches(PyExc_StopIteration)
        || PyErr_ExceptionMatches(PyExc_GeneratorExit))
#endif
    {
        PyErr_Clear();          /* ignore these errors */
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args)
{
    __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Generator_SendEx(generator, NULL);
}
static int
__Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg)
{
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static void
__Pyx_Generator_dealloc(PyObject *self)
{
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    PyObject_GC_Track(self);
    if (gen->resume_label > 0) {
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
            return;                     /* resurrected.  :( */
    }
    PyObject_GC_UnTrack(self);
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    PyObject_GC_Del(gen);
}
static void
__Pyx_Generator_del(PyObject *self)
{
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    if (gen->resume_label <= 0)
        return ;
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
    /* Undo the temporary resurrection; can't use DECREF here, it would
     * cause a recursive call.
     */
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0)
        return; /* this is the normal path out */
    /* close() resurrected it!  Make it look like the original Py_DECREF
     * never happened.
     */
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
     * we need to undo that. */
    _Py_DEC_REFTOTAL;
    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
     * chain, so no more to do there.
     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
     * _Py_NewReference bumped tp_allocs:  both of those need to be
     * undone.
     */
#ifdef COUNT_ALLOCS
    --self->ob_type->tp_frees;
    --self->ob_type->tp_allocs;
#endif
}
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running",
     T_INT,
     offsetof(__pyx_GeneratorObject, is_running),
     READONLY,
     NULL},
    {0, 0, 0, 0, 0}
};
static PyMethodDef __pyx_Generator_methods[] = {
    {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("generator"),         /*tp_name*/
    sizeof(__pyx_GeneratorObject),      /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    0,                                   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    0,                                  /*tp_call*/
    0,                                  /*tp_str*/
    PyObject_GenericGetAttr,            /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
    0,                                  /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
    PyObject_SelfIter,                  /*tp_iter*/
    (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
    __pyx_Generator_methods,            /*tp_methods*/
    __pyx_Generator_memberlist,         /*tp_members*/
    0,                                  /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    0,                                  /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    0,                                  /*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
    __Pyx_Generator_del,                /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static
__pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                           PyObject *closure)
{
    __pyx_GeneratorObject *gen =
        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    PyObject_GC_Track(gen);
    return gen;
}
static int __pyx_Generator_init(void)
{
    return PyType_Ready(&__pyx_GeneratorType);
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && (size_t)((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

#ifndef __PYX_HAVE_RT_ImportVoidPtr
#define __PYX_HAVE_RT_ImportVoidPtr
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, name);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%s does not export expected C variable %s",
                PyModule_GetName(module), name);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C variable %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C variable %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), name, sig, desc);
        goto bad;
    }
    *p = PyCObject_AsVoidPtr(cobj);}
#endif
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%s does not export expected C function %s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}


/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
