/* Generated by Cython 0.16 on Wed Apr 25 13:44:34 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__fasta___fasta
#define __PYX_HAVE_API__obitools__fasta___fasta
#include "strings.h"
#include "regex.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[] = {
  "_fasta.pyx",
  "_obitools.pxd",
};

/*--- 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_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator;
struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator;
struct __pyx_obj_8obitools_9_obitools_AASequence;
struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator;
struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator;
struct __pyx_obj_8obitools_9_obitools_NucSequence;
struct __pyx_obj_8obitools_9_obitools_DNAComplementSequence;
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_5fasta_6_fasta_fastaParser;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;

/* "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_defaults {
  PyObject *__pyx_arg_gbmode;
  PyObject *__pyx_arg_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/fasta/_fasta.pyx":370
 *     return '\n'.join(rep)
 * 
 * def formatSAPFastaGenerator(options):             # <<<<<<<<<<<<<<
 *     loadTaxonomyDatabase(options)
 * 
 */
struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator {
  PyObject_HEAD
  PyObject *__pyx_v_ranks;
  PyObject *__pyx_v_strict;
  PyObject *__pyx_v_taxonomy;
};


/* "obitools/fasta/_fasta.pyx":258
 *         yield fastaParser(entry,bioseqfactory,rtagparser,tagparser,joinseq)
 * 
 * def rawFastaIterator(file,bioseqfactory=None,             # <<<<<<<<<<<<<<
 *                      tagparser=__default_raw_parser,
 *                      joinseq=None):
 */
struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator {
  PyObject_HEAD
  PyObject *__pyx_v_allparser;
  PyObject *__pyx_v_bioseqfactory;
  PyObject *__pyx_v_entry;
  PyObject *__pyx_v_file;
  PyObject *__pyx_v_joinseq;
  PyObject *__pyx_v_rawparser;
  PyObject *__pyx_v_tagparser;
  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/fasta/_fasta.pyx":219
 *         yield fastFastaParser(entry,rtagparser,tagparser)
 * 
 * def fastaIterator(object file,             # <<<<<<<<<<<<<<
 *                   object bioseqfactory=None,
 *                   bytes tagparser=__default_raw_parser,
 */
struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator {
  PyObject_HEAD
  PyObject *__pyx_v_allparser;
  PyObject *__pyx_v_bioseqfactory;
  PyObject *__pyx_v_entry;
  PyObject *__pyx_v_file;
  PyObject *__pyx_v_joinseq;
  PyObject *__pyx_v_rtagparser;
  PyObject *__pyx_v_tagparser;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "obitools/fasta/_fasta.pyx":185
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)
 * 
 * def fastFastaIterator(object file,bytes tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator {
  PyObject_HEAD
  PyObject *__pyx_v_allparser;
  PyObject *__pyx_v_entry;
  PyObject *__pyx_v_file;
  PyObject *__pyx_v_rtagparser;
  PyObject *__pyx_v_tagparser;
  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;
#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 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 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 int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static PyObject* __Pyx_PyObject_PopIndex(PyObject* L, Py_ssize_t ix) {
    PyObject *r, *m, *t, *py_ix;
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02040000
    if (likely(PyList_CheckExact(L))) {
        Py_ssize_t size = PyList_GET_SIZE(L);
        if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
            if (ix < 0) {
                ix += size;
            }
            if (likely(0 <= ix && ix < size)) {
                PyObject* v = PyList_GET_ITEM(L, ix);
                Py_SIZE(L) -= 1;
                size -= 1;
                memmove(&PyList_GET_ITEM(L, ix), &PyList_GET_ITEM(L, ix+1), (size-ix)*sizeof(PyObject*));
                return v;
            }
        }
    }
#endif
    py_ix = t = NULL;
    m = __Pyx_GetAttrString(L, "pop");
    if (!m) goto bad;
    py_ix = PyInt_FromSsize_t(ix);
    if (!py_ix) goto bad;
    t = PyTuple_New(1);
    if (!t) goto bad;
    PyTuple_SET_ITEM(t, 0, py_ix);
    py_ix = NULL;
    r = PyObject_CallObject(m, t);
    Py_DECREF(m);
    Py_DECREF(t);
    return r;
bad:
    Py_XDECREF(m);
    Py_XDECREF(t);
    Py_XDECREF(py_ix);
    return NULL;
}

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_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

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

#if PY_VERSION_HEX < 0x02050000
#ifndef PyAnySet_CheckExact
#define PyAnySet_CheckExact(ob) \
    ((ob)->ob_type == &PySet_Type || \
     (ob)->ob_type == &PyFrozenSet_Type)
#define PySet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)
#define Pyx_PyFrozenSet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)
#define PySet_Size(anyset) \
    PyObject_Size((anyset))
#define PySet_Contains(anyset, key) \
    PySequence_Contains((anyset), (key))
#define PySet_Pop(set) \
    PyObject_CallMethod(set, (char *)"pop", NULL)
static CYTHON_INLINE int PySet_Clear(PyObject *set) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
#endif /* PyAnySet_CheckExact (<= Py2.4) */
#endif /* < Py2.5  */

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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

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

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/

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

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

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f) \
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f) \
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f) \
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
    int flags;
    PyObject *func_dict;
    PyObject *func_weakreflist;
    PyObject *func_name;
    PyObject *func_doc;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj; /* No-args super() class cell */
    void *defaults;
    int defaults_pyobjects;
    PyObject *defaults_tuple; /* Const defaults tuple */
    PyObject *(*defaults_getter)(PyObject *);
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, self, module, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, self, module, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *,
                                      PyMethodDef *ml, int flags,
                                      PyObject *self, PyObject *module,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static int __Pyx_CyFunction_init(void);

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 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_ExportFunction(const char *name, void (*f)(void), const char *sig); /*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._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)
static PyObject *(*__pyx_f_8obitools_9_obitools__bioSeqGenerator)(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/

/* Module declarations from 'obitools.fasta._fasta' */
static PyTypeObject *__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator = 0;
static PyTypeObject *__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator = 0;
static PyTypeObject *__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator = 0;
static PyTypeObject *__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator = 0;
static PyObject *__pyx_v_8obitools_5fasta_6_fasta__fastTagParser = 0;
static PyObject *__pyx_v_8obitools_5fasta_6_fasta__cfastTagParser = 0;
static PyObject *__pyx_f_8obitools_5fasta_6_fasta_fastaParser(PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_8obitools_5fasta_6_fasta_fastFastaParser(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
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*/
static PyObject *__pyx_f_8obitools_5fasta_6_fasta__fastaJoinSeq(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "obitools.fasta._fasta"
int __pyx_module_is_main_obitools__fasta___fasta = 0;

/* Implementation of 'obitools.fasta._fasta' */
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_parseFastaDescription(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ds, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_2fastParseFastaDescription(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ds); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_4fastFastaParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_rawparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_6fastaParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_rawparser, PyObject *__pyx_v_joinseq); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_8fastaNucParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_10fastaAAParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_12fastFastaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_15fastaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_18rawFastaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_21fastaNucIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_23fastaAAIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_25formatFasta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_gbmode, PyObject *__pyx_v_upper, PyObject *__pyx_v_restrict); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_formatSAPFasta(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_gbmode, PyObject *__pyx_v_upper, PyObject *__pyx_v_restrict); /* proto */
static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_27formatSAPFastaGenerator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_options); /* proto */
static char __pyx_k_1[] = "";
static char __pyx_k_2[] = " ";
static char __pyx_k_7[] = "\n";
static char __pyx_k_15[] = "[a-zA-Z][a-zA-Z0-9_]*";
static char __pyx_k_16[] = "( *%s)+";
static char __pyx_k_19[] = "rawFastaEntryIterator";
static char __pyx_k_24[] = "; ";
static char __pyx_k_25[] = "%s=%s";
static char __pyx_k_26[] = ";";
static char __pyx_k_27[] = "gi|%s|%s";
static char __pyx_k_28[] = "lcl|%s|";
static char __pyx_k_29[] = ">%s %s %s";
static char __pyx_k_30[] = "%s\n%s";
static char __pyx_k_31[] = "All sequence must have a taxid";
static char __pyx_k_33[] = " ;";
static char __pyx_k_34[] = " %s: %s,";
static char __pyx_k_35[] = "%s ; %s";
static char __pyx_k_36[] = ">%s%s";
static char __pyx_k_37[] = "loadTaxonomyDatabase";
static char __pyx_k_38[] = "SAP formating require indication of a taxonomy database";
static char __pyx_k_39[] = "species group";
static char __pyx_k_40[] = "species subgroup";
static char __pyx_k_44[] = "/Users/coissac/encours/OBITools/src/obitools/fasta/_fasta.pyx";
static char __pyx_k_45[] = "obitools.fasta._fasta";
static char __pyx_k_46[] = "\nfasta module provides functions to read and write sequences in fasta format.\n\n\n";
static char __pyx_k_47[] = "obitools.format.genericparser";
static char __pyx_k_48[] = "genericEntryIteratorGenerator";
static char __pyx_k_49[] = "obitools.ecopcr.options";
static char __pyx_k_50[] = "obitools.format";
static char __pyx_k_51[] = "SequenceFileIterator";
static char __pyx_k_52[] = ">";
static char __pyx_k_53[] = "\\s*>";
static char __pyx_k_54[] = "^[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;( +[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;)*";
static char __pyx_k_73[] = "formatSAPFastaGenerator";
static char __pyx_k_74[] = "fastFastaIterator (line 185)";
static char __pyx_k_75[] = "\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    @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    >>> from obitools.format.sequence.fasta import fastFastaIterator\n    >>> f = fastFastaIterator('monfichier')\n    >>> s = f.next()\n    >>> print s\n    gctagctagcatgctagcatgcta\n    >>>\n    ";
static char __pyx_k_76[] = "fastaIterator (line 219)";
static char __pyx_k_77[] = "\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    >>> from obitools.format.sequence.fasta import fastaIterator\n    >>> f = fastaIterator('monfichier')\n    >>> s = f.next()\n    >>> print s\n    gctagctagcatgctagcatgcta\n    >>>\n    ";
static char __pyx_k__r[] = "r";
static char __pyx_k__x[] = "x";
static char __pyx_k__ds[] = "ds";
static char __pyx_k__gi[] = "gi";
static char __pyx_k__id[] = "id";
static char __pyx_k__re[] = "re";
static char __pyx_k__end[] = "end";
static char __pyx_k__rep[] = "rep";
static char __pyx_k__seq[] = "seq";
static char __pyx_k__data[] = "data";
static char __pyx_k__file[] = "file";
static char __pyx_k__info[] = "info";
static char __pyx_k__join[] = "join";
static char __pyx_k__class[] = "class";
static char __pyx_k__entry[] = "entry";
static char __pyx_k__genus[] = "genus";
static char __pyx_k__group[] = "group";
static char __pyx_k__index[] = "index";
static char __pyx_k__order[] = "order";
static char __pyx_k__range[] = "range";
static char __pyx_k__ranks[] = "ranks";
static char __pyx_k__split[] = "split";
static char __pyx_k__strip[] = "strip";
static char __pyx_k__taxid[] = "taxid";
static char __pyx_k__taxon[] = "taxon";
static char __pyx_k__title[] = "title";
static char __pyx_k__trank[] = "trank";
static char __pyx_k__tribe[] = "tribe";
static char __pyx_k__upper[] = "upper";
static char __pyx_k___ranks[] = "_ranks";
static char __pyx_k__family[] = "family";
static char __pyx_k__frgseq[] = "frgseq";
static char __pyx_k__gbmode[] = "gbmode";
static char __pyx_k__phylum[] = "phylum";
static char __pyx_k__rstrip[] = "rstrip";
static char __pyx_k__search[] = "search";
static char __pyx_k__strict[] = "strict";
static char __pyx_k__xrange[] = "xrange";
static char __pyx_k__compile[] = "compile";
static char __pyx_k__joinseq[] = "joinseq";
static char __pyx_k__kingdom[] = "kingdom";
static char __pyx_k__options[] = "options";
static char __pyx_k__species[] = "species";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k___rawinfo[] = "_rawinfo";
static char __pyx_k__restrict[] = "restrict";
static char __pyx_k__sequence[] = "sequence";
static char __pyx_k__subclass[] = "subclass";
static char __pyx_k__subgenus[] = "subgenus";
static char __pyx_k__suborder[] = "suborder";
static char __pyx_k__subtribe[] = "subtribe";
static char __pyx_k__taxonomy[] = "taxonomy";
static char __pyx_k__allparser[] = "allparser";
static char __pyx_k__parvorder[] = "parvorder";
static char __pyx_k__rawparser[] = "rawparser";
static char __pyx_k__strictsap[] = "strictsap";
static char __pyx_k__subfamily[] = "subfamily";
static char __pyx_k__subphylum[] = "subphylum";
static char __pyx_k__tagparser[] = "tagparser";
static char __pyx_k__definition[] = "definition";
static char __pyx_k__infraclass[] = "infraclass";
static char __pyx_k__infraorder[] = "infraorder";
static char __pyx_k__rtagparser[] = "rtagparser";
static char __pyx_k__startEntry[] = "startEntry";
static char __pyx_k__subkingdom[] = "subkingdom";
static char __pyx_k__subspecies[] = "subspecies";
static char __pyx_k__superclass[] = "superclass";
static char __pyx_k__supergenus[] = "supergenus";
static char __pyx_k__superorder[] = "superorder";
static char __pyx_k__supertribe[] = "supertribe";
static char __pyx_k__fastaParser[] = "fastaParser";
static char __pyx_k__formatFasta[] = "formatFasta";
static char __pyx_k__superfamily[] = "superfamily";
static char __pyx_k__superphylum[] = "superphylum";
static char __pyx_k__rawiteritems[] = "rawiteritems";
static char __pyx_k__superkingdom[] = "superkingdom";
static char __pyx_k__bioseqfactory[] = "bioseqfactory";
static char __pyx_k__fastaAAParser[] = "fastaAAParser";
static char __pyx_k__fastaIterator[] = "fastaIterator";
static char __pyx_k__AssertionError[] = "AssertionError";
static char __pyx_k__fastaNucParser[] = "fastaNucParser";
static char __pyx_k__formatSAPFasta[] = "formatSAPFasta";
static char __pyx_k__getTaxonAtRank[] = "getTaxonAtRank";
static char __pyx_k__fastaAAIterator[] = "fastaAAIterator";
static char __pyx_k__getPreferedName[] = "getPreferedName";
static char __pyx_k__fastaNucIterator[] = "fastaNucIterator";
static char __pyx_k__rawFastaIterator[] = "rawFastaIterator";
static char __pyx_k__fastFastaIterator[] = "fastFastaIterator";
static char __pyx_k__fastaEntryIterator[] = "fastaEntryIterator";
static PyObject *__pyx_kp_b_1;
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_b_15;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_n_s_19;
static PyObject *__pyx_kp_b_2;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_35;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_n_s_37;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_n_s_45;
static PyObject *__pyx_n_s_47;
static PyObject *__pyx_n_s_48;
static PyObject *__pyx_n_s_49;
static PyObject *__pyx_n_s_50;
static PyObject *__pyx_n_s_51;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_kp_b_54;
static PyObject *__pyx_kp_b_7;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_n_s_73;
static PyObject *__pyx_kp_u_74;
static PyObject *__pyx_kp_u_75;
static PyObject *__pyx_kp_u_76;
static PyObject *__pyx_kp_u_77;
static PyObject *__pyx_n_s__AssertionError;
static PyObject *__pyx_n_s__KeyError;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___ranks;
static PyObject *__pyx_n_s___rawinfo;
static PyObject *__pyx_n_s__allparser;
static PyObject *__pyx_n_s__bioseqfactory;
static PyObject *__pyx_n_s__class;
static PyObject *__pyx_n_s__compile;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__definition;
static PyObject *__pyx_n_s__ds;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__entry;
static PyObject *__pyx_n_s__family;
static PyObject *__pyx_n_s__fastFastaIterator;
static PyObject *__pyx_n_s__fastaAAIterator;
static PyObject *__pyx_n_s__fastaAAParser;
static PyObject *__pyx_n_s__fastaEntryIterator;
static PyObject *__pyx_n_s__fastaIterator;
static PyObject *__pyx_n_s__fastaNucIterator;
static PyObject *__pyx_n_s__fastaNucParser;
static PyObject *__pyx_n_s__fastaParser;
static PyObject *__pyx_n_s__file;
static PyObject *__pyx_n_s__formatFasta;
static PyObject *__pyx_n_s__formatSAPFasta;
static PyObject *__pyx_n_s__frgseq;
static PyObject *__pyx_n_s__gbmode;
static PyObject *__pyx_n_s__genus;
static PyObject *__pyx_n_s__getPreferedName;
static PyObject *__pyx_n_s__getTaxonAtRank;
static PyObject *__pyx_n_s__gi;
static PyObject *__pyx_n_s__group;
static PyObject *__pyx_n_s__id;
static PyObject *__pyx_n_s__index;
static PyObject *__pyx_n_s__info;
static PyObject *__pyx_n_s__infraclass;
static PyObject *__pyx_n_s__infraorder;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__joinseq;
static PyObject *__pyx_n_s__kingdom;
static PyObject *__pyx_n_s__options;
static PyObject *__pyx_n_s__order;
static PyObject *__pyx_n_s__parvorder;
static PyObject *__pyx_n_s__phylum;
static PyObject *__pyx_n_s__r;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__ranks;
static PyObject *__pyx_n_s__rawFastaIterator;
static PyObject *__pyx_n_s__rawiteritems;
static PyObject *__pyx_n_s__rawparser;
static PyObject *__pyx_n_s__re;
static PyObject *__pyx_n_s__rep;
static PyObject *__pyx_n_s__restrict;
static PyObject *__pyx_n_s__rstrip;
static PyObject *__pyx_n_s__rtagparser;
static PyObject *__pyx_n_s__search;
static PyObject *__pyx_n_s__seq;
static PyObject *__pyx_n_s__sequence;
static PyObject *__pyx_n_s__species;
static PyObject *__pyx_n_s__split;
static PyObject *__pyx_n_s__startEntry;
static PyObject *__pyx_n_s__strict;
static PyObject *__pyx_n_s__strictsap;
static PyObject *__pyx_n_s__strip;
static PyObject *__pyx_n_s__subclass;
static PyObject *__pyx_n_s__subfamily;
static PyObject *__pyx_n_s__subgenus;
static PyObject *__pyx_n_s__subkingdom;
static PyObject *__pyx_n_s__suborder;
static PyObject *__pyx_n_s__subphylum;
static PyObject *__pyx_n_s__subspecies;
static PyObject *__pyx_n_s__subtribe;
static PyObject *__pyx_n_s__superclass;
static PyObject *__pyx_n_s__superfamily;
static PyObject *__pyx_n_s__supergenus;
static PyObject *__pyx_n_s__superkingdom;
static PyObject *__pyx_n_s__superorder;
static PyObject *__pyx_n_s__superphylum;
static PyObject *__pyx_n_s__supertribe;
static PyObject *__pyx_n_s__tagparser;
static PyObject *__pyx_n_s__taxid;
static PyObject *__pyx_n_s__taxon;
static PyObject *__pyx_n_s__taxonomy;
static PyObject *__pyx_n_s__title;
static PyObject *__pyx_n_s__trank;
static PyObject *__pyx_n_s__tribe;
static PyObject *__pyx_n_s__upper;
static PyObject *__pyx_n_s__x;
static PyObject *__pyx_n_s__xrange;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_60;
static PyObject *__pyx_k_12;
static PyObject *__pyx_k_13;
static PyObject *__pyx_k_14;
static PyObject *__pyx_k_17;
static PyObject *__pyx_k_18;
static PyObject *__pyx_k_20;
static PyObject *__pyx_k_21;
static PyObject *__pyx_k_22;
static PyObject *__pyx_k_23;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_5;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_11;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_57;
static PyObject *__pyx_k_tuple_59;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_63;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_69;
static PyObject *__pyx_k_tuple_71;
static PyObject *__pyx_k_codeobj_43;
static PyObject *__pyx_k_codeobj_56;
static PyObject *__pyx_k_codeobj_58;
static PyObject *__pyx_k_codeobj_60;
static PyObject *__pyx_k_codeobj_62;
static PyObject *__pyx_k_codeobj_64;
static PyObject *__pyx_k_codeobj_66;
static PyObject *__pyx_k_codeobj_68;
static PyObject *__pyx_k_codeobj_70;
static PyObject *__pyx_k_codeobj_72;

/* "obitools/fasta/_fasta.pyx":47
 * rawFastaEntryIterator=genericEntryIteratorGenerator(startEntry='\s*>')
 * 
 * cdef bytes _fastaJoinSeq(list seqarray):             # <<<<<<<<<<<<<<
 *     return  b''.join([x.strip() for x in seqarray])
 * 
 */

static PyObject *__pyx_f_8obitools_5fasta_6_fasta__fastaJoinSeq(PyObject *__pyx_v_seqarray) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("_fastaJoinSeq", 0);
  __Pyx_TraceCall("_fastaJoinSeq", __pyx_f[0], 47);

  /* "obitools/fasta/_fasta.pyx":48
 * 
 * cdef bytes _fastaJoinSeq(list seqarray):
 *     return  b''.join([x.strip() for x in seqarray])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_b_1), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(((PyObject *)__pyx_v_seqarray) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_3 = ((PyObject *)__pyx_v_seqarray); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__strip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("obitools.fasta._fasta._fastaJoinSeq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":51
 * 
 * 
 * cpdef tuple parseFastaDescription(bytes ds, object tagparser):             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes  definition
 */

static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_1parseFastaDescription(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription(PyObject *__pyx_v_ds, PyObject *__pyx_v_tagparser, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_definition = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("parseFastaDescription", 0);
  __Pyx_TraceCall("parseFastaDescription", __pyx_f[0], 51);
  __Pyx_INCREF(__pyx_v_ds);

  /* "obitools/fasta/_fasta.pyx":57
 *     cdef object m
 * 
 *     ds = b' '+ds             # <<<<<<<<<<<<<<
 *     m = tagparser.search(ds)
 * 
 */
  __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_b_2), ((PyObject *)__pyx_v_ds)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_v_ds));
  __pyx_v_ds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":58
 * 
 *     ds = b' '+ds
 *     m = tagparser.search(ds)             # <<<<<<<<<<<<<<
 * 
 *     if m is not None:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_tagparser, __pyx_n_s__search); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_ds));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ds));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ds));
  __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 = 58; __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_v_m = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fasta/_fasta.pyx":60
 *     m = tagparser.search(ds)
 * 
 *     if m is not None:             # <<<<<<<<<<<<<<
 *         info=m.group(0)
 *         definition = ds[m.end(0):].rstrip()
 */
  __pyx_t_4 = (__pyx_v_m != Py_None);
  if (__pyx_t_4) {

    /* "obitools/fasta/_fasta.pyx":61
 * 
 *     if m is not None:
 *         info=m.group(0)             # <<<<<<<<<<<<<<
 *         definition = ds[m.end(0):].rstrip()
 *     else:
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_m, __pyx_n_s__group); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_info = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "obitools/fasta/_fasta.pyx":62
 *     if m is not None:
 *         info=m.group(0)
 *         definition = ds[m.end(0):].rstrip()             # <<<<<<<<<<<<<<
 *     else:
 *         info=None
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_m, __pyx_n_s__end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_ds), __pyx_t_5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_t_3), __pyx_n_s__rstrip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_definition = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "obitools/fasta/_fasta.pyx":64
 *         definition = ds[m.end(0):].rstrip()
 *     else:
 *         info=None             # <<<<<<<<<<<<<<
 *         definition=ds
 * 
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_info = ((PyObject*)Py_None);

    /* "obitools/fasta/_fasta.pyx":65
 *     else:
 *         info=None
 *         definition=ds             # <<<<<<<<<<<<<<
 * 
 *     return definition,info
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_ds));
    __pyx_v_definition = __pyx_v_ds;
  }
  __pyx_L3:;

  /* "obitools/fasta/_fasta.pyx":67
 *         definition=ds
 * 
 *     return definition,info             # <<<<<<<<<<<<<<
 * 
 * cdef bytes  _fastTagParser=b'^[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;( +[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;)*'
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_definition));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_definition));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_definition));
  __Pyx_INCREF(((PyObject *)__pyx_v_info));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_info));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_info));
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fasta._fasta.parseFastaDescription", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_ds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_1parseFastaDescription(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_1parseFastaDescription(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ds = 0;
  PyObject *__pyx_v_tagparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ds,&__pyx_n_s__tagparser,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parseFastaDescription (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__ds);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("parseFastaDescription", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parseFastaDescription") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_ds = ((PyObject*)values[0]);
    __pyx_v_tagparser = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parseFastaDescription", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.parseFastaDescription", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ds), (&PyBytes_Type), 1, "ds", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_parseFastaDescription(__pyx_self, __pyx_v_ds, __pyx_v_tagparser);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":51
 * 
 * 
 * cpdef tuple parseFastaDescription(bytes ds, object tagparser):             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes  definition
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_parseFastaDescription(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ds, PyObject *__pyx_v_tagparser) {
  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("parseFastaDescription", 0);
  __Pyx_TraceCall("parseFastaDescription", __pyx_f[0], 51);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription(__pyx_v_ds, __pyx_v_tagparser, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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.fasta._fasta.parseFastaDescription", __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/fasta/_fasta.pyx":75
 * #cdef int     regerror=regcomp(&cfastTagParser, fastTagParser, REG_EXTENDED)
 * 
 * cpdef tuple fastParseFastaDescription(bytes ds):             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes  definition
 */

static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_3fastParseFastaDescription(PyObject *__pyx_self, PyObject *__pyx_v_ds); /*proto*/
static PyObject *__pyx_f_8obitools_5fasta_6_fasta_fastParseFastaDescription(PyObject *__pyx_v_ds, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_definition = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_m = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastParseFastaDescription", 0);
  __Pyx_TraceCall("fastParseFastaDescription", __pyx_f[0], 75);

  /* "obitools/fasta/_fasta.pyx":81
 *     cdef object m
 * 
 *     m = _cfastTagParser.search(ds)             # <<<<<<<<<<<<<<
 * 
 *     if m is not None:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_8obitools_5fasta_6_fasta__cfastTagParser, __pyx_n_s__search); 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_ds));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ds));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ds));
  __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 = 81; __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_v_m = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fasta/_fasta.pyx":83
 *     m = _cfastTagParser.search(ds)
 * 
 *     if m is not None:             # <<<<<<<<<<<<<<
 *         info=m.group(0)
 *         definition = ds[m.end(0):].rstrip()
 */
  __pyx_t_4 = (__pyx_v_m != Py_None);
  if (__pyx_t_4) {

    /* "obitools/fasta/_fasta.pyx":84
 * 
 *     if m is not None:
 *         info=m.group(0)             # <<<<<<<<<<<<<<
 *         definition = ds[m.end(0):].rstrip()
 *     else:
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_m, __pyx_n_s__group); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_info = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "obitools/fasta/_fasta.pyx":85
 *     if m is not None:
 *         info=m.group(0)
 *         definition = ds[m.end(0):].rstrip()             # <<<<<<<<<<<<<<
 *     else:
 *         info=None
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_m, __pyx_n_s__end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_ds), __pyx_t_5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_t_3), __pyx_n_s__rstrip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_definition = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "obitools/fasta/_fasta.pyx":87
 *         definition = ds[m.end(0):].rstrip()
 *     else:
 *         info=None             # <<<<<<<<<<<<<<
 *         definition=ds
 * 
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_info = ((PyObject*)Py_None);

    /* "obitools/fasta/_fasta.pyx":88
 *     else:
 *         info=None
 *         definition=ds             # <<<<<<<<<<<<<<
 * 
 *     return definition,info
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_ds));
    __pyx_v_definition = __pyx_v_ds;
  }
  __pyx_L3:;

  /* "obitools/fasta/_fasta.pyx":90
 *         definition=ds
 * 
 *     return definition,info             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_definition));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_definition));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_definition));
  __Pyx_INCREF(((PyObject *)__pyx_v_info));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_info));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_info));
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("obitools.fasta._fasta.fastParseFastaDescription", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_3fastParseFastaDescription(PyObject *__pyx_self, PyObject *__pyx_v_ds); /*proto*/
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_3fastParseFastaDescription(PyObject *__pyx_self, PyObject *__pyx_v_ds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastParseFastaDescription (wrapper)", 0);
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ds), (&PyBytes_Type), 1, "ds", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_2fastParseFastaDescription(__pyx_self, ((PyObject*)__pyx_v_ds));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":75
 * #cdef int     regerror=regcomp(&cfastTagParser, fastTagParser, REG_EXTENDED)
 * 
 * cpdef tuple fastParseFastaDescription(bytes ds):             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes  definition
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_2fastParseFastaDescription(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ds) {
  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("fastParseFastaDescription", 0);
  __Pyx_TraceCall("fastParseFastaDescription", __pyx_f[0], 75);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fasta_6_fasta_fastParseFastaDescription(__pyx_v_ds, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __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.fasta._fasta.fastParseFastaDescription", __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/fasta/_fasta.pyx":94
 * 
 * 
 * cpdef object fastFastaParser(bytes  seq,             # <<<<<<<<<<<<<<
 *                              object tagparser,
 *                              bytes  rawparser):
 */

static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_5fastFastaParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_8obitools_5fasta_6_fasta_fastFastaParser(PyObject *__pyx_v_seq, CYTHON_UNUSED PyObject *__pyx_v_tagparser, PyObject *__pyx_v_rawparser, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_lseq = 0;
  PyObject *__pyx_v_title = 0;
  PyObject *__pyx_v_id = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_definition = NULL;
  PyObject *__pyx_v_x = 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastFastaParser", 0);
  __Pyx_TraceCall("fastFastaParser", __pyx_f[0], 94);
  __Pyx_INCREF(__pyx_v_seq);

  /* "obitools/fasta/_fasta.pyx":117
 *     @return: a C{BioSequence} instance
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')             # <<<<<<<<<<<<<<
 *     cdef list  title = lseq.pop(0).split(None,1)
 *     cdef bytes id    = title[0][1:]
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_seq), __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lseq = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fasta/_fasta.pyx":118
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')
 *     cdef list  title = lseq.pop(0).split(None,1)             # <<<<<<<<<<<<<<
 *     cdef bytes id    = title[0][1:]
 *     cdef bytes defintion,info
 */
  __pyx_t_2 = __Pyx_PyObject_PopIndex(((PyObject *)__pyx_v_lseq), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __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 = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_title = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fasta/_fasta.pyx":119
 *     cdef list  lseq  = seq.split(b'\n')
 *     cdef list  title = lseq.pop(0).split(None,1)
 *     cdef bytes id    = title[0][1:]             # <<<<<<<<<<<<<<
 *     cdef bytes defintion,info
 * 
 */
  __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 = 119; __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 = 119; __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":122
 *     cdef bytes defintion,info
 * 
 *     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 = 122; __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/fasta/_fasta.pyx":123
 * 
 *     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 = 123; __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 = 123; __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 = 123; __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 = 123; __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 = 123; __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 = 123; __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/fasta/_fasta.pyx":125
 *         definition,info=fastParseFastaDescription(title[1])
 *     else:
 *         info= None             # <<<<<<<<<<<<<<
 *         definition=None
 * 
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_info = ((PyObject*)Py_None);

    /* "obitools/fasta/_fasta.pyx":126
 *     else:
 *         info= None
 *         definition=None             # <<<<<<<<<<<<<<
 * 
 *     seq=b''.join([x.rstrip() for x in lseq])
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_definition = Py_None;
  }
  __pyx_L3:;

  /* "obitools/fasta/_fasta.pyx":128
 *         definition=None
 * 
 *     seq=b''.join([x.rstrip() for x in lseq])             # <<<<<<<<<<<<<<
 * 
 *     return _bioSeqGenerator(id, seq, definition,info,rawparser,{})
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_b_1), __pyx_n_s__join); 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_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(((PyObject *)__pyx_v_lseq) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_lseq); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++;
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__rstrip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  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 = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_v_seq));
  __pyx_v_seq = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":130
 *     seq=b''.join([x.rstrip() for x in lseq])
 * 
 *     return _bioSeqGenerator(id, seq, definition,info,rawparser,{})             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyBytes_CheckExact(__pyx_v_definition))||((__pyx_v_definition) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_definition)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __pyx_v_definition;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __pyx_f_8obitools_9_obitools__bioSeqGenerator(__pyx_v_id, __pyx_v_seq, ((PyObject*)__pyx_t_5), __pyx_v_info, __pyx_v_rawparser, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("obitools.fasta._fasta.fastFastaParser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lseq);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_XDECREF(__pyx_v_id);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_5fastFastaParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_4fastFastaParser[] = "\n    Parse a fasta record.\n    \n    @attention: internal purpose function\n    \n    @param seq: a sequence object containing all lines corresponding\n                to one fasta sequence\n    @type seq: C{list} or C{tuple} of C{str}\n    \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: a C{BioSequence} instance   \n    ";
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_5fastFastaParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_tagparser = 0;
  PyObject *__pyx_v_rawparser = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seq,&__pyx_n_s__tagparser,&__pyx_n_s__rawparser,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastFastaParser (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__seq);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fastFastaParser", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rawparser);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fastFastaParser", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastFastaParser") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_seq = ((PyObject*)values[0]);
    __pyx_v_tagparser = values[1];
    __pyx_v_rawparser = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastFastaParser", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastFastaParser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rawparser), (&PyBytes_Type), 1, "rawparser", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_4fastFastaParser(__pyx_self, __pyx_v_seq, __pyx_v_tagparser, __pyx_v_rawparser);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":94
 * 
 * 
 * cpdef object fastFastaParser(bytes  seq,             # <<<<<<<<<<<<<<
 *                              object tagparser,
 *                              bytes  rawparser):
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_4fastFastaParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_rawparser) {
  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("fastFastaParser", 0);
  __Pyx_TraceCall("fastFastaParser", __pyx_f[0], 94);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8obitools_5fasta_6_fasta_fastFastaParser(__pyx_v_seq, __pyx_v_tagparser, __pyx_v_rawparser, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_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.fasta._fasta.fastFastaParser", __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/fasta/_fasta.pyx":133
 * 
 * 
 * cpdef object fastaParser(bytes  seq,             # <<<<<<<<<<<<<<
 *                          object bioseqfactory,
 *                          object tagparser,
 */

static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_7fastaParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_8obitools_5fasta_6_fasta_fastaParser(PyObject *__pyx_v_seq, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_rawparser, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser *__pyx_optional_args) {

  /* "obitools/fasta/_fasta.pyx":137
 *                          object tagparser,
 *                          bytes  rawparser,
 *                          object joinseq=None):             # <<<<<<<<<<<<<<
 *     '''
 *     Parse a fasta record.
 */
  PyObject *__pyx_v_joinseq = ((PyObject *)Py_None);
  PyObject *__pyx_v_lseq = 0;
  PyObject *__pyx_v_title = 0;
  PyObject *__pyx_v_id = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_definition = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastaParser", 0);
  __Pyx_TraceCall("fastaParser", __pyx_f[0], 133);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_joinseq = __pyx_optional_args->joinseq;
    }
  }
  __Pyx_INCREF(__pyx_v_seq);

  /* "obitools/fasta/_fasta.pyx":158
 *     @return: a C{BioSequence} instance
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')             # <<<<<<<<<<<<<<
 *     cdef list  title = lseq.pop(0).split(None,1)
 *     cdef bytes id    = title[0][1:]
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_seq), __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_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 = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lseq = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fasta/_fasta.pyx":159
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')
 *     cdef list  title = lseq.pop(0).split(None,1)             # <<<<<<<<<<<<<<
 *     cdef bytes id    = title[0][1:]
 *     cdef bytes defintion,info
 */
  __pyx_t_2 = __Pyx_PyObject_PopIndex(((PyObject *)__pyx_v_lseq), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __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 = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_title = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "obitools/fasta/_fasta.pyx":160
 *     cdef list  lseq  = seq.split(b'\n')
 *     cdef list  title = lseq.pop(0).split(None,1)
 *     cdef bytes id    = title[0][1:]             # <<<<<<<<<<<<<<
 *     cdef bytes defintion,info
 * 
 */
  __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 = 160; __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 = 160; __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 = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":163
 *     cdef bytes defintion,info
 * 
 *     if len(title) == 2:             # <<<<<<<<<<<<<<
 *         definition,info=parseFastaDescription(title[1], tagparser)
 *     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 = 163; __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/fasta/_fasta.pyx":164
 * 
 *     if len(title) == 2:
 *         definition,info=parseFastaDescription(title[1], tagparser)             # <<<<<<<<<<<<<<
 *     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 = 164; __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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription(((PyObject*)__pyx_t_1), __pyx_v_tagparser, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_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 = 164; __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 = 164; __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 = 164; __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/fasta/_fasta.pyx":166
 *         definition,info=parseFastaDescription(title[1], tagparser)
 *     else:
 *         info= None             # <<<<<<<<<<<<<<
 *         definition=None
 * 
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_info = ((PyObject*)Py_None);

    /* "obitools/fasta/_fasta.pyx":167
 *     else:
 *         info= None
 *         definition=None             # <<<<<<<<<<<<<<
 * 
 *     if joinseq is None:
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_definition = Py_None;
  }
  __pyx_L3:;

  /* "obitools/fasta/_fasta.pyx":169
 *         definition=None
 * 
 *     if joinseq is None:             # <<<<<<<<<<<<<<
 *         seq=_fastaJoinSeq(lseq)
 *     else:
 */
  __pyx_t_4 = (__pyx_v_joinseq == Py_None);
  if (__pyx_t_4) {

    /* "obitools/fasta/_fasta.pyx":170
 * 
 *     if joinseq is None:
 *         seq=_fastaJoinSeq(lseq)             # <<<<<<<<<<<<<<
 *     else:
 *         seq=joinseq(lseq)
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fasta_6_fasta__fastaJoinSeq(__pyx_v_lseq)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_v_seq));
    __pyx_v_seq = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "obitools/fasta/_fasta.pyx":172
 *         seq=_fastaJoinSeq(lseq)
 *     else:
 *         seq=joinseq(lseq)             # <<<<<<<<<<<<<<
 * 
 *     if bioseqfactory is None:
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_lseq));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_lseq));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_lseq));
    __pyx_t_5 = PyObject_Call(__pyx_v_joinseq, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    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 = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_seq));
    __pyx_v_seq = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L4:;

  /* "obitools/fasta/_fasta.pyx":174
 *         seq=joinseq(lseq)
 * 
 *     if bioseqfactory is None:             # <<<<<<<<<<<<<<
 *         return _bioSeqGenerator(id, seq, definition,info,rawparser,{})
 *     else:
 */
  __pyx_t_4 = (__pyx_v_bioseqfactory == Py_None);
  if (__pyx_t_4) {

    /* "obitools/fasta/_fasta.pyx":175
 * 
 *     if bioseqfactory is None:
 *         return _bioSeqGenerator(id, seq, definition,info,rawparser,{})             # <<<<<<<<<<<<<<
 *     else:
 *         return bioseqfactory(id, seq, definition,info,rawparser)
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(PyBytes_CheckExact(__pyx_v_definition))||((__pyx_v_definition) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_definition)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_v_definition;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = __pyx_f_8obitools_9_obitools__bioSeqGenerator(__pyx_v_id, __pyx_v_seq, ((PyObject*)__pyx_t_5), __pyx_v_info, __pyx_v_rawparser, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "obitools/fasta/_fasta.pyx":177
 *         return _bioSeqGenerator(id, seq, definition,info,rawparser,{})
 *     else:
 *         return bioseqfactory(id, seq, definition,info,rawparser)             # <<<<<<<<<<<<<<
 * 
 * def fastaNucParser(seq,tagparser=__default_raw_parser,joinseq=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __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_seq));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_seq));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_seq));
    __Pyx_INCREF(__pyx_v_definition);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_definition);
    __Pyx_GIVEREF(__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(((PyObject *)__pyx_v_rawparser));
    PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_rawparser));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_rawparser));
    __pyx_t_2 = PyObject_Call(__pyx_v_bioseqfactory, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __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.fasta._fasta.fastaParser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lseq);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_XDECREF(__pyx_v_id);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_7fastaParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_6fastaParser[] = "\n    Parse a fasta record.\n    \n    @attention: internal purpose function\n    \n    @param seq: a sequence object containing all lines corresponding\n                to one fasta sequence\n    @type seq: C{list} or C{tuple} of C{str}\n    \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: a C{BioSequence} instance   \n    ";
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_7fastaParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_bioseqfactory = 0;
  PyObject *__pyx_v_tagparser = 0;
  PyObject *__pyx_v_rawparser = 0;
  PyObject *__pyx_v_joinseq = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seq,&__pyx_n_s__bioseqfactory,&__pyx_n_s__tagparser,&__pyx_n_s__rawparser,&__pyx_n_s__joinseq,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastaParser (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};

    /* "obitools/fasta/_fasta.pyx":137
 *                          object tagparser,
 *                          bytes  rawparser,
 *                          object joinseq=None):             # <<<<<<<<<<<<<<
 *     '''
 *     Parse a fasta record.
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      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;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bioseqfactory);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fastaParser", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tagparser);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fastaParser", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rawparser);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fastaParser", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__joinseq);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastaParser") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_seq = ((PyObject*)values[0]);
    __pyx_v_bioseqfactory = values[1];
    __pyx_v_tagparser = values[2];
    __pyx_v_rawparser = ((PyObject*)values[3]);
    __pyx_v_joinseq = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastaParser", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaParser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seq), (&PyBytes_Type), 1, "seq", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rawparser), (&PyBytes_Type), 1, "rawparser", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_6fastaParser(__pyx_self, __pyx_v_seq, __pyx_v_bioseqfactory, __pyx_v_tagparser, __pyx_v_rawparser, __pyx_v_joinseq);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":133
 * 
 * 
 * cpdef object fastaParser(bytes  seq,             # <<<<<<<<<<<<<<
 *                          object bioseqfactory,
 *                          object tagparser,
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_6fastaParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_rawparser, PyObject *__pyx_v_joinseq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastaParser", 0);
  __Pyx_TraceCall("fastaParser", __pyx_f[0], 133);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.joinseq = __pyx_v_joinseq;
  __pyx_t_1 = __pyx_f_8obitools_5fasta_6_fasta_fastaParser(__pyx_v_seq, __pyx_v_bioseqfactory, __pyx_v_tagparser, __pyx_v_rawparser, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_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.fasta._fasta.fastaParser", __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_5fasta_6_fasta_9fastaNucParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_9fastaNucParser = {__Pyx_NAMESTR("fastaNucParser"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_9fastaNucParser, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_9fastaNucParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_tagparser = 0;
  PyObject *__pyx_v_joinseq = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seq,&__pyx_n_s__tagparser,&__pyx_n_s__joinseq,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastaNucParser (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_12;

    /* "obitools/fasta/_fasta.pyx":179
 *         return bioseqfactory(id, seq, definition,info,rawparser)
 * 
 * def fastaNucParser(seq,tagparser=__default_raw_parser,joinseq=None):             # <<<<<<<<<<<<<<
 *     return fastaParser(seq,NucSequence,tagparser=tagparser,joinseq=joinseq)
 * 
 */
    values[2] = ((PyObject *)Py_None);
    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__seq);
        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--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__joinseq);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastaNucParser") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_seq = values[0];
    __pyx_v_tagparser = values[1];
    __pyx_v_joinseq = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastaNucParser", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaNucParser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_8fastaNucParser(__pyx_self, __pyx_v_seq, __pyx_v_tagparser, __pyx_v_joinseq);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_8fastaNucParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastaNucParser", 0);
  __Pyx_TraceCall("fastaNucParser", __pyx_f[0], 179);

  /* "obitools/fasta/_fasta.pyx":180
 * 
 * def fastaNucParser(seq,tagparser=__default_raw_parser,joinseq=None):
 *     return fastaParser(seq,NucSequence,tagparser=tagparser,joinseq=joinseq)             # <<<<<<<<<<<<<<
 * 
 * def fastaAAParser(seq,tagparser=__default_raw_parser,joinseq=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastaParser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__tagparser), __pyx_v_tagparser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__joinseq), __pyx_v_joinseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaNucParser", __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_5fasta_6_fasta_11fastaAAParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_11fastaAAParser = {__Pyx_NAMESTR("fastaAAParser"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_11fastaAAParser, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_11fastaAAParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_tagparser = 0;
  PyObject *__pyx_v_joinseq = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seq,&__pyx_n_s__tagparser,&__pyx_n_s__joinseq,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastaAAParser (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_13;

    /* "obitools/fasta/_fasta.pyx":182
 *     return fastaParser(seq,NucSequence,tagparser=tagparser,joinseq=joinseq)
 * 
 * def fastaAAParser(seq,tagparser=__default_raw_parser,joinseq=None):             # <<<<<<<<<<<<<<
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)
 * 
 */
    values[2] = ((PyObject *)Py_None);
    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__seq);
        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--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__joinseq);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastaAAParser") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_seq = values[0];
    __pyx_v_tagparser = values[1];
    __pyx_v_joinseq = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastaAAParser", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaAAParser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_10fastaAAParser(__pyx_self, __pyx_v_seq, __pyx_v_tagparser, __pyx_v_joinseq);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_10fastaAAParser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("fastaAAParser", 0);
  __Pyx_TraceCall("fastaAAParser", __pyx_f[0], 182);

  /* "obitools/fasta/_fasta.pyx":183
 * 
 * def fastaAAParser(seq,tagparser=__default_raw_parser,joinseq=None):
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)             # <<<<<<<<<<<<<<
 * 
 * def fastFastaIterator(object file,bytes tagparser=__default_raw_parser):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastaParser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __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 = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_AASequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_AASequence)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_AASequence)));
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__tagparser), __pyx_v_tagparser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__joinseq), __pyx_v_joinseq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaAAParser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8obitools_5fasta_6_fasta_14generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_13fastFastaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_12fastFastaIterator[] = "\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    @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    >>> from obitools.format.sequence.fasta import fastFastaIterator\n    >>> f = fastFastaIterator('monfichier')\n    >>> s = f.next()\n    >>> print s\n    gctagctagcatgctagcatgcta\n    >>>\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_13fastFastaIterator = {__Pyx_NAMESTR("fastFastaIterator"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_13fastFastaIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_12fastFastaIterator)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_13fastFastaIterator(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("fastFastaIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_14;
    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, "fastFastaIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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 = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastFastaIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastFastaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tagparser), (&PyBytes_Type), 1, "tagparser", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_12fastFastaIterator(__pyx_self, __pyx_v_file, __pyx_v_tagparser);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":185
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)
 * 
 * def fastFastaIterator(object file,bytes tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_12fastFastaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_tagparser) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *__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("fastFastaIterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *)__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator->tp_new(__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_TraceCall("fastFastaIterator", __pyx_f[0], 185);
  __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_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_5fasta_6_fasta_14generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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.fasta._fasta.fastFastaIterator", __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_5fasta_6_fasta_14generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *__pyx_cur_scope = ((struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *)__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 *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_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 = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":212
 *     >>>
 *     '''
 *     cdef bytes allparser = tagparser % b'[a-zA-Z][a-zA-Z0-9_]*'             # <<<<<<<<<<<<<<
 * 
 *     rtagparser = re.compile('( *%s)+' % allparser)
 */
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_cur_scope->__pyx_v_tagparser), ((PyObject *)__pyx_kp_b_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_cur_scope->__pyx_v_allparser = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":214
 *     cdef bytes allparser = tagparser % b'[a-zA-Z][a-zA-Z0-9_]*'
 * 
 *     rtagparser = re.compile('( *%s)+' % allparser)             # <<<<<<<<<<<<<<
 * 
 *     for entry in fastaEntryIterator(file):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __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 = 214; __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_16), ((PyObject *)__pyx_cur_scope->__pyx_v_allparser)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __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 = 214; __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 = 214; __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_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_rtagparser = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":216
 *     rtagparser = re.compile('( *%s)+' % allparser)
 * 
 *     for entry in fastaEntryIterator(file):             # <<<<<<<<<<<<<<
 *         yield fastFastaParser(entry,rtagparser,tagparser)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastaEntryIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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/fasta/_fasta.pyx":217
 * 
 *     for entry in fastaEntryIterator(file):
 *         yield fastFastaParser(entry,rtagparser,tagparser)             # <<<<<<<<<<<<<<
 * 
 * def fastaIterator(object file,
 */
    if (!(likely(PyBytes_CheckExact(__pyx_cur_scope->__pyx_v_entry))||((__pyx_cur_scope->__pyx_v_entry) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_cur_scope->__pyx_v_entry)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_entry;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_f_8obitools_5fasta_6_fasta_fastFastaParser(((PyObject*)__pyx_t_2), __pyx_cur_scope->__pyx_v_rtagparser, __pyx_cur_scope->__pyx_v_tagparser, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __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;
    __Pyx_XGIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
    __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_L6_resume_from_yield:;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_3);
    __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 = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_AddTraceback("fastFastaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_8obitools_5fasta_6_fasta_17generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_16fastaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_15fastaIterator[] = "\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    >>> from obitools.format.sequence.fasta import fastaIterator\n    >>> f = fastaIterator('monfichier')\n    >>> s = f.next()\n    >>> print s\n    gctagctagcatgctagcatgcta\n    >>>\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_16fastaIterator = {__Pyx_NAMESTR("fastaIterator"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_16fastaIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_15fastaIterator)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_16fastaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_bioseqfactory = 0;
  PyObject *__pyx_v_tagparser = 0;
  PyObject *__pyx_v_joinseq = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__bioseqfactory,&__pyx_n_s__tagparser,&__pyx_n_s__joinseq,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fastaIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};

    /* "obitools/fasta/_fasta.pyx":220
 * 
 * def fastaIterator(object file,
 *                   object bioseqfactory=None,             # <<<<<<<<<<<<<<
 *                   bytes tagparser=__default_raw_parser,
 *                   object joinseq=None):
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_17;

    /* "obitools/fasta/_fasta.pyx":222
 *                   object bioseqfactory=None,
 *                   bytes tagparser=__default_raw_parser,
 *                   object joinseq=None):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
    values[3] = ((PyObject *)Py_None);
    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__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--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__joinseq);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastaIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __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_bioseqfactory = values[1];
    __pyx_v_tagparser = ((PyObject*)values[2]);
    __pyx_v_joinseq = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fastaIterator", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tagparser), (&PyBytes_Type), 1, "tagparser", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_15fastaIterator(__pyx_self, __pyx_v_file, __pyx_v_bioseqfactory, __pyx_v_tagparser, __pyx_v_joinseq);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":219
 *         yield fastFastaParser(entry,rtagparser,tagparser)
 * 
 * def fastaIterator(object file,             # <<<<<<<<<<<<<<
 *                   object bioseqfactory=None,
 *                   bytes tagparser=__default_raw_parser,
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_15fastaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *__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("fastaIterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *)__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator->tp_new(__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_TraceCall("fastaIterator", __pyx_f[0], 219);
  __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_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_cur_scope->__pyx_v_joinseq = __pyx_v_joinseq;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_joinseq);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_joinseq);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8obitools_5fasta_6_fasta_17generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __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.fasta._fasta.fastaIterator", __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_5fasta_6_fasta_17generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *__pyx_cur_scope = ((struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *)__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 *);
  struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser __pyx_t_6;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_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 = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":251
 *     >>>
 *     '''
 *     cdef bytes allparser = tagparser % b'[a-zA-Z][a-zA-Z0-9_]*'             # <<<<<<<<<<<<<<
 * 
 *     rtagparser = re.compile('( *%s)+' % allparser)
 */
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_cur_scope->__pyx_v_tagparser), ((PyObject *)__pyx_kp_b_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_cur_scope->__pyx_v_allparser = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":253
 *     cdef bytes allparser = tagparser % b'[a-zA-Z][a-zA-Z0-9_]*'
 * 
 *     rtagparser = re.compile('( *%s)+' % allparser)             # <<<<<<<<<<<<<<
 * 
 *     for entry in fastaEntryIterator(file):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __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_16), ((PyObject *)__pyx_cur_scope->__pyx_v_allparser)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __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 = 253; __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 = 253; __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_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_rtagparser = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":255
 *     rtagparser = re.compile('( *%s)+' % allparser)
 * 
 *     for entry in fastaEntryIterator(file):             # <<<<<<<<<<<<<<
 *         yield fastaParser(entry,bioseqfactory,rtagparser,tagparser,joinseq)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastaEntryIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __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/fasta/_fasta.pyx":256
 * 
 *     for entry in fastaEntryIterator(file):
 *         yield fastaParser(entry,bioseqfactory,rtagparser,tagparser,joinseq)             # <<<<<<<<<<<<<<
 * 
 * def rawFastaIterator(file,bioseqfactory=None,
 */
    if (!(likely(PyBytes_CheckExact(__pyx_cur_scope->__pyx_v_entry))||((__pyx_cur_scope->__pyx_v_entry) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_cur_scope->__pyx_v_entry)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_entry;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.joinseq = __pyx_cur_scope->__pyx_v_joinseq;
    __pyx_t_1 = __pyx_f_8obitools_5fasta_6_fasta_fastaParser(((PyObject*)__pyx_t_2), __pyx_cur_scope->__pyx_v_bioseqfactory, __pyx_cur_scope->__pyx_v_rtagparser, __pyx_cur_scope->__pyx_v_tagparser, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __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;
    __Pyx_XGIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
    __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_L6_resume_from_yield:;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_3);
    __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 = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_AddTraceback("fastaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_8obitools_5fasta_6_fasta_20generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_19rawFastaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_19rawFastaIterator = {__Pyx_NAMESTR("rawFastaIterator"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_19rawFastaIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_19rawFastaIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_bioseqfactory = 0;
  PyObject *__pyx_v_tagparser = 0;
  PyObject *__pyx_v_joinseq = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file,&__pyx_n_s__bioseqfactory,&__pyx_n_s__tagparser,&__pyx_n_s__joinseq,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rawFastaIterator (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};

    /* "obitools/fasta/_fasta.pyx":258
 *         yield fastaParser(entry,bioseqfactory,rtagparser,tagparser,joinseq)
 * 
 * def rawFastaIterator(file,bioseqfactory=None,             # <<<<<<<<<<<<<<
 *                      tagparser=__default_raw_parser,
 *                      joinseq=None):
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_18;

    /* "obitools/fasta/_fasta.pyx":260
 * def rawFastaIterator(file,bioseqfactory=None,
 *                      tagparser=__default_raw_parser,
 *                      joinseq=None):             # <<<<<<<<<<<<<<
 * 
 *     rawparser=tagparser
 */
    values[3] = ((PyObject *)Py_None);
    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__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--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__joinseq);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rawFastaIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __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_bioseqfactory = values[1];
    __pyx_v_tagparser = values[2];
    __pyx_v_joinseq = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rawFastaIterator", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.rawFastaIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_18rawFastaIterator(__pyx_self, __pyx_v_file, __pyx_v_bioseqfactory, __pyx_v_tagparser, __pyx_v_joinseq);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":258
 *         yield fastaParser(entry,bioseqfactory,rtagparser,tagparser,joinseq)
 * 
 * def rawFastaIterator(file,bioseqfactory=None,             # <<<<<<<<<<<<<<
 *                      tagparser=__default_raw_parser,
 *                      joinseq=None):
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_18rawFastaIterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_bioseqfactory, PyObject *__pyx_v_tagparser, PyObject *__pyx_v_joinseq) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *__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("rawFastaIterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *)__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator->tp_new(__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_TraceCall("rawFastaIterator", __pyx_f[0], 258);
  __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_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_cur_scope->__pyx_v_joinseq = __pyx_v_joinseq;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_joinseq);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_joinseq);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8obitools_5fasta_6_fasta_20generator2, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __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.fasta._fasta.rawFastaIterator", __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_5fasta_6_fasta_20generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *__pyx_cur_scope = ((struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *)__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;
  struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser __pyx_t_7;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_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 = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":262
 *                      joinseq=None):
 * 
 *     rawparser=tagparser             # <<<<<<<<<<<<<<
 *     allparser = tagparser % '[a-zA-Z][a-zA-Z0-9_]*'
 *     tagparser = re.compile('( *%s)+' % allparser)
 */
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tagparser);
  __pyx_cur_scope->__pyx_v_rawparser = __pyx_cur_scope->__pyx_v_tagparser;

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

  /* "obitools/fasta/_fasta.pyx":264
 *     rawparser=tagparser
 *     allparser = tagparser % '[a-zA-Z][a-zA-Z0-9_]*'
 *     tagparser = re.compile('( *%s)+' % allparser)             # <<<<<<<<<<<<<<
 * 
 *     for entry in rawFastaEntryIterator(file):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __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 = 264; __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_16), __pyx_cur_scope->__pyx_v_allparser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __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 = 264; __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 = 264; __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_GOTREF(__pyx_cur_scope->__pyx_v_tagparser);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_tagparser);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_tagparser = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "obitools/fasta/_fasta.pyx":266
 *     tagparser = re.compile('( *%s)+' % allparser)
 * 
 *     for entry in rawFastaEntryIterator(file):             # <<<<<<<<<<<<<<
 *         entry=entry.strip()
 *         yield fastaParser(entry,bioseqfactory,tagparser,rawparser,joinseq)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_19); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __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/fasta/_fasta.pyx":267
 * 
 *     for entry in rawFastaEntryIterator(file):
 *         entry=entry.strip()             # <<<<<<<<<<<<<<
 *         yield fastaParser(entry,bioseqfactory,tagparser,rawparser,joinseq)
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_entry, __pyx_n_s__strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_entry);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_entry);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_entry = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "obitools/fasta/_fasta.pyx":268
 *     for entry in rawFastaEntryIterator(file):
 *         entry=entry.strip()
 *         yield fastaParser(entry,bioseqfactory,tagparser,rawparser,joinseq)             # <<<<<<<<<<<<<<
 * 
 * def fastaNucIterator(file,tagparser=__default_raw_parser):
 */
    if (!(likely(PyBytes_CheckExact(__pyx_cur_scope->__pyx_v_entry))||((__pyx_cur_scope->__pyx_v_entry) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_cur_scope->__pyx_v_entry)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_entry;
    __Pyx_INCREF(__pyx_t_1);
    if (!(likely(PyBytes_CheckExact(__pyx_cur_scope->__pyx_v_rawparser))||((__pyx_cur_scope->__pyx_v_rawparser) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_cur_scope->__pyx_v_rawparser)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_rawparser;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.joinseq = __pyx_cur_scope->__pyx_v_joinseq;
    __pyx_t_6 = __pyx_f_8obitools_5fasta_6_fasta_fastaParser(((PyObject*)__pyx_t_1), __pyx_cur_scope->__pyx_v_bioseqfactory, __pyx_cur_scope->__pyx_v_tagparser, ((PyObject*)__pyx_t_2), 0, &__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
    __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_L6_resume_from_yield:;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_3);
    __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 = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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("rawFastaIterator", __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_5fasta_6_fasta_22fastaNucIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_21fastaNucIterator[] = "\n    iterate through a fasta 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    @rtype: a generator object\n    \n    @see: L{fastaIterator}\n    @see: L{fastaAAIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_22fastaNucIterator = {__Pyx_NAMESTR("fastaNucIterator"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_22fastaNucIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_21fastaNucIterator)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_22fastaNucIterator(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("fastaNucIterator (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, "fastaNucIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __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("fastaNucIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaNucIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_21fastaNucIterator(__pyx_self, __pyx_v_file, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":270
 *         yield fastaParser(entry,bioseqfactory,tagparser,rawparser,joinseq)
 * 
 * def fastaNucIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_21fastaNucIterator(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("fastaNucIterator", 0);
  __Pyx_TraceCall("fastaNucIterator", __pyx_f[0], 270);

  /* "obitools/fasta/_fasta.pyx":290
 *     @see: L{fastaAAIterator}
 *     '''
 *     return fastaIterator(file, NucSequence,tagparser)             # <<<<<<<<<<<<<<
 * 
 * def fastaAAIterator(file,tagparser=__default_raw_parser):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastaIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __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 *)((PyObject*)__pyx_ptype_8obitools_9_obitools_NucSequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((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, 2, __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 = 290; __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.fasta._fasta.fastaNucIterator", __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_5fasta_6_fasta_24fastaAAIterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_23fastaAAIterator[] = "\n    iterate through a fasta 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{fastaIterator}\n    @see: L{fastaNucIterator}\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_24fastaAAIterator = {__Pyx_NAMESTR("fastaAAIterator"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_24fastaAAIterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_23fastaAAIterator)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_24fastaAAIterator(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("fastaAAIterator (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, "fastaAAIterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __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("fastaAAIterator", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.fastaAAIterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_23fastaAAIterator(__pyx_self, __pyx_v_file, __pyx_v_tagparser);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":292
 *     return fastaIterator(file, NucSequence,tagparser)
 * 
 * def fastaAAIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_23fastaAAIterator(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("fastaAAIterator", 0);
  __Pyx_TraceCall("fastaAAIterator", __pyx_f[0], 292);

  /* "obitools/fasta/_fasta.pyx":311
 *     @see: L{fastaNucIterator}
 *     '''
 *     return fastaIterator(file, AASequence,tagparser)             # <<<<<<<<<<<<<<
 * 
 * def formatFasta(data,gbmode=False,upper=False,restrict=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fastaIterator); 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_t_2 = PyTuple_New(3); 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_INCREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_8obitools_9_obitools_AASequence)));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((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, 2, __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 = 311; __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.fasta._fasta.fastaAAIterator", __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_5fasta_6_fasta_26formatFasta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_25formatFasta[] = "\n    Convert a seqence or a set of sequences in a\n    string following the fasta format\n    \n    @param data: sequence or a set of sequences\n    @type data: BioSequence instance or an iterable object \n                on BioSequence instances\n                \n    @param gbmode: if set to C{True} identifier part of the title\n                   line follows recommendation from nbci to allow\n                   sequence indexing with the blast formatdb command.\n    @type gbmode: bool\n                \n    @param restrict: a set of key name that will be print in the formated\n                     output. If restrict is set to C{None} (default) then\n                     all keys are formated.\n    @type restrict: any iterable value or None\n    \n    @return: a fasta formated string\n    @rtype: str\n    ";
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_26formatFasta = {__Pyx_NAMESTR("formatFasta"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_26formatFasta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_25formatFasta)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_26formatFasta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_gbmode = 0;
  PyObject *__pyx_v_upper = 0;
  PyObject *__pyx_v_restrict = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__gbmode,&__pyx_n_s__upper,&__pyx_n_s__restrict,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formatFasta (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = __pyx_k_22;
    values[2] = __pyx_k_23;

    /* "obitools/fasta/_fasta.pyx":313
 *     return fastaIterator(file, AASequence,tagparser)
 * 
 * def formatFasta(data,gbmode=False,upper=False,restrict=None):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert a seqence or a set of sequences in a
 */
    values[3] = ((PyObject *)Py_None);
    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__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--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__restrict);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "formatFasta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __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_data = values[0];
    __pyx_v_gbmode = values[1];
    __pyx_v_upper = values[2];
    __pyx_v_restrict = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("formatFasta", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.formatFasta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_25formatFasta(__pyx_self, __pyx_v_data, __pyx_v_gbmode, __pyx_v_upper, __pyx_v_restrict);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_25formatFasta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_gbmode, PyObject *__pyx_v_upper, PyObject *__pyx_v_restrict) {
  PyObject *__pyx_v_rep = NULL;
  PyObject *__pyx_v_sequence = NULL;
  PyObject *__pyx_v_seq = NULL;
  PyObject *__pyx_v_definition = NULL;
  PyObject *__pyx_v_frgseq = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_v_id = 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;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("formatFasta", 0);
  __Pyx_TraceCall("formatFasta", __pyx_f[0], 313);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_INCREF(__pyx_v_restrict);

  /* "obitools/fasta/_fasta.pyx":335
 *     @rtype: str
 *     '''
 *     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/fasta/_fasta.pyx":336
 *     '''
 *     if isinstance(data, BioSequence):
 *         data = [data]             # <<<<<<<<<<<<<<
 * 
 *     if restrict is not None and not isinstance(restrict, set):
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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/fasta/_fasta.pyx":338
 *         data = [data]
 * 
 *     if restrict is not None and not isinstance(restrict, set):             # <<<<<<<<<<<<<<
 *         restrict = set(restrict)
 * 
 */
  __pyx_t_2 = (__pyx_v_restrict != Py_None);
  if (__pyx_t_2) {
    __pyx_t_1 = ((PyObject *)((PyObject*)(&PySet_Type)));
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_restrict, __pyx_t_1); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (!__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  if (__pyx_t_3) {

    /* "obitools/fasta/_fasta.pyx":339
 * 
 *     if restrict is not None and not isinstance(restrict, set):
 *         restrict = set(restrict)             # <<<<<<<<<<<<<<
 * 
 *     rep = []
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_restrict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_restrict);
    __Pyx_GIVEREF(__pyx_v_restrict);
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __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_restrict);
    __pyx_v_restrict = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "obitools/fasta/_fasta.pyx":341
 *         restrict = set(restrict)
 * 
 *     rep = []             # <<<<<<<<<<<<<<
 *     for sequence in data:
 *         seq = str(sequence)
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_rep = __pyx_t_5;
  __pyx_t_5 = 0;

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

    /* "obitools/fasta/_fasta.pyx":343
 *     rep = []
 *     for sequence in data:
 *         seq = str(sequence)             # <<<<<<<<<<<<<<
 *         if sequence.definition is None:
 *             definition=''
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_sequence);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sequence);
    __Pyx_GIVEREF(__pyx_v_sequence);
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_seq);
    __pyx_v_seq = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "obitools/fasta/_fasta.pyx":344
 *     for sequence in data:
 *         seq = str(sequence)
 *         if sequence.definition is None:             # <<<<<<<<<<<<<<
 *             definition=''
 *         else:
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = (__pyx_t_8 == Py_None);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_3) {

      /* "obitools/fasta/_fasta.pyx":345
 *         seq = str(sequence)
 *         if sequence.definition is None:
 *             definition=''             # <<<<<<<<<<<<<<
 *         else:
 *             definition=sequence.definition
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
      __Pyx_XDECREF(__pyx_v_definition);
      __pyx_v_definition = ((PyObject *)__pyx_kp_s_1);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "obitools/fasta/_fasta.pyx":347
 *             definition=''
 *         else:
 *             definition=sequence.definition             # <<<<<<<<<<<<<<
 *         if upper:
 *             frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)])
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_v_definition);
      __pyx_v_definition = __pyx_t_8;
      __pyx_t_8 = 0;
    }
    __pyx_L7:;

    /* "obitools/fasta/_fasta.pyx":348
 *         else:
 *             definition=sequence.definition
 *         if upper:             # <<<<<<<<<<<<<<
 *             frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)])
 *         else:
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_upper); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "obitools/fasta/_fasta.pyx":349
 *             definition=sequence.definition
 *         if upper:
 *             frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)])             # <<<<<<<<<<<<<<
 *         else:
 *             frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])
 */
      __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_60);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_int_60);
      __Pyx_GIVEREF(__pyx_int_60);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      if (PyList_CheckExact(__pyx_t_10) || PyTuple_CheckExact(__pyx_t_10)) {
        __pyx_t_11 = __pyx_t_10; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      for (;;) {
        if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_11)) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++;
        } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_11)) {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++;
        } else {
          __pyx_t_10 = __pyx_t_12(__pyx_t_11);
          if (unlikely(!__pyx_t_10)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_XDECREF(__pyx_v_x);
        __pyx_v_x = __pyx_t_10;
        __pyx_t_10 = 0;
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = PyNumber_Add(__pyx_v_x, __pyx_int_60); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PySequence_GetSlice(__pyx_v_seq, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_15 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__upper); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_v_frgseq);
      __pyx_v_frgseq = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "obitools/fasta/_fasta.pyx":351
 *             frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)])
 *         else:
 *             frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])             # <<<<<<<<<<<<<<
 *         info='; '.join(['%s=%s' % x
 *                         for x in sequence.rawiteritems()
 */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_9 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_int_60);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_60);
      __Pyx_GIVEREF(__pyx_int_60);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
        __pyx_t_10 = __pyx_t_8; __Pyx_INCREF(__pyx_t_10); __pyx_t_9 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      for (;;) {
        if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_10)) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_10)) break;
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
        } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_10)) {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
        } else {
          __pyx_t_8 = __pyx_t_12(__pyx_t_10);
          if (unlikely(!__pyx_t_8)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __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_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_int_60); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_v_seq, __pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (unlikely(PyList_Append(__pyx_t_11, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(((PyObject *)__pyx_t_11));
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_11));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_v_frgseq);
      __pyx_v_frgseq = __pyx_t_11;
      __pyx_t_11 = 0;
    }
    __pyx_L8:;

    /* "obitools/fasta/_fasta.pyx":352
 *         else:
 *             frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])
 *         info='; '.join(['%s=%s' % x             # <<<<<<<<<<<<<<
 *                         for x in sequence.rawiteritems()
 *                         if restrict is None or x[0] in restrict])
 */
    __pyx_t_11 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_24), __pyx_n_s__join); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);

    /* "obitools/fasta/_fasta.pyx":353
 *             frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])
 *         info='; '.join(['%s=%s' % x
 *                         for x in sequence.rawiteritems()             # <<<<<<<<<<<<<<
 *                         if restrict is None or x[0] in restrict])
 *         if info:
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__rawiteritems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
      } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
      } else {
        __pyx_t_8 = __pyx_t_12(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __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;

      /* "obitools/fasta/_fasta.pyx":354
 *         info='; '.join(['%s=%s' % x
 *                         for x in sequence.rawiteritems()
 *                         if restrict is None or x[0] in restrict])             # <<<<<<<<<<<<<<
 *         if info:
 *             info=info+';'
 */
      __pyx_t_3 = (__pyx_v_restrict == Py_None);
      if (!__pyx_t_3) {
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = ((PySequence_Contains(__pyx_v_restrict, __pyx_t_8))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_4 = __pyx_t_2;
      } else {
        __pyx_t_4 = __pyx_t_3;
      }
      if (__pyx_t_4) {

        /* "obitools/fasta/_fasta.pyx":353
 *             frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])
 *         info='; '.join(['%s=%s' % x
 *                         for x in sequence.rawiteritems()             # <<<<<<<<<<<<<<
 *                         if restrict is None or x[0] in restrict])
 *         if info:
 */
        __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), __pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_8));
        if (unlikely(PyList_Append(__pyx_t_10, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        goto __pyx_L15;
      }
      __pyx_L15:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_t_10));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_10));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_info);
    __pyx_v_info = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "obitools/fasta/_fasta.pyx":355
 *                         for x in sequence.rawiteritems()
 *                         if restrict is None or x[0] in restrict])
 *         if info:             # <<<<<<<<<<<<<<
 *             info=info+';'
 *         if sequence._rawinfo is not None and sequence._rawinfo:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_info); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "obitools/fasta/_fasta.pyx":356
 *                         if restrict is None or x[0] in restrict])
 *         if info:
 *             info=info+';'             # <<<<<<<<<<<<<<
 *         if sequence._rawinfo is not None and sequence._rawinfo:
 *             info+=" " + sequence._rawinfo.strip()
 */
      __pyx_t_10 = PyNumber_Add(__pyx_v_info, ((PyObject *)__pyx_kp_s_26)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_v_info);
      __pyx_v_info = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L16;
    }
    __pyx_L16:;

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

      /* "obitools/fasta/_fasta.pyx":358
 *             info=info+';'
 *         if sequence._rawinfo is not None and sequence._rawinfo:
 *             info+=" " + sequence._rawinfo.strip()             # <<<<<<<<<<<<<<
 * 
 *         id = sequence.id
 */
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s___rawinfo); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_2), __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_info, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v_info);
      __pyx_v_info = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "obitools/fasta/_fasta.pyx":360
 *             info+=" " + sequence._rawinfo.strip()
 * 
 *         id = sequence.id             # <<<<<<<<<<<<<<
 *         if gbmode:
 *             if 'gi' in sequence:
 */
    __pyx_t_10 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XDECREF(__pyx_v_id);
    __pyx_v_id = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "obitools/fasta/_fasta.pyx":361
 * 
 *         id = sequence.id
 *         if gbmode:             # <<<<<<<<<<<<<<
 *             if 'gi' in sequence:
 *                 id = "gi|%s|%s" % (sequence['gi'],id)
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gbmode); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

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

        /* "obitools/fasta/_fasta.pyx":363
 *         if gbmode:
 *             if 'gi' in sequence:
 *                 id = "gi|%s|%s" % (sequence['gi'],id)             # <<<<<<<<<<<<<<
 *             else:
 *                 id = "lcl|%s|" % (id)
 */
        __pyx_t_10 = PyObject_GetItem(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_1 = PyTuple_New(2); 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);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_id);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_id);
        __Pyx_GIVEREF(__pyx_v_id);
        __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_10));
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_id);
        __pyx_v_id = ((PyObject *)__pyx_t_10);
        __pyx_t_10 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "obitools/fasta/_fasta.pyx":365
 *                 id = "gi|%s|%s" % (sequence['gi'],id)
 *             else:
 *                 id = "lcl|%s|" % (id)             # <<<<<<<<<<<<<<
 *         title='>%s %s %s' %(id,info,definition)
 *         rep.append("%s\n%s" % (title,frgseq))
 */
        __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), __pyx_v_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_10));
        __Pyx_DECREF(__pyx_v_id);
        __pyx_v_id = ((PyObject *)__pyx_t_10);
        __pyx_t_10 = 0;
      }
      __pyx_L19:;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "obitools/fasta/_fasta.pyx":366
 *             else:
 *                 id = "lcl|%s|" % (id)
 *         title='>%s %s %s' %(id,info,definition)             # <<<<<<<<<<<<<<
 *         rep.append("%s\n%s" % (title,frgseq))
 *     return '\n'.join(rep)
 */
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_id);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_id);
    __Pyx_GIVEREF(__pyx_v_id);
    __Pyx_INCREF(__pyx_v_info);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_info);
    __Pyx_GIVEREF(__pyx_v_info);
    __Pyx_INCREF(__pyx_v_definition);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_definition);
    __Pyx_GIVEREF(__pyx_v_definition);
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_29), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_v_title);
    __pyx_v_title = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "obitools/fasta/_fasta.pyx":367
 *                 id = "lcl|%s|" % (id)
 *         title='>%s %s %s' %(id,info,definition)
 *         rep.append("%s\n%s" % (title,frgseq))             # <<<<<<<<<<<<<<
 *     return '\n'.join(rep)
 * 
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_title);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_title);
    __Pyx_GIVEREF(__pyx_v_title);
    __Pyx_INCREF(__pyx_v_frgseq);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_frgseq);
    __Pyx_GIVEREF(__pyx_v_frgseq);
    __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_16 = PyList_Append(__pyx_v_rep, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":368
 *         title='>%s %s %s' %(id,info,definition)
 *         rep.append("%s\n%s" % (title,frgseq))
 *     return '\n'.join(rep)             # <<<<<<<<<<<<<<
 * 
 * def formatSAPFastaGenerator(options):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(((PyObject *)__pyx_v_rep));
  PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_rep));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rep));
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("obitools.fasta._fasta.formatFasta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rep);
  __Pyx_XDECREF(__pyx_v_sequence);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_frgseq);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_id);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_restrict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_28formatSAPFastaGenerator(PyObject *__pyx_self, PyObject *__pyx_v_options); /*proto*/
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_28formatSAPFastaGenerator = {__Pyx_NAMESTR("formatSAPFastaGenerator"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_28formatSAPFastaGenerator, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_28formatSAPFastaGenerator(PyObject *__pyx_self, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formatSAPFastaGenerator (wrapper)", 0);
  __pyx_self = __pyx_self;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_27formatSAPFastaGenerator(__pyx_self, ((PyObject *)__pyx_v_options));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":391
 *     strict= options.strictsap
 * 
 *     def formatSAPFasta(data,gbmode=False,upper=False,restrict=None):             # <<<<<<<<<<<<<<
 *         '''
 *         Convert a seqence or a set of sequences in a
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  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("__defaults__", 0);
  __Pyx_TraceCall("__defaults__", __pyx_f[0], 391);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_gbmode);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_gbmode);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_gbmode);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_upper);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_upper);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_upper);
  __Pyx_INCREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  __pyx_r = ((PyObject *)__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.fasta._fasta.formatSAPFastaGenerator.__defaults__", __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_5fasta_6_fasta_23formatSAPFastaGenerator_1formatSAPFasta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_formatSAPFasta[] = "\n        Convert a seqence or a set of sequences in a\n        string following the fasta format as recommended for the SAP\n        software \n        \n        http://ib.berkeley.edu/labs/slatkin/munch/StatisticalAssignmentPackage.html\n        \n        @param data: sequence or a set of sequences\n        @type data: BioSequence instance or an iterable object \n                    on BioSequence instances\n                    \n        @param gbmode: if set to C{True} identifier part of the title\n                       line follows recommendation from nbci to allow\n                       sequence indexing with the blast formatdb command.\n        @type gbmode: bool\n                    \n        @param restrict: a set of key name that will be print in the formated\n                         output. If restrict is set to C{None} (default) then\n                         all keys are formated.\n        @type restrict: any iterable value or None\n        \n        @return: a fasta formated string\n        @rtype: str\n        ";
static PyMethodDef __pyx_mdef_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_1formatSAPFasta = {__Pyx_NAMESTR("formatSAPFasta"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_1formatSAPFasta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_formatSAPFasta)};
static PyObject *__pyx_pw_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_1formatSAPFasta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_gbmode = 0;
  PyObject *__pyx_v_upper = 0;
  PyObject *__pyx_v_restrict = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__gbmode,&__pyx_n_s__upper,&__pyx_n_s__restrict,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("formatSAPFasta (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_gbmode;
    values[2] = __pyx_dynamic_args->__pyx_arg_upper;
    values[3] = ((PyObject *)((PyObject *)Py_None));
    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__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--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__restrict);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "formatSAPFasta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __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_data = values[0];
    __pyx_v_gbmode = values[1];
    __pyx_v_upper = values[2];
    __pyx_v_restrict = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("formatSAPFasta", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("obitools.fasta._fasta.formatSAPFastaGenerator.formatSAPFasta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_formatSAPFasta(__pyx_self, __pyx_v_data, __pyx_v_gbmode, __pyx_v_upper, __pyx_v_restrict);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_formatSAPFasta(PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_gbmode, PyObject *__pyx_v_upper, PyObject *__pyx_v_restrict) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *__pyx_cur_scope;
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *__pyx_outer_scope;
  PyObject *__pyx_v_rep = NULL;
  PyObject *__pyx_v_sequence = NULL;
  PyObject *__pyx_v_seq = NULL;
  PyObject *__pyx_v_frgseq = NULL;
  PyObject *__pyx_v_taxid = NULL;
  PyObject *__pyx_v_definition = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_taxon = NULL;
  PyObject *__pyx_v_id = 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;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("formatSAPFasta", 0);
  __pyx_outer_scope = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_TraceCall("formatSAPFasta", __pyx_f[0], 391);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_INCREF(__pyx_v_restrict);

  /* "obitools/fasta/_fasta.pyx":416
 *         @rtype: str
 *         '''
 *         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/fasta/_fasta.pyx":417
 *         '''
 *         if isinstance(data, BioSequence):
 *             data = [data]             # <<<<<<<<<<<<<<
 * 
 *         if restrict is not None and not isinstance(restrict, set):
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __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/fasta/_fasta.pyx":419
 *             data = [data]
 * 
 *         if restrict is not None and not isinstance(restrict, set):             # <<<<<<<<<<<<<<
 *             restrict = set(restrict)
 * 
 */
  __pyx_t_2 = (__pyx_v_restrict != Py_None);
  if (__pyx_t_2) {
    __pyx_t_1 = ((PyObject *)((PyObject*)(&PySet_Type)));
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_restrict, __pyx_t_1); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (!__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  if (__pyx_t_3) {

    /* "obitools/fasta/_fasta.pyx":420
 * 
 *         if restrict is not None and not isinstance(restrict, set):
 *             restrict = set(restrict)             # <<<<<<<<<<<<<<
 * 
 *         rep = []
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_restrict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_restrict);
    __Pyx_GIVEREF(__pyx_v_restrict);
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __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_restrict);
    __pyx_v_restrict = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "obitools/fasta/_fasta.pyx":422
 *             restrict = set(restrict)
 * 
 *         rep = []             # <<<<<<<<<<<<<<
 *         for sequence in data:
 *             seq = str(sequence)
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_rep = __pyx_t_5;
  __pyx_t_5 = 0;

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

    /* "obitools/fasta/_fasta.pyx":424
 *         rep = []
 *         for sequence in data:
 *             seq = str(sequence)             # <<<<<<<<<<<<<<
 * 
 *             if upper:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_sequence);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sequence);
    __Pyx_GIVEREF(__pyx_v_sequence);
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_seq);
    __pyx_v_seq = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "obitools/fasta/_fasta.pyx":426
 *             seq = str(sequence)
 * 
 *             if upper:             # <<<<<<<<<<<<<<
 *                 frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)])
 *             else:
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_upper); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "obitools/fasta/_fasta.pyx":427
 * 
 *             if upper:
 *                 frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)])             # <<<<<<<<<<<<<<
 *             else:
 *                 frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])
 */
      __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_60);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_int_60);
      __Pyx_GIVEREF(__pyx_int_60);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      if (PyList_CheckExact(__pyx_t_10) || PyTuple_CheckExact(__pyx_t_10)) {
        __pyx_t_11 = __pyx_t_10; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      for (;;) {
        if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_11)) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++;
        } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_11)) {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++;
        } else {
          __pyx_t_10 = __pyx_t_12(__pyx_t_11);
          if (unlikely(!__pyx_t_10)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_XDECREF(__pyx_v_x);
        __pyx_v_x = __pyx_t_10;
        __pyx_t_10 = 0;
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = PyNumber_Add(__pyx_v_x, __pyx_int_60); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PySequence_GetSlice(__pyx_v_seq, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_15 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__upper); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_v_frgseq);
      __pyx_v_frgseq = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "obitools/fasta/_fasta.pyx":429
 *                 frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)])
 *             else:
 *                 frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_9 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_int_60);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_60);
      __Pyx_GIVEREF(__pyx_int_60);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
        __pyx_t_10 = __pyx_t_8; __Pyx_INCREF(__pyx_t_10); __pyx_t_9 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      for (;;) {
        if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_10)) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_10)) break;
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
        } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_10)) {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++;
        } else {
          __pyx_t_8 = __pyx_t_12(__pyx_t_10);
          if (unlikely(!__pyx_t_8)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __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_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_int_60); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_v_seq, __pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (unlikely(PyList_Append(__pyx_t_11, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(((PyObject *)__pyx_t_11));
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_11));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_v_frgseq);
      __pyx_v_frgseq = __pyx_t_11;
      __pyx_t_11 = 0;
    }
    __pyx_L7:;

    /* "obitools/fasta/_fasta.pyx":431
 *                 frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)])
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 taxid = sequence["taxid"]
 *             except KeyError:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      /*try:*/ {

        /* "obitools/fasta/_fasta.pyx":432
 * 
 *             try:
 *                 taxid = sequence["taxid"]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 if strict:
 */
        __pyx_t_11 = PyObject_GetItem(__pyx_v_sequence, ((PyObject *)__pyx_n_s__taxid)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF(__pyx_v_taxid);
        __pyx_v_taxid = __pyx_t_11;
        __pyx_t_11 = 0;
      }
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L19_try_end;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "obitools/fasta/_fasta.pyx":433
 *             try:
 *                 taxid = sequence["taxid"]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 if strict:
 *                     raise AssertionError('All sequence must have a taxid')
 */
      __pyx_t_19 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_19) {
        __Pyx_AddTraceback("obitools.fasta._fasta.formatSAPFastaGenerator.formatSAPFasta", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_1);

        /* "obitools/fasta/_fasta.pyx":434
 *                 taxid = sequence["taxid"]
 *             except KeyError:
 *                 if strict:             # <<<<<<<<<<<<<<
 *                     raise AssertionError('All sequence must have a taxid')
 *                 else:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_strict)) { __Pyx_RaiseClosureNameError("strict"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} }
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_strict); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
        if (__pyx_t_3) {

          /* "obitools/fasta/_fasta.pyx":435
 *             except KeyError:
 *                 if strict:
 *                     raise AssertionError('All sequence must have a taxid')             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          __pyx_t_8 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
          goto __pyx_L22;
        }
        /*else*/ {

          /* "obitools/fasta/_fasta.pyx":437
 *                     raise AssertionError('All sequence must have a taxid')
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             definition=' ;'
 */
          goto __pyx_L21_except_continue;
        }
        __pyx_L22:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L13_exception_handled;
        __pyx_L21_except_continue:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L18_try_continue;
      }
      __pyx_L14_except_error:;
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      goto __pyx_L1_error;
      __pyx_L18_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      goto __pyx_L5_continue;
      __pyx_L13_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      __pyx_L19_try_end:;
    }

    /* "obitools/fasta/_fasta.pyx":439
 *                     continue
 * 
 *             definition=' ;'             # <<<<<<<<<<<<<<
 * 
 *             for r in ranks:
 */
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_33));
    __Pyx_XDECREF(__pyx_v_definition);
    __pyx_v_definition = ((PyObject *)__pyx_kp_s_33);

    /* "obitools/fasta/_fasta.pyx":441
 *             definition=' ;'
 * 
 *             for r in ranks:             # <<<<<<<<<<<<<<
 *                 taxon = taxonomy.getTaxonAtRank(taxid,r)
 *                 if taxon is not None:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_ranks)) { __Pyx_RaiseClosureNameError("ranks"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_ranks) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_ranks)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_ranks; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_ranks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++;
      } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++;
      } else {
        __pyx_t_10 = __pyx_t_12(__pyx_t_1);
        if (unlikely(!__pyx_t_10)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF(__pyx_v_r);
      __pyx_v_r = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "obitools/fasta/_fasta.pyx":442
 * 
 *             for r in ranks:
 *                 taxon = taxonomy.getTaxonAtRank(taxid,r)             # <<<<<<<<<<<<<<
 *                 if taxon is not None:
 *                     definition+=' %s: %s,' % (taxonomy._ranks[r],taxonomy.getPreferedName(taxon))
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_taxonomy)) { __Pyx_RaiseClosureNameError("taxonomy"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_taxonomy, __pyx_n_s__getTaxonAtRank); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_taxid);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_taxid);
      __Pyx_GIVEREF(__pyx_v_taxid);
      __Pyx_INCREF(__pyx_v_r);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_r);
      __Pyx_GIVEREF(__pyx_v_r);
      __pyx_t_8 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_v_taxon);
      __pyx_v_taxon = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "obitools/fasta/_fasta.pyx":443
 *             for r in ranks:
 *                 taxon = taxonomy.getTaxonAtRank(taxid,r)
 *                 if taxon is not None:             # <<<<<<<<<<<<<<
 *                     definition+=' %s: %s,' % (taxonomy._ranks[r],taxonomy.getPreferedName(taxon))
 * 
 */
      __pyx_t_3 = (__pyx_v_taxon != Py_None);
      if (__pyx_t_3) {

        /* "obitools/fasta/_fasta.pyx":444
 *                 taxon = taxonomy.getTaxonAtRank(taxid,r)
 *                 if taxon is not None:
 *                     definition+=' %s: %s,' % (taxonomy._ranks[r],taxonomy.getPreferedName(taxon))             # <<<<<<<<<<<<<<
 * 
 *             definition='%s ; %s' % (definition[0:-1],taxonomy.getPreferedName(taxid))
 */
        __pyx_t_8 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_taxonomy, __pyx_n_s___ranks); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_11 = PyObject_GetItem(__pyx_t_8, __pyx_v_r); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_taxonomy, __pyx_n_s__getPreferedName); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_taxon);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_taxon);
        __Pyx_GIVEREF(__pyx_v_taxon);
        __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_15);
        __pyx_t_11 = 0;
        __pyx_t_15 = 0;
        __pyx_t_15 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_15));
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_definition, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_v_definition);
        __pyx_v_definition = __pyx_t_10;
        __pyx_t_10 = 0;
        goto __pyx_L25;
      }
      __pyx_L25:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "obitools/fasta/_fasta.pyx":446
 *                     definition+=' %s: %s,' % (taxonomy._ranks[r],taxonomy.getPreferedName(taxon))
 * 
 *             definition='%s ; %s' % (definition[0:-1],taxonomy.getPreferedName(taxid))             # <<<<<<<<<<<<<<
 * 
 *             id = sequence.id
 */
    __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_definition, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_cur_scope->__pyx_v_taxonomy)) { __Pyx_RaiseClosureNameError("taxonomy"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_taxonomy, __pyx_n_s__getPreferedName); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_INCREF(__pyx_v_taxid);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_taxid);
    __Pyx_GIVEREF(__pyx_v_taxid);
    __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_1 = 0;
    __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_35), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_11));
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_v_definition);
    __pyx_v_definition = ((PyObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "obitools/fasta/_fasta.pyx":448
 *             definition='%s ; %s' % (definition[0:-1],taxonomy.getPreferedName(taxid))
 * 
 *             id = sequence.id             # <<<<<<<<<<<<<<
 *             if gbmode:
 *                 if 'gi' in sequence:
 */
    __pyx_t_11 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_XDECREF(__pyx_v_id);
    __pyx_v_id = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "obitools/fasta/_fasta.pyx":449
 * 
 *             id = sequence.id
 *             if gbmode:             # <<<<<<<<<<<<<<
 *                 if 'gi' in sequence:
 *                     id = "gi|%s|%s" % (sequence['gi'],id)
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_gbmode); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

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

        /* "obitools/fasta/_fasta.pyx":451
 *             if gbmode:
 *                 if 'gi' in sequence:
 *                     id = "gi|%s|%s" % (sequence['gi'],id)             # <<<<<<<<<<<<<<
 *                 else:
 *                     id = "lcl|%s|" % (id)
 */
        __pyx_t_11 = PyObject_GetItem(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_v_id);
        PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_id);
        __Pyx_GIVEREF(__pyx_v_id);
        __pyx_t_11 = 0;
        __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_11));
        __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_v_id);
        __pyx_v_id = ((PyObject *)__pyx_t_11);
        __pyx_t_11 = 0;
        goto __pyx_L27;
      }
      /*else*/ {

        /* "obitools/fasta/_fasta.pyx":453
 *                     id = "gi|%s|%s" % (sequence['gi'],id)
 *                 else:
 *                     id = "lcl|%s|" % (id)             # <<<<<<<<<<<<<<
 *             title='>%s%s' %(id,definition)
 *             rep.append("%s\n%s" % (title,frgseq))
 */
        __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), __pyx_v_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_11));
        __Pyx_DECREF(__pyx_v_id);
        __pyx_v_id = ((PyObject *)__pyx_t_11);
        __pyx_t_11 = 0;
      }
      __pyx_L27:;
      goto __pyx_L26;
    }
    __pyx_L26:;

    /* "obitools/fasta/_fasta.pyx":454
 *                 else:
 *                     id = "lcl|%s|" % (id)
 *             title='>%s%s' %(id,definition)             # <<<<<<<<<<<<<<
 *             rep.append("%s\n%s" % (title,frgseq))
 *         return '\n'.join(rep)
 */
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_v_id);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_id);
    __Pyx_GIVEREF(__pyx_v_id);
    __Pyx_INCREF(__pyx_v_definition);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_definition);
    __Pyx_GIVEREF(__pyx_v_definition);
    __pyx_t_15 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_36), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_15));
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_v_title);
    __pyx_v_title = ((PyObject *)__pyx_t_15);
    __pyx_t_15 = 0;

    /* "obitools/fasta/_fasta.pyx":455
 *                     id = "lcl|%s|" % (id)
 *             title='>%s%s' %(id,definition)
 *             rep.append("%s\n%s" % (title,frgseq))             # <<<<<<<<<<<<<<
 *         return '\n'.join(rep)
 * 
 */
    __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_INCREF(__pyx_v_title);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_title);
    __Pyx_GIVEREF(__pyx_v_title);
    __Pyx_INCREF(__pyx_v_frgseq);
    PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_frgseq);
    __Pyx_GIVEREF(__pyx_v_frgseq);
    __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_11));
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __pyx_t_20 = PyList_Append(__pyx_v_rep, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __pyx_L5_continue:;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":456
 *             title='>%s%s' %(id,definition)
 *             rep.append("%s\n%s" % (title,frgseq))
 *         return '\n'.join(rep)             # <<<<<<<<<<<<<<
 * 
 *     return formatSAPFasta
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(((PyObject *)__pyx_v_rep));
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_rep));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_rep));
  __pyx_t_15 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  __pyx_r = __pyx_t_15;
  __pyx_t_15 = 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_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("obitools.fasta._fasta.formatSAPFastaGenerator.formatSAPFasta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rep);
  __Pyx_XDECREF(__pyx_v_sequence);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XDECREF(__pyx_v_frgseq);
  __Pyx_XDECREF(__pyx_v_taxid);
  __Pyx_XDECREF(__pyx_v_definition);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_taxon);
  __Pyx_XDECREF(__pyx_v_id);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_restrict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "obitools/fasta/_fasta.pyx":370
 *     return '\n'.join(rep)
 * 
 * def formatSAPFastaGenerator(options):             # <<<<<<<<<<<<<<
 *     loadTaxonomyDatabase(options)
 * 
 */

static PyObject *__pyx_pf_8obitools_5fasta_6_fasta_27formatSAPFastaGenerator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_options) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *__pyx_cur_scope;
  PyObject *__pyx_v_trank = NULL;
  PyObject *__pyx_v_formatSAPFasta = 0;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("formatSAPFastaGenerator", 0);
  __pyx_cur_scope = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *)__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator->tp_new(__pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_TraceCall("formatSAPFastaGenerator", __pyx_f[0], 370);

  /* "obitools/fasta/_fasta.pyx":371
 * 
 * def formatSAPFastaGenerator(options):
 *     loadTaxonomyDatabase(options)             # <<<<<<<<<<<<<<
 * 
 *     taxonomy=None
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_37); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __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 = 371; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "obitools/fasta/_fasta.pyx":373
 *     loadTaxonomyDatabase(options)
 * 
 *     taxonomy=None             # <<<<<<<<<<<<<<
 *     if options.taxonomy is not None:
 *         taxonomy=options.taxonomy
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_taxonomy = Py_None;

  /* "obitools/fasta/_fasta.pyx":374
 * 
 *     taxonomy=None
 *     if options.taxonomy is not None:             # <<<<<<<<<<<<<<
 *         taxonomy=options.taxonomy
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_options, __pyx_n_s__taxonomy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "obitools/fasta/_fasta.pyx":375
 *     taxonomy=None
 *     if options.taxonomy is not None:
 *         taxonomy=options.taxonomy             # <<<<<<<<<<<<<<
 * 
 *     assert taxonomy is not None,"SAP formating require indication of a taxonomy database"
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_options, __pyx_n_s__taxonomy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_taxonomy);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_taxonomy);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_taxonomy = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "obitools/fasta/_fasta.pyx":377
 *         taxonomy=options.taxonomy
 * 
 *     assert taxonomy is not None,"SAP formating require indication of a taxonomy database"             # <<<<<<<<<<<<<<
 * 
 *     ranks = ('superkingdom', 'kingdom', 'subkingdom', 'superphylum',
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_taxonomy != Py_None);
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_s_38));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "obitools/fasta/_fasta.pyx":379
 *     assert taxonomy is not None,"SAP formating require indication of a taxonomy database"
 * 
 *     ranks = ('superkingdom', 'kingdom', 'subkingdom', 'superphylum',             # <<<<<<<<<<<<<<
 *              'phylum', 'subphylum', 'superclass', 'class', 'subclass',
 *              'infraclass', 'superorder', 'order', 'suborder', 'infraorder',
 */
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
  __pyx_cur_scope->__pyx_v_ranks = ((PyObject *)__pyx_k_tuple_41);

  /* "obitools/fasta/_fasta.pyx":386
 *              'species subgroup', 'species', 'subspecies')
 * 
 *     trank=set(taxonomy._ranks)             # <<<<<<<<<<<<<<
 *     ranks = [taxonomy._ranks.index(x) for x in ranks if x in trank]
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_taxonomy, __pyx_n_s___ranks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_trank = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "obitools/fasta/_fasta.pyx":387
 * 
 *     trank=set(taxonomy._ranks)
 *     ranks = [taxonomy._ranks.index(x) for x in ranks if x in trank]             # <<<<<<<<<<<<<<
 * 
 *     strict= options.strictsap
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_ranks) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_ranks)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_ranks; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_ranks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_t_4 = ((PySequence_Contains(((PyObject *)__pyx_v_trank), __pyx_v_x))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {
      __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_taxonomy, __pyx_n_s___ranks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ranks);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ranks);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_cur_scope->__pyx_v_ranks = ((PyObject *)__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "obitools/fasta/_fasta.pyx":389
 *     ranks = [taxonomy._ranks.index(x) for x in ranks if x in trank]
 * 
 *     strict= options.strictsap             # <<<<<<<<<<<<<<
 * 
 *     def formatSAPFasta(data,gbmode=False,upper=False,restrict=None):
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_options, __pyx_n_s__strictsap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_strict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fasta/_fasta.pyx":391
 *     strict= options.strictsap
 * 
 *     def formatSAPFasta(data,gbmode=False,upper=False,restrict=None):             # <<<<<<<<<<<<<<
 *         '''
 *         Convert a seqence or a set of sequences in a
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_1formatSAPFasta, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s_45, ((PyObject *)__pyx_k_codeobj_43)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults), 2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_3)->__pyx_arg_gbmode = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_3)->__pyx_arg_upper = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_8obitools_5fasta_6_fasta_23formatSAPFastaGenerator_2__defaults__);
  __pyx_v_formatSAPFasta = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "obitools/fasta/_fasta.pyx":458
 *         return '\n'.join(rep)
 * 
 *     return formatSAPFasta             # <<<<<<<<<<<<<<
 * 
 * #class FastaIterator(SequenceFileIterator):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_formatSAPFasta);
  __pyx_r = __pyx_v_formatSAPFasta;
  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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("obitools.fasta._fasta.formatSAPFastaGenerator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_trank);
  __Pyx_XDECREF(__pyx_v_formatSAPFasta);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *)o);
  p->__pyx_v_allparser = 0;
  p->__pyx_v_entry = 0;
  p->__pyx_v_file = 0;
  p->__pyx_v_rtagparser = 0;
  p->__pyx_v_tagparser = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *)o;
  Py_XDECREF(((PyObject *)p->__pyx_v_allparser));
  Py_XDECREF(p->__pyx_v_entry);
  Py_XDECREF(p->__pyx_v_file);
  Py_XDECREF(p->__pyx_v_rtagparser);
  Py_XDECREF(((PyObject *)p->__pyx_v_tagparser));
  Py_XDECREF(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *)o;
  if (p->__pyx_v_allparser) {
    e = (*v)(p->__pyx_v_allparser, 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_file) {
    e = (*v)(p->__pyx_v_file, a); if (e) return e;
  }
  if (p->__pyx_v_rtagparser) {
    e = (*v)(p->__pyx_v_rtagparser, a); if (e) return e;
  }
  if (p->__pyx_v_tagparser) {
    e = (*v)(p->__pyx_v_tagparser, 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_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_allparser);
  p->__pyx_v_allparser = ((PyObject*)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_file);
  p->__pyx_v_file = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_rtagparser);
  p->__pyx_v_rtagparser = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_tagparser);
  p->__pyx_v_tagparser = ((PyObject*)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_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct__fastFastaIterator = {
  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__fastFastaIterator = {
  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__fastFastaIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct__fastFastaIterator = {
  #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_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fasta._fasta.__pyx_scope_struct__fastFastaIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator, /*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__fastFastaIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct__fastFastaIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct__fastFastaIterator, /*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__fastFastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *)o);
  p->__pyx_v_allparser = 0;
  p->__pyx_v_bioseqfactory = 0;
  p->__pyx_v_entry = 0;
  p->__pyx_v_file = 0;
  p->__pyx_v_joinseq = 0;
  p->__pyx_v_rtagparser = 0;
  p->__pyx_v_tagparser = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *)o;
  Py_XDECREF(((PyObject *)p->__pyx_v_allparser));
  Py_XDECREF(p->__pyx_v_bioseqfactory);
  Py_XDECREF(p->__pyx_v_entry);
  Py_XDECREF(p->__pyx_v_file);
  Py_XDECREF(p->__pyx_v_joinseq);
  Py_XDECREF(p->__pyx_v_rtagparser);
  Py_XDECREF(((PyObject *)p->__pyx_v_tagparser));
  Py_XDECREF(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *)o;
  if (p->__pyx_v_allparser) {
    e = (*v)(p->__pyx_v_allparser, a); if (e) return e;
  }
  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_file) {
    e = (*v)(p->__pyx_v_file, a); if (e) return e;
  }
  if (p->__pyx_v_joinseq) {
    e = (*v)(p->__pyx_v_joinseq, a); if (e) return e;
  }
  if (p->__pyx_v_rtagparser) {
    e = (*v)(p->__pyx_v_rtagparser, a); if (e) return e;
  }
  if (p->__pyx_v_tagparser) {
    e = (*v)(p->__pyx_v_tagparser, 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_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_allparser);
  p->__pyx_v_allparser = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(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_file);
  p->__pyx_v_file = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_joinseq);
  p->__pyx_v_joinseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_rtagparser);
  p->__pyx_v_rtagparser = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_tagparser);
  p->__pyx_v_tagparser = ((PyObject*)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_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_fastaIterator = {
  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_fastaIterator = {
  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_fastaIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_fastaIterator = {
  #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_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fasta._fasta.__pyx_scope_struct_1_fastaIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator, /*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_fastaIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_1_fastaIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_1_fastaIterator, /*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_fastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *)o);
  p->__pyx_v_allparser = 0;
  p->__pyx_v_bioseqfactory = 0;
  p->__pyx_v_entry = 0;
  p->__pyx_v_file = 0;
  p->__pyx_v_joinseq = 0;
  p->__pyx_v_rawparser = 0;
  p->__pyx_v_tagparser = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *)o;
  Py_XDECREF(p->__pyx_v_allparser);
  Py_XDECREF(p->__pyx_v_bioseqfactory);
  Py_XDECREF(p->__pyx_v_entry);
  Py_XDECREF(p->__pyx_v_file);
  Py_XDECREF(p->__pyx_v_joinseq);
  Py_XDECREF(p->__pyx_v_rawparser);
  Py_XDECREF(p->__pyx_v_tagparser);
  Py_XDECREF(p->__pyx_t_0);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *)o;
  if (p->__pyx_v_allparser) {
    e = (*v)(p->__pyx_v_allparser, a); if (e) return e;
  }
  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_file) {
    e = (*v)(p->__pyx_v_file, a); if (e) return e;
  }
  if (p->__pyx_v_joinseq) {
    e = (*v)(p->__pyx_v_joinseq, a); if (e) return e;
  }
  if (p->__pyx_v_rawparser) {
    e = (*v)(p->__pyx_v_rawparser, a); if (e) return e;
  }
  if (p->__pyx_v_tagparser) {
    e = (*v)(p->__pyx_v_tagparser, 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_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_allparser);
  p->__pyx_v_allparser = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(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_file);
  p->__pyx_v_file = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_joinseq);
  p->__pyx_v_joinseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_rawparser);
  p->__pyx_v_rawparser = 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_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_2_rawFastaIterator = {
  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_2_rawFastaIterator = {
  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_2_rawFastaIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_2_rawFastaIterator = {
  #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_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fasta._fasta.__pyx_scope_struct_2_rawFastaIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator, /*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_2_rawFastaIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_2_rawFastaIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_2_rawFastaIterator, /*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_2_rawFastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator, /*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_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *)o);
  p->__pyx_v_ranks = 0;
  p->__pyx_v_strict = 0;
  p->__pyx_v_taxonomy = 0;
  return o;
}

static void __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *)o;
  Py_XDECREF(p->__pyx_v_ranks);
  Py_XDECREF(p->__pyx_v_strict);
  Py_XDECREF(p->__pyx_v_taxonomy);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *)o;
  if (p->__pyx_v_ranks) {
    e = (*v)(p->__pyx_v_ranks, a); if (e) return e;
  }
  if (p->__pyx_v_strict) {
    e = (*v)(p->__pyx_v_strict, a); if (e) return e;
  }
  if (p->__pyx_v_taxonomy) {
    e = (*v)(p->__pyx_v_taxonomy, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator(PyObject *o) {
  struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *p = (struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_ranks);
  p->__pyx_v_ranks = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_strict);
  p->__pyx_v_strict = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_taxonomy);
  p->__pyx_v_taxonomy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_3_formatSAPFastaGenerator = {
  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_3_formatSAPFastaGenerator = {
  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_3_formatSAPFastaGenerator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_3_formatSAPFastaGenerator = {
  #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_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("obitools.fasta._fasta.__pyx_scope_struct_3_formatSAPFastaGenerator"), /*tp_name*/
  sizeof(struct __pyx_obj_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator, /*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_3_formatSAPFastaGenerator, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_3_formatSAPFastaGenerator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_3_formatSAPFastaGenerator, /*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_3_formatSAPFastaGenerator, /*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_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator, /*tp_traverse*/
  __pyx_tp_clear_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator, /*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_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator, /*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("parseFastaDescription"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_1parseFastaDescription, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fastParseFastaDescription"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_3fastParseFastaDescription, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fastFastaParser"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_5fastFastaParser, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_4fastFastaParser)},
  {__Pyx_NAMESTR("fastaParser"), (PyCFunction)__pyx_pw_8obitools_5fasta_6_fasta_7fastaParser, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8obitools_5fasta_6_fasta_6fastaParser)},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("_fasta"),
    __Pyx_DOCSTR(__pyx_k_46), /* 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_b_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0, 0},
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_b_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 0, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1},
  {&__pyx_kp_b_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__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_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_n_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 1},
  {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_n_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 1},
  {&__pyx_n_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 1},
  {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1},
  {&__pyx_n_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 1},
  {&__pyx_n_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 1},
  {&__pyx_n_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 1},
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
  {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
  {&__pyx_kp_b_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 0, 0},
  {&__pyx_kp_b_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 0, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_n_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 1},
  {&__pyx_kp_u_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 1, 0, 0},
  {&__pyx_kp_u_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 1, 0, 0},
  {&__pyx_kp_u_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 1, 0, 0},
  {&__pyx_kp_u_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 1, 0, 0},
  {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 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___ranks, __pyx_k___ranks, sizeof(__pyx_k___ranks), 0, 0, 1, 1},
  {&__pyx_n_s___rawinfo, __pyx_k___rawinfo, sizeof(__pyx_k___rawinfo), 0, 0, 1, 1},
  {&__pyx_n_s__allparser, __pyx_k__allparser, sizeof(__pyx_k__allparser), 0, 0, 1, 1},
  {&__pyx_n_s__bioseqfactory, __pyx_k__bioseqfactory, sizeof(__pyx_k__bioseqfactory), 0, 0, 1, 1},
  {&__pyx_n_s__class, __pyx_k__class, sizeof(__pyx_k__class), 0, 0, 1, 1},
  {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 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__ds, __pyx_k__ds, sizeof(__pyx_k__ds), 0, 0, 1, 1},
  {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
  {&__pyx_n_s__entry, __pyx_k__entry, sizeof(__pyx_k__entry), 0, 0, 1, 1},
  {&__pyx_n_s__family, __pyx_k__family, sizeof(__pyx_k__family), 0, 0, 1, 1},
  {&__pyx_n_s__fastFastaIterator, __pyx_k__fastFastaIterator, sizeof(__pyx_k__fastFastaIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastaAAIterator, __pyx_k__fastaAAIterator, sizeof(__pyx_k__fastaAAIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastaAAParser, __pyx_k__fastaAAParser, sizeof(__pyx_k__fastaAAParser), 0, 0, 1, 1},
  {&__pyx_n_s__fastaEntryIterator, __pyx_k__fastaEntryIterator, sizeof(__pyx_k__fastaEntryIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastaIterator, __pyx_k__fastaIterator, sizeof(__pyx_k__fastaIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastaNucIterator, __pyx_k__fastaNucIterator, sizeof(__pyx_k__fastaNucIterator), 0, 0, 1, 1},
  {&__pyx_n_s__fastaNucParser, __pyx_k__fastaNucParser, sizeof(__pyx_k__fastaNucParser), 0, 0, 1, 1},
  {&__pyx_n_s__fastaParser, __pyx_k__fastaParser, sizeof(__pyx_k__fastaParser), 0, 0, 1, 1},
  {&__pyx_n_s__file, __pyx_k__file, sizeof(__pyx_k__file), 0, 0, 1, 1},
  {&__pyx_n_s__formatFasta, __pyx_k__formatFasta, sizeof(__pyx_k__formatFasta), 0, 0, 1, 1},
  {&__pyx_n_s__formatSAPFasta, __pyx_k__formatSAPFasta, sizeof(__pyx_k__formatSAPFasta), 0, 0, 1, 1},
  {&__pyx_n_s__frgseq, __pyx_k__frgseq, sizeof(__pyx_k__frgseq), 0, 0, 1, 1},
  {&__pyx_n_s__gbmode, __pyx_k__gbmode, sizeof(__pyx_k__gbmode), 0, 0, 1, 1},
  {&__pyx_n_s__genus, __pyx_k__genus, sizeof(__pyx_k__genus), 0, 0, 1, 1},
  {&__pyx_n_s__getPreferedName, __pyx_k__getPreferedName, sizeof(__pyx_k__getPreferedName), 0, 0, 1, 1},
  {&__pyx_n_s__getTaxonAtRank, __pyx_k__getTaxonAtRank, sizeof(__pyx_k__getTaxonAtRank), 0, 0, 1, 1},
  {&__pyx_n_s__gi, __pyx_k__gi, sizeof(__pyx_k__gi), 0, 0, 1, 1},
  {&__pyx_n_s__group, __pyx_k__group, sizeof(__pyx_k__group), 0, 0, 1, 1},
  {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
  {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
  {&__pyx_n_s__info, __pyx_k__info, sizeof(__pyx_k__info), 0, 0, 1, 1},
  {&__pyx_n_s__infraclass, __pyx_k__infraclass, sizeof(__pyx_k__infraclass), 0, 0, 1, 1},
  {&__pyx_n_s__infraorder, __pyx_k__infraorder, sizeof(__pyx_k__infraorder), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__joinseq, __pyx_k__joinseq, sizeof(__pyx_k__joinseq), 0, 0, 1, 1},
  {&__pyx_n_s__kingdom, __pyx_k__kingdom, sizeof(__pyx_k__kingdom), 0, 0, 1, 1},
  {&__pyx_n_s__options, __pyx_k__options, sizeof(__pyx_k__options), 0, 0, 1, 1},
  {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1},
  {&__pyx_n_s__parvorder, __pyx_k__parvorder, sizeof(__pyx_k__parvorder), 0, 0, 1, 1},
  {&__pyx_n_s__phylum, __pyx_k__phylum, sizeof(__pyx_k__phylum), 0, 0, 1, 1},
  {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__ranks, __pyx_k__ranks, sizeof(__pyx_k__ranks), 0, 0, 1, 1},
  {&__pyx_n_s__rawFastaIterator, __pyx_k__rawFastaIterator, sizeof(__pyx_k__rawFastaIterator), 0, 0, 1, 1},
  {&__pyx_n_s__rawiteritems, __pyx_k__rawiteritems, sizeof(__pyx_k__rawiteritems), 0, 0, 1, 1},
  {&__pyx_n_s__rawparser, __pyx_k__rawparser, sizeof(__pyx_k__rawparser), 0, 0, 1, 1},
  {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
  {&__pyx_n_s__rep, __pyx_k__rep, sizeof(__pyx_k__rep), 0, 0, 1, 1},
  {&__pyx_n_s__restrict, __pyx_k__restrict, sizeof(__pyx_k__restrict), 0, 0, 1, 1},
  {&__pyx_n_s__rstrip, __pyx_k__rstrip, sizeof(__pyx_k__rstrip), 0, 0, 1, 1},
  {&__pyx_n_s__rtagparser, __pyx_k__rtagparser, sizeof(__pyx_k__rtagparser), 0, 0, 1, 1},
  {&__pyx_n_s__search, __pyx_k__search, sizeof(__pyx_k__search), 0, 0, 1, 1},
  {&__pyx_n_s__seq, __pyx_k__seq, sizeof(__pyx_k__seq), 0, 0, 1, 1},
  {&__pyx_n_s__sequence, __pyx_k__sequence, sizeof(__pyx_k__sequence), 0, 0, 1, 1},
  {&__pyx_n_s__species, __pyx_k__species, sizeof(__pyx_k__species), 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__strict, __pyx_k__strict, sizeof(__pyx_k__strict), 0, 0, 1, 1},
  {&__pyx_n_s__strictsap, __pyx_k__strictsap, sizeof(__pyx_k__strictsap), 0, 0, 1, 1},
  {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
  {&__pyx_n_s__subclass, __pyx_k__subclass, sizeof(__pyx_k__subclass), 0, 0, 1, 1},
  {&__pyx_n_s__subfamily, __pyx_k__subfamily, sizeof(__pyx_k__subfamily), 0, 0, 1, 1},
  {&__pyx_n_s__subgenus, __pyx_k__subgenus, sizeof(__pyx_k__subgenus), 0, 0, 1, 1},
  {&__pyx_n_s__subkingdom, __pyx_k__subkingdom, sizeof(__pyx_k__subkingdom), 0, 0, 1, 1},
  {&__pyx_n_s__suborder, __pyx_k__suborder, sizeof(__pyx_k__suborder), 0, 0, 1, 1},
  {&__pyx_n_s__subphylum, __pyx_k__subphylum, sizeof(__pyx_k__subphylum), 0, 0, 1, 1},
  {&__pyx_n_s__subspecies, __pyx_k__subspecies, sizeof(__pyx_k__subspecies), 0, 0, 1, 1},
  {&__pyx_n_s__subtribe, __pyx_k__subtribe, sizeof(__pyx_k__subtribe), 0, 0, 1, 1},
  {&__pyx_n_s__superclass, __pyx_k__superclass, sizeof(__pyx_k__superclass), 0, 0, 1, 1},
  {&__pyx_n_s__superfamily, __pyx_k__superfamily, sizeof(__pyx_k__superfamily), 0, 0, 1, 1},
  {&__pyx_n_s__supergenus, __pyx_k__supergenus, sizeof(__pyx_k__supergenus), 0, 0, 1, 1},
  {&__pyx_n_s__superkingdom, __pyx_k__superkingdom, sizeof(__pyx_k__superkingdom), 0, 0, 1, 1},
  {&__pyx_n_s__superorder, __pyx_k__superorder, sizeof(__pyx_k__superorder), 0, 0, 1, 1},
  {&__pyx_n_s__superphylum, __pyx_k__superphylum, sizeof(__pyx_k__superphylum), 0, 0, 1, 1},
  {&__pyx_n_s__supertribe, __pyx_k__supertribe, sizeof(__pyx_k__supertribe), 0, 0, 1, 1},
  {&__pyx_n_s__tagparser, __pyx_k__tagparser, sizeof(__pyx_k__tagparser), 0, 0, 1, 1},
  {&__pyx_n_s__taxid, __pyx_k__taxid, sizeof(__pyx_k__taxid), 0, 0, 1, 1},
  {&__pyx_n_s__taxon, __pyx_k__taxon, sizeof(__pyx_k__taxon), 0, 0, 1, 1},
  {&__pyx_n_s__taxonomy, __pyx_k__taxonomy, sizeof(__pyx_k__taxonomy), 0, 0, 1, 1},
  {&__pyx_n_s__title, __pyx_k__title, sizeof(__pyx_k__title), 0, 0, 1, 1},
  {&__pyx_n_s__trank, __pyx_k__trank, sizeof(__pyx_k__trank), 0, 0, 1, 1},
  {&__pyx_n_s__tribe, __pyx_k__tribe, sizeof(__pyx_k__tribe), 0, 0, 1, 1},
  {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
  {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_n_s__AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __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/fasta/_fasta.pyx":61
 * 
 *     if m is not None:
 *         info=m.group(0)             # <<<<<<<<<<<<<<
 *         definition = ds[m.end(0):].rstrip()
 *     else:
 */
  __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_3);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

  /* "obitools/fasta/_fasta.pyx":62
 *     if m is not None:
 *         info=m.group(0)
 *         definition = ds[m.end(0):].rstrip()             # <<<<<<<<<<<<<<
 *     else:
 *         info=None
 */
  __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_4);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));

  /* "obitools/fasta/_fasta.pyx":84
 * 
 *     if m is not None:
 *         info=m.group(0)             # <<<<<<<<<<<<<<
 *         definition = ds[m.end(0):].rstrip()
 *     else:
 */
  __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_5);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));

  /* "obitools/fasta/_fasta.pyx":85
 *     if m is not None:
 *         info=m.group(0)
 *         definition = ds[m.end(0):].rstrip()             # <<<<<<<<<<<<<<
 *     else:
 *         info=None
 */
  __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_6);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));

  /* "obitools/fasta/_fasta.pyx":117
 *     @return: a C{BioSequence} instance
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')             # <<<<<<<<<<<<<<
 *     cdef list  title = lseq.pop(0).split(None,1)
 *     cdef bytes id    = title[0][1:]
 */
  __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_8);
  __Pyx_INCREF(((PyObject *)__pyx_kp_b_7));
  PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_b_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_b_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "obitools/fasta/_fasta.pyx":118
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')
 *     cdef list  title = lseq.pop(0).split(None,1)             # <<<<<<<<<<<<<<
 *     cdef bytes id    = title[0][1:]
 *     cdef bytes defintion,info
 */
  __pyx_k_tuple_9 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_9);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_9, 1, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "obitools/fasta/_fasta.pyx":158
 *     @return: a C{BioSequence} instance
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')             # <<<<<<<<<<<<<<
 *     cdef list  title = lseq.pop(0).split(None,1)
 *     cdef bytes id    = title[0][1:]
 */
  __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_10);
  __Pyx_INCREF(((PyObject *)__pyx_kp_b_7));
  PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_kp_b_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_b_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));

  /* "obitools/fasta/_fasta.pyx":159
 *     '''
 *     cdef list  lseq  = seq.split(b'\n')
 *     cdef list  title = lseq.pop(0).split(None,1)             # <<<<<<<<<<<<<<
 *     cdef bytes id    = title[0][1:]
 *     cdef bytes defintion,info
 */
  __pyx_k_tuple_11 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_11);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_11, 1, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));

  /* "obitools/fasta/_fasta.pyx":435
 *             except KeyError:
 *                 if strict:
 *                     raise AssertionError('All sequence must have a taxid')             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
  __pyx_k_tuple_32 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_32);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
  PyTuple_SET_ITEM(__pyx_k_tuple_32, 0, ((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));

  /* "obitools/fasta/_fasta.pyx":379
 *     assert taxonomy is not None,"SAP formating require indication of a taxonomy database"
 * 
 *     ranks = ('superkingdom', 'kingdom', 'subkingdom', 'superphylum',             # <<<<<<<<<<<<<<
 *              'phylum', 'subphylum', 'superclass', 'class', 'subclass',
 *              'infraclass', 'superorder', 'order', 'suborder', 'infraorder',
 */
  __pyx_k_tuple_41 = PyTuple_New(28); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_41);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__superkingdom));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_n_s__superkingdom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__superkingdom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__kingdom));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 1, ((PyObject *)__pyx_n_s__kingdom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kingdom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__subkingdom));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 2, ((PyObject *)__pyx_n_s__subkingdom));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__subkingdom));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__superphylum));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 3, ((PyObject *)__pyx_n_s__superphylum));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__superphylum));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__phylum));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 4, ((PyObject *)__pyx_n_s__phylum));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__phylum));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__subphylum));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 5, ((PyObject *)__pyx_n_s__subphylum));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__subphylum));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__superclass));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 6, ((PyObject *)__pyx_n_s__superclass));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__superclass));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__class));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 7, ((PyObject *)__pyx_n_s__class));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__class));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__subclass));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 8, ((PyObject *)__pyx_n_s__subclass));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__subclass));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__infraclass));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 9, ((PyObject *)__pyx_n_s__infraclass));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__infraclass));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__superorder));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 10, ((PyObject *)__pyx_n_s__superorder));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__superorder));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__order));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 11, ((PyObject *)__pyx_n_s__order));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__order));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__suborder));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 12, ((PyObject *)__pyx_n_s__suborder));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__suborder));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__infraorder));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 13, ((PyObject *)__pyx_n_s__infraorder));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__infraorder));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__parvorder));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 14, ((PyObject *)__pyx_n_s__parvorder));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parvorder));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__superfamily));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 15, ((PyObject *)__pyx_n_s__superfamily));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__superfamily));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__family));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 16, ((PyObject *)__pyx_n_s__family));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__family));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__subfamily));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 17, ((PyObject *)__pyx_n_s__subfamily));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__subfamily));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__supertribe));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 18, ((PyObject *)__pyx_n_s__supertribe));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__supertribe));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tribe));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 19, ((PyObject *)__pyx_n_s__tribe));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tribe));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__subtribe));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 20, ((PyObject *)__pyx_n_s__subtribe));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__subtribe));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__supergenus));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 21, ((PyObject *)__pyx_n_s__supergenus));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__supergenus));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__genus));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 22, ((PyObject *)__pyx_n_s__genus));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__genus));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__subgenus));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 23, ((PyObject *)__pyx_n_s__subgenus));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__subgenus));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 24, ((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_40));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 25, ((PyObject *)__pyx_kp_s_40));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__species));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 26, ((PyObject *)__pyx_n_s__species));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__species));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__subspecies));
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 27, ((PyObject *)__pyx_n_s__subspecies));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__subspecies));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));

  /* "obitools/fasta/_fasta.pyx":391
 *     strict= options.strictsap
 * 
 *     def formatSAPFasta(data,gbmode=False,upper=False,restrict=None):             # <<<<<<<<<<<<<<
 *         '''
 *         Convert a seqence or a set of sequences in a
 */
  __pyx_k_tuple_42 = PyTuple_New(15); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__data));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 0, ((PyObject *)__pyx_n_s__data));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__gbmode));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 1, ((PyObject *)__pyx_n_s__gbmode));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gbmode));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__upper));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 2, ((PyObject *)__pyx_n_s__upper));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__upper));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__restrict));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 3, ((PyObject *)__pyx_n_s__restrict));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__restrict));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__rep));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 4, ((PyObject *)__pyx_n_s__rep));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rep));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sequence));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 5, ((PyObject *)__pyx_n_s__sequence));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sequence));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seq));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 6, ((PyObject *)__pyx_n_s__seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__frgseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 7, ((PyObject *)__pyx_n_s__frgseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__frgseq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__taxid));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 8, ((PyObject *)__pyx_n_s__taxid));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__taxid));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__definition));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 9, ((PyObject *)__pyx_n_s__definition));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__definition));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 10, ((PyObject *)__pyx_n_s__r));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__taxon));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 11, ((PyObject *)__pyx_n_s__taxon));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__taxon));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__id));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 12, ((PyObject *)__pyx_n_s__id));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__id));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__title));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 13, ((PyObject *)__pyx_n_s__title));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__title));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 14, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));
  __pyx_k_codeobj_43 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__formatSAPFasta, 391, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":179
 *         return bioseqfactory(id, seq, definition,info,rawparser)
 * 
 * def fastaNucParser(seq,tagparser=__default_raw_parser,joinseq=None):             # <<<<<<<<<<<<<<
 *     return fastaParser(seq,NucSequence,tagparser=tagparser,joinseq=joinseq)
 * 
 */
  __pyx_k_tuple_55 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_55);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seq));
  PyTuple_SET_ITEM(__pyx_k_tuple_55, 0, ((PyObject *)__pyx_n_s__seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_55, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__joinseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_55, 2, ((PyObject *)__pyx_n_s__joinseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__joinseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));
  __pyx_k_codeobj_56 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__fastaNucParser, 179, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":182
 *     return fastaParser(seq,NucSequence,tagparser=tagparser,joinseq=joinseq)
 * 
 * def fastaAAParser(seq,tagparser=__default_raw_parser,joinseq=None):             # <<<<<<<<<<<<<<
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)
 * 
 */
  __pyx_k_tuple_57 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_57);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seq));
  PyTuple_SET_ITEM(__pyx_k_tuple_57, 0, ((PyObject *)__pyx_n_s__seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__tagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_57, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__joinseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_57, 2, ((PyObject *)__pyx_n_s__joinseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__joinseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));
  __pyx_k_codeobj_58 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__fastaAAParser, 182, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":185
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)
 * 
 * def fastFastaIterator(object file,bytes tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __pyx_k_tuple_59 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_59);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 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_59, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__allparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 2, ((PyObject *)__pyx_n_s__allparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__rtagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 3, ((PyObject *)__pyx_n_s__rtagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rtagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__entry));
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 4, ((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));
  __pyx_k_codeobj_60 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__fastFastaIterator, 185, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":219
 *         yield fastFastaParser(entry,rtagparser,tagparser)
 * 
 * def fastaIterator(object file,             # <<<<<<<<<<<<<<
 *                   object bioseqfactory=None,
 *                   bytes tagparser=__default_raw_parser,
 */
  __pyx_k_tuple_61 = PyTuple_New(7); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_61);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bioseqfactory));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 1, ((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_61, 2, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__joinseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 3, ((PyObject *)__pyx_n_s__joinseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__joinseq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__allparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 4, ((PyObject *)__pyx_n_s__allparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__rtagparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 5, ((PyObject *)__pyx_n_s__rtagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rtagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__entry));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 6, ((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));
  __pyx_k_codeobj_62 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__fastaIterator, 219, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":258
 *         yield fastaParser(entry,bioseqfactory,rtagparser,tagparser,joinseq)
 * 
 * def rawFastaIterator(file,bioseqfactory=None,             # <<<<<<<<<<<<<<
 *                      tagparser=__default_raw_parser,
 *                      joinseq=None):
 */
  __pyx_k_tuple_63 = PyTuple_New(7); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_63);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 0, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__bioseqfactory));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 1, ((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_63, 2, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__joinseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 3, ((PyObject *)__pyx_n_s__joinseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__joinseq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__rawparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 4, ((PyObject *)__pyx_n_s__rawparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rawparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__allparser));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 5, ((PyObject *)__pyx_n_s__allparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allparser));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__entry));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 6, ((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__entry));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));
  __pyx_k_codeobj_64 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__rawFastaIterator, 258, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":270
 *         yield fastaParser(entry,bioseqfactory,tagparser,rawparser,joinseq)
 * 
 * def fastaNucIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __pyx_k_tuple_65 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_65);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 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_65, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));
  __pyx_k_codeobj_66 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__fastaNucIterator, 270, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":292
 *     return fastaIterator(file, NucSequence,tagparser)
 * 
 * def fastaAAIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __pyx_k_tuple_67 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 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_67, 1, ((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tagparser));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));
  __pyx_k_codeobj_68 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__fastaAAIterator, 292, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":313
 *     return fastaIterator(file, AASequence,tagparser)
 * 
 * def formatFasta(data,gbmode=False,upper=False,restrict=None):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert a seqence or a set of sequences in a
 */
  __pyx_k_tuple_69 = PyTuple_New(13); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_69);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__data));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 0, ((PyObject *)__pyx_n_s__data));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__gbmode));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 1, ((PyObject *)__pyx_n_s__gbmode));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gbmode));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__upper));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 2, ((PyObject *)__pyx_n_s__upper));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__upper));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__restrict));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 3, ((PyObject *)__pyx_n_s__restrict));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__restrict));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__rep));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 4, ((PyObject *)__pyx_n_s__rep));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rep));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sequence));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 5, ((PyObject *)__pyx_n_s__sequence));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sequence));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__seq));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 6, ((PyObject *)__pyx_n_s__seq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__seq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__definition));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 7, ((PyObject *)__pyx_n_s__definition));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__definition));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__frgseq));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 8, ((PyObject *)__pyx_n_s__frgseq));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__frgseq));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__info));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 9, ((PyObject *)__pyx_n_s__info));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__info));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__id));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 10, ((PyObject *)__pyx_n_s__id));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__id));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__title));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 11, ((PyObject *)__pyx_n_s__title));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__title));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 12, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));
  __pyx_k_codeobj_70 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s__formatFasta, 313, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "obitools/fasta/_fasta.pyx":370
 *     return '\n'.join(rep)
 * 
 * def formatSAPFastaGenerator(options):             # <<<<<<<<<<<<<<
 *     loadTaxonomyDatabase(options)
 * 
 */
  __pyx_k_tuple_71 = PyTuple_New(8); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_71);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__options));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 0, ((PyObject *)__pyx_n_s__options));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__options));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__taxonomy));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 1, ((PyObject *)__pyx_n_s__taxonomy));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__taxonomy));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ranks));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 2, ((PyObject *)__pyx_n_s__ranks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ranks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__trank));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 3, ((PyObject *)__pyx_n_s__trank));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__trank));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__strict));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 4, ((PyObject *)__pyx_n_s__strict));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__strict));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__formatSAPFasta));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 5, ((PyObject *)__pyx_n_s__formatSAPFasta));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__formatSAPFasta));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__formatSAPFasta));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 6, ((PyObject *)__pyx_n_s__formatSAPFasta));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__formatSAPFasta));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 7, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));
  __pyx_k_codeobj_72 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_44, __pyx_n_s_73, 370, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __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;};
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) {__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_fasta(void); /*proto*/
PyMODINIT_FUNC init_fasta(void)
#else
PyMODINIT_FUNC PyInit__fasta(void); /*proto*/
PyMODINIT_FUNC PyInit__fasta(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__fasta(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("_fasta"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_46), 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__fasta___fasta) {
    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 ---*/
  __pyx_v_8obitools_5fasta_6_fasta__fastTagParser = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_8obitools_5fasta_6_fasta__cfastTagParser = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("fastaParser", (void (*)(void))__pyx_f_8obitools_5fasta_6_fasta_fastaParser, "PyObject *(PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fasta_6_fasta_fastaParser *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("fastFastaParser", (void (*)(void))__pyx_f_8obitools_5fasta_6_fasta_fastFastaParser, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("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_ExportFunction("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;}
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator = &__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct__fastFastaIterator;
  if (PyType_Ready(&__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator = &__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct_1_fastaIterator;
  if (PyType_Ready(&__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator = &__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct_2_rawFastaIterator;
  if (PyType_Ready(&__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator = &__pyx_type_8obitools_5fasta_6_fasta___pyx_scope_struct_3_formatSAPFastaGenerator;
  /*--- 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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __pyx_lineno = 84; __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._obitools"); 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, "_bioSeqGenerator", (void (**)(void))&__pyx_f_8obitools_9_obitools__bioSeqGenerator, "PyObject *(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *)") < 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/fasta/_fasta.pyx":12
 * from obitools._obitools cimport  __default_raw_parser
 * 
 * from obitools.format.genericparser import genericEntryIteratorGenerator             # <<<<<<<<<<<<<<
 * 
 * #from obitools.alignment import alignmentReader
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_48));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_48));
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s_47), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __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_48);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s_48);
    if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_48, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __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/fasta/_fasta.pyx":17
 * #from obitools.utils import universalOpen
 * 
 * import re             # <<<<<<<<<<<<<<
 * from obitools.ecopcr.options import loadTaxonomyDatabase
 * from obitools.format import SequenceFileIterator
 */
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0, -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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__re, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "obitools/fasta/_fasta.pyx":18
 * 
 * import re
 * from obitools.ecopcr.options import loadTaxonomyDatabase             # <<<<<<<<<<<<<<
 * from obitools.format import SequenceFileIterator
 * 
 */
  __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_37));
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_37));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_49), ((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_37);
  if (__pyx_t_4 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s_37);
    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_37, __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/fasta/_fasta.pyx":19
 * import re
 * from obitools.ecopcr.options import loadTaxonomyDatabase
 * from obitools.format import SequenceFileIterator             # <<<<<<<<<<<<<<
 * 
 * #from _fasta import parseFastaDescription,fastaParser
 */
  __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_51));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s_51));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_51));
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s_50), ((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_51);
  if (__pyx_t_3 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s_51);
    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_51, __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/fasta/_fasta.pyx":44
 * 
 * #fastaEntryIterator=fastGenericEntryIteratorGenerator(startEntry='>')
 * fastaEntryIterator=genericEntryIteratorGenerator(startEntry='>')             # <<<<<<<<<<<<<<
 * rawFastaEntryIterator=genericEntryIteratorGenerator(startEntry='\s*>')
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_48); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__startEntry), ((PyObject *)__pyx_kp_s_52)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastaEntryIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":45
 * #fastaEntryIterator=fastGenericEntryIteratorGenerator(startEntry='>')
 * fastaEntryIterator=genericEntryIteratorGenerator(startEntry='>')
 * rawFastaEntryIterator=genericEntryIteratorGenerator(startEntry='\s*>')             # <<<<<<<<<<<<<<
 * 
 * cdef bytes _fastaJoinSeq(list seqarray):
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_48); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__startEntry), ((PyObject *)__pyx_kp_s_53)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_19, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "obitools/fasta/_fasta.pyx":69
 *     return definition,info
 * 
 * cdef bytes  _fastTagParser=b'^[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;( +[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;)*'             # <<<<<<<<<<<<<<
 * cdef object _cfastTagParser=re.compile(_fastTagParser)
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_b_54));
  __Pyx_XGOTREF(((PyObject *)__pyx_v_8obitools_5fasta_6_fasta__fastTagParser));
  __Pyx_DECREF(((PyObject *)__pyx_v_8obitools_5fasta_6_fasta__fastTagParser));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_b_54));
  __pyx_v_8obitools_5fasta_6_fasta__fastTagParser = __pyx_kp_b_54;

  /* "obitools/fasta/_fasta.pyx":70
 * 
 * cdef bytes  _fastTagParser=b'^[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;( +[a-zA-Z][a-zA-Z0-9_]* *= *[^;]*;)*'
 * cdef object _cfastTagParser=re.compile(_fastTagParser)             # <<<<<<<<<<<<<<
 * 
 * #cdef regex_t cfastTagParser
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_5fasta_6_fasta__fastTagParser));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_8obitools_5fasta_6_fasta__fastTagParser));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_8obitools_5fasta_6_fasta__fastTagParser));
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __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;
  __Pyx_XGOTREF(__pyx_v_8obitools_5fasta_6_fasta__cfastTagParser);
  __Pyx_DECREF(__pyx_v_8obitools_5fasta_6_fasta__cfastTagParser);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_v_8obitools_5fasta_6_fasta__cfastTagParser = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":179
 *         return bioseqfactory(id, seq, definition,info,rawparser)
 * 
 * def fastaNucParser(seq,tagparser=__default_raw_parser,joinseq=None):             # <<<<<<<<<<<<<<
 *     return fastaParser(seq,NucSequence,tagparser=tagparser,joinseq=joinseq)
 * 
 */
  __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);
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fasta_6_fasta_9fastaNucParser, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastaNucParser, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":182
 *     return fastaParser(seq,NucSequence,tagparser=tagparser,joinseq=joinseq)
 * 
 * def fastaAAParser(seq,tagparser=__default_raw_parser,joinseq=None):             # <<<<<<<<<<<<<<
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_13 = ((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_5fasta_6_fasta_11fastaAAParser, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastaAAParser, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":185
 *     return fastaParser(seq,AASequence,tagparser=tagparser,joinseq=joinseq)
 * 
 * def fastFastaIterator(object file,bytes tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta file sequence by sequence.
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_14 = __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_5fasta_6_fasta_13fastFastaIterator, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastFastaIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":221
 * def fastaIterator(object file,
 *                   object bioseqfactory=None,
 *                   bytes tagparser=__default_raw_parser,             # <<<<<<<<<<<<<<
 *                   object joinseq=None):
 *     '''
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_17 = __pyx_v_8obitools_9_obitools___default_raw_parser;
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);

  /* "obitools/fasta/_fasta.pyx":219
 *         yield fastFastaParser(entry,rtagparser,tagparser)
 * 
 * def fastaIterator(object file,             # <<<<<<<<<<<<<<
 *                   object bioseqfactory=None,
 *                   bytes tagparser=__default_raw_parser,
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fasta_6_fasta_16fastaIterator, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastaIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":259
 * 
 * def rawFastaIterator(file,bioseqfactory=None,
 *                      tagparser=__default_raw_parser,             # <<<<<<<<<<<<<<
 *                      joinseq=None):
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser));
  __pyx_k_18 = ((PyObject *)__pyx_v_8obitools_9_obitools___default_raw_parser);
  __Pyx_GIVEREF(__pyx_v_8obitools_9_obitools___default_raw_parser);

  /* "obitools/fasta/_fasta.pyx":258
 *         yield fastaParser(entry,bioseqfactory,rtagparser,tagparser,joinseq)
 * 
 * def rawFastaIterator(file,bioseqfactory=None,             # <<<<<<<<<<<<<<
 *                      tagparser=__default_raw_parser,
 *                      joinseq=None):
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fasta_6_fasta_19rawFastaIterator, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rawFastaIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":270
 *         yield fastaParser(entry,bioseqfactory,tagparser,rawparser,joinseq)
 * 
 * def fastaNucIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta 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_5fasta_6_fasta_22fastaNucIterator, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastaNucIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":292
 *     return fastaIterator(file, NucSequence,tagparser)
 * 
 * def fastaAAIterator(file,tagparser=__default_raw_parser):             # <<<<<<<<<<<<<<
 *     '''
 *     iterate through a fasta 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_5fasta_6_fasta_24fastaAAIterator, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fastaAAIterator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":313
 *     return fastaIterator(file, AASequence,tagparser)
 * 
 * def formatFasta(data,gbmode=False,upper=False,restrict=None):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert a seqence or a set of sequences in a
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_k_22 = __pyx_t_5;
  __Pyx_GIVEREF(__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 = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_k_23 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fasta_6_fasta_26formatFasta, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__formatFasta, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":370
 *     return '\n'.join(rep)
 * 
 * def formatSAPFastaGenerator(options):             # <<<<<<<<<<<<<<
 *     loadTaxonomyDatabase(options)
 * 
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_8obitools_5fasta_6_fasta_28formatSAPFastaGenerator, NULL, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_73, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "obitools/fasta/_fasta.pyx":1
 * # cython: profile=True             # <<<<<<<<<<<<<<
 * """
 * fasta module provides functions to read and write sequences in fasta format.
 */
  __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 (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_74), ((PyObject *)__pyx_kp_u_75)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_76), ((PyObject *)__pyx_kp_u_77)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  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;
  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.fasta._fasta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init obitools.fasta._fasta");
  }
  __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 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 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 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 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 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);
    }
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

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
}

#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_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static void __Pyx_ExceptionReset(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;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

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 PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (op->func_doc == NULL && op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
        op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
        op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
    }
    if (op->func_doc == 0) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL)
        op->func_doc = Py_None; /* Mark as deleted */
    else
        op->func_doc = value;
    Py_INCREF(op->func_doc);
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (op->func_name == NULL) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (value == NULL || !PyUnicode_Check(value)) {
#else
    if (value == NULL || !PyString_Check(value)) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (op->func_dict == NULL) {
        op->func_dict = PyDict_New();
        if (op->func_dict == NULL)
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (value == NULL) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    PyObject* dict = PyModule_GetDict(__pyx_m);
    Py_XINCREF(dict);
    return dict;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op)
{
    if (op->defaults_tuple) {
        Py_INCREF(op->defaults_tuple);
        return op->defaults_tuple;
    }
    if (op->defaults_getter) {
        PyObject *res = op->defaults_getter((PyObject *) op);
        if (res) {
            Py_INCREF(res);
            op->defaults_tuple = res;
        }
        return res;
    }
    Py_INCREF(Py_None);
    return Py_None;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, 0, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, 0, 0, 0},
    {0, 0, 0, 0, 0}
};
#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
                                      PyObject *closure, PyObject *module, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    op->func_weakreflist = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_getter = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (m->func_weakreflist != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return PyMethod_New(func,
                            type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *func_name = __Pyx_CyFunction_get_name(op);
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                func_name, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(func_name), (void *)op);
#endif
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
    sizeof(__pyx_CyFunctionObject),   /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    (reprfunc) __Pyx_CyFunction_repr,   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    __Pyx_PyCFunction_Call,             /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_CyFunction_traverse,   /*tp_traverse*/
    (inquiry) __Pyx_CyFunction_clear,   /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    0,                                  /*tp_iternext*/
    __pyx_CyFunction_methods,           /*tp_methods*/
    __pyx_CyFunction_members,           /*tp_members*/
    __pyx_CyFunction_getsets,           /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    __Pyx_CyFunction_descr_get,         /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    offsetof(__pyx_CyFunctionObject, func_dict),/*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*/
    0,                                  /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static int __Pyx_CyFunction_init(void)
{
    if (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
        return -1;
    __pyx_CyFunctionType = &__pyx_CyFunctionType_type;
    return 0;
}
void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, sizeof(size));
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}

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;
    }
}

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_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    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 */
